jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

How to config the default LLM for chat window

Open younggis opened this issue 1 year ago • 1 comments
trafficstars

I have built a container and installed the Jupyter and Jupyter AI plugins. Now, I want to configure the default large language model, model base url, and api key during the container building process. How can I write my Dockerfile. Here is my Dockerfile:

` FROM python:3.9-slim ADD . /app WORKDIR /app

RUN pip install jupyter RUN pip install jupyter-ai RUN pip install langchain_openai

COPY config.json ~/.local/share/jupyter/jupyter_ai/ EXPOSE 8888 CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--no-browser", "--allow-root"] `

I once set up config. json, but it got an error message:

{ "model_provider_id": "fastchat:Qwen2-7B-Instruct", "embeddings_provider_id": null, "send_with_shift_enter": false, "fields": { "fastchat:Qwen2-7B-Instruct": { "openai_api_base": "http://10.10.4.1:22001/v1", "openai_proxy": "" } }, "api_keys": { "OPENAI_API_KEY": "123" }, "completions_model_provider_id": "", "completions_fields": {} }

image

younggis avatar Sep 04 '24 09:09 younggis

According to the docs the config file should be something like

{
    "AiExtension": {
        "model_parameters": {
            "bedrock:ai21.j2-mid-v1": {
                "model_kwargs": {
                    "maxTokens": 200
                }
            }
        }
    }
}

You can find the config paths by running jupyter --paths command,

In my case, I can see the model parameters configured

[I 2024-09-27 12:52:40.374 AiExtension] Configured model parameters: {'hf:meta-llama/Meta-Llama-3.1-405B-Instruct': {'model_kwargs': {'maxTokens': 2048}}}

But the 'Completion model' field is emtpy image

Venustiano avatar Sep 27 '24 13:09 Venustiano