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 change base_url #51

Closed
rcherukuri12 opened this issue Nov 11, 2023 · 6 comments
Closed

Allow change base_url #51

rcherukuri12 opened this issue Nov 11, 2023 · 6 comments

Comments

@rcherukuri12
Copy link

rcherukuri12 commented Nov 11, 2023

allow base_url to be set ...just not that but all other OpenAI config params.
This would make it flexible to switch and work as client for non-OpenAI local LLM servers that support OpenAI interface(s).

Adding more details:
I have a local LLM server LiteLLM running that honors OpenAPI calls.
I had to find out a round-about way of doing things like:
o = OpenAI.OpenAIProvider("junk", "http://localhost:8000", "")
and then passing this to the second create_chat(...) method to make it work.
would be great if the API is a bit more cleaner.

@roryl23
Copy link
Collaborator

roryl23 commented Nov 18, 2023

allow base_url to be set

My suggestion is to override the base_url parameter like you did, however that works for your implementation. That's part of the intended purpose of the Provider structs.

all other OpenAI config params

Do you mean parameters like OpenAI-Organization?

would be great if the API is a bit more cleaner

By cleaner API, are you referring to the base_url problem, or something more general?

@rcherukuri12
Copy link
Author

Thank you, my comment on the cleaner api just meant that the Azure Provider ( it doesn't have to be part of the main src, but can be provided as an example of override ).

@roryl23
Copy link
Collaborator

roryl23 commented Nov 19, 2023

That seems like a reasonable refactor

@rcherukuri12
Copy link
Author

Here is the example code for a local LLM that I run using OpenAI.jl :

https://github.com/rcherukuri12/ollama_julia_code_generator/blob/main/LiteLLM_Ollama_client.jl

@cpfiffer
Copy link
Collaborator

Sorry to revive a dead issue -- was there a good way to set the OpenAI organization key for requests?

@roryl23
Copy link
Collaborator

roryl23 commented Jan 21, 2024

There isn't a canonical way implemented, I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants