Find answers from the community

Updated 3 months ago

Hi everyone. I'm wondering if we could

Hi everyone. I'm wondering if we could be using gpt with a custom endpoint? I mean, the OpenAI API is bridged to a new URL but the API stays the same, and I want to set the base URL of GPT to that bridged one. Many thanks!
L
T
2 comments
Yea you can set the api_base in the openai LLM class

Plain Text
llm = OpenAI(..., api_base="https://api.openai.com/v1")
I failed upon setting it and then executing ServiceContext.from_defaults(llm=llm), then I accidentally came across that setting openai.base_url for the openai pkg solves it. πŸ™‚ But still, thank you!
Add a reply
Sign up and join the conversation on Discord