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

Allow to block providers by name, not only by ID

Open krassowski opened this issue 11 months ago • 1 comments
trafficstars

Problem

  • I want to allow-list 3 providers and nothing more
  • I want jupyter server to start up quickly
  • but currently an attempt to import each and every provider will be made because the checks for whether provider is allowed are only done after it is loaded

Proposed Solution

Make it possible to allow-list and block-list based on entry point name rather than on provider ID?

https://github.com/jupyterlab/jupyter-ai/blob/53251f6b1ea6e2917dbb84219902fb7370e2bf60/packages/jupyter-ai-magics/jupyter_ai_magics/utils.py#L66-L76

Like AiExtension.allowed_provider_entry_points or AiExtension.allowed_provider_names?

Additional context

Somewhat related annoyances:

  • https://github.com/jupyterlab/jupyter-ai/issues/839
  • https://github.com/jupyterlab/jupyter-ai/issues/1115

krassowski avatar Nov 25 '24 19:11 krassowski

@krassowski Thank you for this detailed proposal! I agree the startup time is an issue. I think we should also explore if there's a backward-compatible way of reducing the startup time, without requiring users specify a configurable trait that blocks entry points. Let's continue the discussion in #1115.

dlqqq avatar Nov 25 '24 23:11 dlqqq