Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to block providers by name, not only by ID #1120

Open
krassowski opened this issue Nov 25, 2024 · 1 comment
Open

Allow to block providers by name, not only by ID #1120

krassowski opened this issue Nov 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@krassowski
Copy link
Member

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?

try:
provider = model_provider_ep.load()
except Exception as e:
log.info(
f"Unable to load embeddings model provider class from entry point `{model_provider_ep.name}`: %s.",
e,
)
continue
if not is_provider_allowed(provider.id, restrictions):
log.info(f"Skipping blocked provider `{provider.id}`.")
continue

Like AiExtension.allowed_provider_entry_points or AiExtension.allowed_provider_names?

Additional context

Somewhat related annoyances:

@krassowski krassowski added the enhancement New feature or request label Nov 25, 2024
@dlqqq
Copy link
Member

dlqqq commented Nov 25, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants