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

Set OpenAI API Endpoint URL (AEGHB-446) #110

Closed
sammcj opened this issue Nov 8, 2023 · 8 comments
Closed

Set OpenAI API Endpoint URL (AEGHB-446) #110

sammcj opened this issue Nov 8, 2023 · 8 comments

Comments

@sammcj
Copy link

sammcj commented Nov 8, 2023

We need a way to set the OpenAI API Endpoint URL both in the examples and helper libraries.

This is usually refered to as the "BASE_URL" in other languages and defaults to https://api.openai.com/v1.

This needs to be able to be changed to run against OpenAI compatible APIs with different endpoints, for example I might want to change it to query https://openai-proxy.local/v1.

@github-actions github-actions bot changed the title Set OpenAI API Endpoint URL Set OpenAI API Endpoint URL (AEGHB-446) Nov 8, 2023
@LHYhorion
Copy link

We need a way to set the OpenAI API Endpoint URL both in the examples and helper libraries.

This is usually refered to as the "BASE_URL" in other languages and defaults to https://api.openai.com/v1.

This needs to be able to be changed to run against OpenAI compatible APIs with different endpoints, for example I might want to change it to query https://openai-proxy.local/v1.

Hello, if you change the URL as you desire, will the format of the POST request change with the URL?

@sammcj
Copy link
Author

sammcj commented Nov 8, 2023

No, other than the base URL, all other paths on the API are the same. There are several projects that make use of 100% compatible open AI APIs - all you need to do is change the base, your real to your servers address

@LHYhorion
Copy link

No, other than the base URL, all other paths on the API are the same. There are several projects that make use of 100% compatible open AI APIs - all you need to do is change the base, your real to your servers address

This is a great idea, can you provide links to the projects you mentioned?

@sammcj
Copy link
Author

sammcj commented Nov 8, 2023

Yep sure thing, most of the popular LLM servers offer it now.

There’s also nice integration libraries like LiteLLM which basically means any project that uses it automatically gets an openAI compatible API: https://github.com/BerriAI/litellm

The irony that all of this has to happen because openAI isn’t in the slightest bit open is not lost on me.

@LHYhorion
Copy link

Yep sure thing, most of the popular LLM servers offer it now.

There’s also nice integration libraries like LiteLLM which basically means any project that uses it automatically gets an openAI compatible API: https://github.com/BerriAI/litellm

The irony that all of this has to happen because openAI isn’t in the slightest bit open is not lost on me.

Okay, thank you very much for your ideas. We will reference the projects you provided to evaluate how to expand the URL to meet your needs.

@sammcj
Copy link
Author

sammcj commented Nov 9, 2023

Fantastic! Thank you so much.

@sammcj
Copy link
Author

sammcj commented Nov 10, 2023

I had a hack on the upstream espressif package that provides openAI, I suspect the change might be something like this - espressif/esp-iot-solution@master...sammcj:esp-iot-solution:master

@LHYhorion
Copy link

I had a hack on the upstream espressif package that provides openAI, I suspect the change might be something like this - espressif/[email protected]:esp-iot-solution:master

Certainly, we have seen the modifications you made, and they look appropriate. We will further evaluate, and if there are no issues, we will implement your suggestions. Thank you very much for your advice.

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

2 participants