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

OpenAI compatible API support #5

Open
Zane-XY opened this issue Jul 14, 2024 · 9 comments
Open

OpenAI compatible API support #5

Zane-XY opened this issue Jul 14, 2024 · 9 comments
Labels
requirement Requirement from the end-user when it does not match 1-1 to the feature reqquest.

Comments

@Zane-XY
Copy link

Zane-XY commented Jul 14, 2024

I noticed that the url in this crate is hardcoded, which currently only supports the official API endpoints of each AI service provider.

Would there be a plan to make the endpoint configurable? For example, allowing users to specify Azure OpenAI endpoints through configuration would greatly enhance flexibility.

@jeremychone
Copy link
Owner

@Zane-XY yes, endpoints will be configurable per adapter kind. I need to find the right way to do it (e.g., host/port v.s path ...)

@jeremychone jeremychone added the requirement Requirement from the end-user when it does not match 1-1 to the feature reqquest. label Jul 14, 2024
@jeremychone
Copy link
Owner

@Zane-XY btw, feel free to explain your particular usecase. I will make sure it get covered.

@Zane-XY
Copy link
Author

Zane-XY commented Jul 14, 2024

In my use case, the service url and models are different, but the service is OpenAI compatible. Really appreciated the fast response!

@jeremychone
Copy link
Owner

@Zane-XY thanks. Is this aws bedrock / Google vertexai, or a custom service somewhere ?
Also, is it a Ollama server? (their OpenAi compatibility layer requires some custom behaviors)

@Zane-XY
Copy link
Author

Zane-XY commented Jul 15, 2024

It's an enterprise hosted AI service.

@jeremychone
Copy link
Owner

Ok, that's will probably be a Custom Adapter then. I will get to it, genai should support this usecase.

@Boscop
Copy link

Boscop commented Sep 29, 2024

👍 +1

I'm using Jan.ai, TabbyML and LM Studio to run local models with local API server exposing an OpenAI-compatible API.
I would like to use this crate to make requests to them (also for embeddings) 🙂

@InAnYan
Copy link

InAnYan commented Oct 29, 2024

Hi! + for this feature.

Basically, it would be better to just make API base URL to be a variable that can be changed in constructor.

That's what I did to use ollama (it was not genai, other project).

  • You can also make a mock server and test the code. IDK why and where, but you can make a mock webserver and it can give you a URL which you can supply to custom code

@yihong0618
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requirement Requirement from the end-user when it does not match 1-1 to the feature reqquest.
Projects
None yet
Development

No branches or pull requests

5 participants