-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add Support: OpenAI base url #5
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This template setting was from https://github.com/mlc-ai/web-llm/blob/ca1c3486755462dfcdc32699c651275e3fd863ce/src/conversation.ts#L158. Could you please explain your fix? Web LLM might have some different template format than other frameworks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for the PR!
I didn't think about any other base URLs for OpenAI. What are some use cases for other base URLs?
Oh I see. It seems they have changed the format at some point. Thank you so much for noticing it and adding a fix! Can you tell me more about the base URL please? |
Base URL UsageOpenAI's base URL is the API endpoint used for accessing services provided by OpenAI. By configing a different base url, user can access openai's services by forwarding. In fact, it is supported in the official SDK For example, when user cannot directly acess the offical endpoint (https://api.openai.com/v1) due to network, they can deploy their own endpoint, just like Deploy a Worker that connects to OpenAI via AI Gateway. By using self-hosted endpoint, user can also manage their requests (quato limit, ratio limit, get an overview of usage). Whats more, some user may choose a third-party openai api service provider (lower price, company's platform or any other reasons), so they need to config the base url. About the commitBase url is an optional configuration. I have set the default of base url, when user did not config it , the base url is the offical one. This means the commit is not destructive and will not interfere with existing uses. For the consistency of code processing logic, the About the fix in web-llmActually i dont know how to fix it, changes made in web-llm is just to shut up the builder. 🤣 So further fixes are needed. |
No description provided.