jupyterlab / jupyter-ai

A generative AI extension for JupyterLab
https://jupyter-ai.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
3.13k stars 310 forks source link

Config file is ignored by chat UI #955

Closed kris-grig closed 1 month ago

kris-grig commented 1 month ago

Description

I'm trying to install jupyter-ai in my container by building from source (using pip install -e . in jupyter-ai and jupyter-ai-magics packages). As I only have access to AZURE_OPENAI model, I want to have the default configuration, which provides api_key and other parameters. For that, I created jupyter_jupyter_ai_config.json with this content:

{ "default_language_model": "azure-chat-openai:MY_DEPLOYMENT_NAME", "embeddings_provider_id": null, "send_with_shift_enter": false, "fields": { "azure-chat-openai:MY_DEPLOYMENT_NAME": { "openai_api_base": "https://***.openai.azure.com", "api_version": "2024-02-01" } }, "default_api_keys": { "OPENAI_API_KEY": "", "AZURE_OPENAI_AD_TOKEN": "" }, "completions_model_provider_id": null, "completions_fields": {}, "blocked_providers": "huggingface_hub" } and put it in the /home/jovyan/.jupyter folder. However, after starting the chat in the UI, it still opens a model selection interface.

Expected behavior

Overcome selecting any model provider from UI and use the default provider specified in the config file.

Context

krassowski commented 1 month ago

As per what you pasted above, your file seems to be missing top-level "AiExtension" key, see https://jupyter-ai.readthedocs.io/en/latest/users/index.html#configuring-as-a-config-file.

FYI, JupyterLab 3.6.7 is no longer supported.