-
-
Notifications
You must be signed in to change notification settings - Fork 416
Allow embedding model fields, fix coupled model fields, add custom OpenAI provider #1264
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
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
@srdas Thank you for working on this! This is definitely one of the most challenging tasks that you've taken on thus far. Left some feedback for you below.
I think it would be best to hold off on merging this PR until after the v2.30.0 release scheduled for tomorrow. The ConfigManager areas of the code are fragile, and making lots of changes there introduces risk to users. I recommend that we ship this later to give us more time to thoroughly test these changes and mitigate that risk.
do you have any plan for merge this feature? |
@eugenecherepanov I have a couple of things still not working that need to be cleared before this can be fully tested and reviewed, hoping to get it done very soon. |
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.
@srdas The code now looks much cleaner, thank you for contributing this! Verified the changes locally.
Note that there is a bug where if you have unsaved chat model fields, the fields get reset if you change either the embedding or language model. This is an existing bug however, so this can be addressed separately in the future.
I left 2 additional comments below for you to address, but I will approve this now since those comments are minor.
"*", | ||
# "nomic-embed-text", | ||
# "mxbai-embed-large", | ||
# "all-minilm", | ||
# "snowflake-arctic-embed", |
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.
I'm fine with requiring Ollama embedding model users to set the model IDs manually, since we are doing that for the Ollama chat model anyways.
However, can you remove the comments and add a help
attribute to show a help message?
// .filter(em => em !== '*') // TODO: support registry providers | ||
// .filter(em => emp.embedding_models.includes(em)) |
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.
Can you also remove this comment?
@meeseeksdev please backport to 2.x |
…d model fields, add custom OpenAI provider
…upled model fields, add custom OpenAI provider) (#1282) * Backport PR #1264: Allow embedding model fields, fix coupled model fields, add custom OpenAI provider * Fix CI --------- Co-authored-by: Sanjiv Das <[email protected]>
…ds, fix coupled model fields, add custom OpenAI provider) (jupyterlab#1282) * Backport PR jupyterlab#1264: Allow embedding model fields, fix coupled model fields, add custom OpenAI provider * Fix CI --------- Co-authored-by: Sanjiv Das <[email protected]>
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.
Also, this PR corrects the coupled fields problem in the AI Settings page.
Finally, added the embedding fields to the
config_scheme.json
and made related changes toconfig_manager.py
andtest_ config_manager.py
Each of these changes is now described below in some more detail.
Demo of new features
See the new usage of models and the required settings shown below, note the new "OpenAI::general interface":

For any OpenAI model:

For DeepSeek models:

For models deployed with vLLM:

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

Second, modified check that the interface takes any OpenAI embedding model as an input and test that it works with OpenAI models as before:
Fixed coupled model field inputs
We can see that the fields are not coupled any more as shown below:

Added
embeddings_fields
toconfig_schema.json
config_manager.py
to handle the new fields.test_config_manager.py
for the additional embedding field in config.