jupyterlab / jupyter-ai

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

Remove hard-coded default list of model aliases in magic commands #795

Open JasonWeill opened 2 months ago

JasonWeill commented 2 months ago

Problem

A fresh installation of Jupyter AI has the following aliases predefined. Several of these are obsolete or little-used, and by pre-defining these aliases, we developers seem to be endorsing these models.

Name Target
gpt2 huggingface_hub:gpt2
gpt3 openai:davinci-002
chatgpt openai-chat:gpt-3.5-turbo
gpt4 openai-chat:gpt-4
ernie-bot qianfan:ERNIE-Bot
ernie-bot-4 qianfan:ERNIE-Bot-4
titan bedrock:amazon.titan-tg1-large

Proposed Solution

Remove these aliases from the default Jupyter AI configuration. This may be a breaking change, if users rely on these aliases.

Additional context

Users could not add custom model aliases when Jupyter AI first launched (#45) but this was added with #136, in June 2023.

aroffe99 commented 3 weeks ago

To avoid breaking changes with deleting these aliases, I think a nice feature would be for users to specify aliases in the startup configuration.

This would allow users to specify these aliases (amongst others they might always use) in the configuration instead of running the %ai register command in their notebooks. And those aliases will be available without the need for re-registering them in a notebook.

krassowski commented 2 weeks ago

It is possible to add traitlet configuration to magics, in IPython core this is done for %store magic here and then user just sets c.StoreMagics.autorestore = True in their config file. I think these aliases should be moved to a Dict traitlet.