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

Enhancement: Option to change OpenAI API Endpoint #36

Closed
MarkSchmidty opened this issue Apr 12, 2023 · 6 comments
Closed

Enhancement: Option to change OpenAI API Endpoint #36

MarkSchmidty opened this issue Apr 12, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@MarkSchmidty
Copy link

MarkSchmidty commented Apr 12, 2023

There are OpenAI API compatible endpoints for other models, such as Basaran: https://github.com/hyperonym/basaran

Adding an endpoint variable to the .env would allow users to use any LLM with AgentGPT, not just OpenAI's endpoint.

This is hugely useful for a number of reasons. But the biggest one is that local models don't rack up an API bill.

Another use case for this is proxy endpoints which log the requests/responses. Lots of people use OpenAI's models with endpoint proxies (myself included).

@hahayusuf
Copy link

Hi @MarkSchmidty that's a good idea.

Unfortunately, OpenAI's official node.js library does not support changing the API URL endpoint.

How would you suggest approaching this?

My humble suggestions:

  • Expand the official client library to support custom URLs or,
  • Find a 3rd party node.js client library that already supports custom URLs

@MarkSchmidty
Copy link
Author

OpenAI's node.js library has a basePath option.

Here are some issues from the OpenAI node.js repo discussing using this option with proxies and alternative endpoints:

openai/openai-node#85 (comment)

openai/openai-node#53 (comment)

@hahayusuf
Copy link

hahayusuf commented Apr 13, 2023

Well pointed out thanks. In that case, it should be rather simple to add support for this.

I will add an option for specifying this in the env file.

@hahayusuf
Copy link

hahayusuf commented Apr 13, 2023

I have created a pull request for this #84

@MarkSchmidty
Copy link
Author

@hahayusuf As someone pointed out in the PR, some countries do not have access to the OpenAI API directly and must use proxies. An option to set this variable in the UI Settings would open up your hosted version to many people who cannot use it in its current form.

Something like this:
 

@asim-shrestha
Copy link
Contributor

Added support for custom base url via an ENV for local development: #543

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

4 participants