Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting a custom baseurl for the gpt analysis feature #339

Open
123Haynes opened this issue Nov 21, 2024 · 0 comments
Open

Allow setting a custom baseurl for the gpt analysis feature #339

123Haynes opened this issue Nov 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@123Haynes
Copy link

TL;DR

Please allow setting the baseurl for the gpt analysis function with an optional parameter.
Optionally the model as well, but even just the baseurl would be helpful 😄

Detailed design

I'm using legitify in an environment with limited internet access.
Because of that I can't access the default endpoint of chatgpt.

I can however use ollama with local models and have it pretend to be gpt3.  
It would be awesome if you could add an optional parameter that allows people to set a custom baseurl.  
As long as it's an openai compatible api this should work well.  

While my personal usecase might be a bit special, this would also allow more privacy minded persons to use the feature without exposing any data to an external party.

And if we take this one step further and allow the user to select a custom model here:
https://github.com/Legit-Labs/legitify/blob/main/internal/gpt/analyzer.go#L112

This would allow using pretty much any model, as long as it is provided on an openai compatible api.

Additional information

I did some research and it should be possible to add it to the gogpt client like this:

https://github.com/Legit-Labs/legitify/blob/main/internal/gpt/analyzer.go#L34

		// Custom client config
		config := openai.DefaultConfig(apiKey)
		config.BaseURL = "http://localhost:8500/v1"
		client := openai.NewClientWithConfig(config)
@123Haynes 123Haynes added the enhancement New feature or request label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant