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

Error log when starting up extension #839

Closed
krassowski opened this issue Jun 19, 2024 · 3 comments · Fixed by #1119
Closed

Error log when starting up extension #839

krassowski opened this issue Jun 19, 2024 · 3 comments · Fixed by #1119
Labels
bug Something isn't working

Comments

@krassowski
Copy link
Member

Description

[E 2024-06-19 15:19:17.777 AiExtension] Unable to load embeddings model provider class from entry point `mistralai`: No module named 'langchain_mistralai'.

Reproduce

  1. Create a new environment
  2. pip install jupyter-ai (without [all])
  3. Start jupyter lab
  4. See error

Expected behavior

No errors on startup; lack of langchain_mistralai is not an error.

Context

2.17.0

@krassowski krassowski added the bug Something isn't working label Jun 19, 2024
@krassowski krassowski changed the title Error when starting up extension Error log when starting up extension Jun 19, 2024
@krassowski
Copy link
Member Author

For reference in other cases we get a warning, which I think is fine:

[I 2024-06-19 19:04:09.899 AiExtension] Registered model provider `bedrock-chat`.
[W 2024-06-19 19:04:09.900 AiExtension] Unable to load model provider `anthropic`. Please install the `langchain_anthropic` package.
[W 2024-06-19 19:04:09.900 AiExtension] Unable to load model provider `anthropic-chat`. Please install the `langchain_anthropic` package.
[I 2024-06-19 19:04:10.493 AiExtension] Registered model provider `azure-chat-openai`.
[I 2024-06-19 19:04:10.493 AiExtension] Registered model provider `cohere`.
[W 2024-06-19 19:04:10.494 AiExtension] Unable to load model provider `gemini`. Please install the `langchain_google_genai` package.
[I 2024-06-19 19:04:10.494 AiExtension] Registered model provider `gpt4all`.
[I 2024-06-19 19:04:10.494 AiExtension] Registered model provider `huggingface_hub`.
[W 2024-06-19 19:04:10.495 AiExtension] Unable to load model provider `mistralai`. Please install the `langchain_mistralai` package.
[W 2024-06-19 19:04:10.495 AiExtension] Unable to load model provider `nvidia-chat`. Please install the `langchain_nvidia_ai_endpoints` package.

@ctcjab
Copy link
Contributor

ctcjab commented Nov 25, 2024

We are seeing a spurious error logged not just for mistral, but for 3 other model providers as well:

[E 2024-11-25 13:49:05.361 AiExtension] Unable to load embeddings model provider class from entry point `bedrock`: No module named 'langchain_aws'.
[E 2024-11-25 13:49:05.362 AiExtension] Unable to load embeddings model provider class from entry point `cohere`: No module named 'langchain_cohere'.
...
[E 2024-11-25 13:49:05.362 AiExtension] Unable to load embeddings model provider class from entry point `mistralai`: No module named 'langchain_mistralai'.
[E 2024-11-25 13:49:05.362 AiExtension] Unable to load embeddings model provider class from entry point `ollama`: No module named 'langchain_ollama'.

This does not just add noise to the logs that users see at startup, but worse is that it makes it harder for users to hook up meaningful alerting so that someone can get paged when (real) errors are logged by anything writing to stdout/stderr.

ctcjab added a commit to ctcjab/jupyter-ai that referenced this issue Nov 25, 2024
Since it is expected that not all embeddings model providers
will be loadable, it is wrong to log
the case that one cannot be loaded
with level 'error' or even 'warning'.

Resolves jupyterlab#839.
@ctcjab
Copy link
Contributor

ctcjab commented Nov 25, 2024

Submitted #1119 to address this.

ctcjab added a commit to ctcjab/jupyter-ai that referenced this issue Nov 26, 2024
Since it is expected that not all model providers will be loadable, it
is wrong to log the case that one cannot be loaded with level 'error'.

Resolves jupyterlab#839.
@dlqqq dlqqq closed this as completed in f8dc779 Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants