Jupyter AI magic commands don't respect blocked providers

Hey there,

We are using the latest Jupyter AI version and block some model providers using the argument AiExtension.blocked_providers, e.g.:

jupyter lab \
    --AiExtension.blocked_providers=ai21 \
    --AiExtension.blocked_providers=bedrock

As expected, the models of the providers do not show up in the model selection.
However, we noticed that the magic commands still list them when running:

%load_ext jupyter_ai_magics
%ai list

Furthermore, they can still be used using the AI magic commands.

Therefore, we are wondering whether this is intended or a bug?
In the latter case, I’d be happy to open a GitHub issue with more details.

1 Like