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

Create a custom OpenAI provider to use multiple models #1264

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

srdas
Copy link
Collaborator

@srdas srdas commented Feb 27, 2025

Description

The OpenAI model interface has been widely adopted by many model providers (DeepSeek, vLLM, etc.) and this PR enables accessing these models using the OpenAI provider. Current OpenAI models are also accessible via the same interface.

This PR also updates related documentation on the use of these models that work via the OpenAI provider.

These updates work for selecting chat and embeddings models. Chat models are tested to work with models from OpenAI, DeepSeek, and models hosted by vLLM. Embedding models are tested for OpenAI models. DeepSeek does not have an API for embedding models, and OpenRouter also does not support as yet any embedding models.

Finally, corrected the coupled fields problem in the AI Settings page.

Demo of new features

See the new usage of models and the required settings shown below, note the new "OpenAI::general interface":
image

For any OpenAI model:
openai-chat-openai

For DeepSeek models:
openai-chat-deepseek

For models deployed with vLLM:
openai-chat-vllm

Embedding Models

First, tested to make sure that the OpenAI models are working as intended with no changes to the code:
image

Second, modified check that the interface takes any OpenAI embedding model as an input and test that it works with OpenAI models as before:

image

Fixed coupled model field inputs

We can see that the fields are not coupled any more as shown below:
image

@srdas srdas added the enhancement New feature or request label Feb 27, 2025
@srdas srdas changed the title Create a custom OpenAI provider to use multiple model providers Create a custom OpenAI provider to use multiple models Feb 27, 2025
@srdas srdas marked this pull request as ready for review February 27, 2025 19:57
@dlqqq dlqqq linked an issue Feb 27, 2025 that may be closed by this pull request
@srdas srdas force-pushed the openai_generic_2 branch from 1ba53fd to f59026b Compare March 5, 2025 06:20
@srdas srdas requested a review from dlqqq March 5, 2025 15:38
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
1 participant