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

v3: unable to open AI settings #1253

Open
uhaotian opened this issue Feb 19, 2025 · 5 comments
Open

v3: unable to open AI settings #1253

uhaotian opened this issue Feb 19, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@uhaotian
Copy link

Description

  1. Start JupyterLab.
  2. Go to "Settings" menu and pick "AI Settings".
  3. See the following error.

Image

logs from server backend when I click into AI settings:

[W 2025-02-19 14:55:53.218 ServerApp] 404 GET /api/ai/config?1740005753212 (7c2a3bba168d46a49e2932fa11e83333@::1) 1.35ms referer=http://localhost:8888/lab/workspaces/auto-Z
[W 2025-02-19 14:55:53.219 ServerApp] 404 GET /api/ai/providers?1740005753212 (7c2a3bba168d46a49e2932fa11e83333@::1) 1.27ms referer=http://localhost:8888/lab/workspaces/auto-Z
[W 2025-02-19 14:55:53.221 ServerApp] 404 GET /api/ai/completion/inline?token=[secret] (7c2a3bba168d46a49e2932fa11e83333@::1) 1.09ms referer=None
[W 2025-02-19 14:55:53.222 ServerApp] 404 GET /api/ai/providers/embeddings?1740005753212 (7c2a3bba168d46a49e2932fa11e83333@::1) 1.72ms referer=http://localhost:8888/lab/workspaces/auto-Z

before clicking into AI settings, there are already 404s:

[W 2025-02-19 14:55:43.089 ServerApp] 404 GET /api/ai/completion/inline?token=[secret] (7c2a3bba168d46a49e2932fa11e83333@::1) 2.14ms referer=None
[W 2025-02-19 14:55:44.303 ServerApp] 404 GET /api/ai/completion/inline?token=[secret] (7c2a3bba168d46a49e2932fa11e83333@::1) 2.12ms referer=None

...

tried to validate extensions by: jupyter server extension list and tried multiple versions of pydantic, but no luck.
Also no validator found for jupyter_ai_maics, so not much useful information there:

    jupyter_ai enabled
    - Validating jupyter_ai...
/Users/uhaotian/.local/share/mamba/envs/jupyter-ai-testing/lib/python3.13/site-packages/jupyter_ai/config_manager.py:11: LangChainDeprecationWarning: As of langchain-core 0.3.0, LangChain uses pydantic v2 internally. The langchain.pydantic_v1 module was a compatibility shim for pydantic v1, and should no longer be used. Please update the code to import from Pydantic directly.

For example, replace imports like: `from langchain.pydantic_v1 import BaseModel`
with: `from pydantic import BaseModel`
or the v1 compatibility namespace if you are working in a code base that has not been fully upgraded to pydantic 2 yet. 	from pydantic.v1 import BaseModel

  from jupyter_ai.models import DescribeConfigResponse, GlobalConfig, UpdateConfigRequest
/Users/uhaotian/.local/share/mamba/envs/jupyter-ai-testing/lib/python3.13/site-packages/pydantic/v1/validators.py:767: UserWarning: Mixing V1 and V2 models is not supported. `EnvAuthStrategy` is a V2 model.
  warn(f'Mixing V1 and V2 models is not supported. `{type_.__name__}` is a V2 model.', UserWarning)
       X no validator found for <class 'jupyter_ai_magics.providers.EnvAuthStrategy'>, see `arbitrary_types_allowed` in Config

Reproduce

create environment with:

name: jupyter-ai-testing
dependencies:
  - python
  - pip:
    - jupyterlab==4.2.5
    - jupyter-ai==3.0.0a0
    - langchain-aws

mamba env create -f environment.yml

  1. Start JupyterLab in that environment.
  2. Go to "Settings" menu and pick "AI Settings".
  3. See the following error.

Expected behavior

It should open a window for me to select model/configure API key and etc

Context

  • Operating System and version: Mac OS 15.3
  • Browser and version: chrome
  • JupyterLab version: 4.2.5
Troubleshoot Output
```
Error:     <title>Jupyter Server</title>       <style type="text/css"> /* disable initial hide */ div#header, div#site { display: block; } </style>    
Jupyter Server requires JavaScript.
Please enable it to proceed.

404 : Not Found

You are requesting a page that does not exist!

<script type='text/javascript'> function _remove_token_from_url() { if (window.location.search.length <= 1) { return; } var search_parameters = window.location.search.slice(1).split('&'); for (var i = 0; i < search_parameters.length; i++) { if (search_parameters[i].split('=')[0] === 'token') { // remote token from search parameters search_parameters.splice(i, 1); var new_search = ''; if (search_parameters.length) { new_search = '?' + search_parameters.join('&'); } var new_url = window.location.origin + window.location.pathname + new_search + window.location.hash; window.history.replaceState({}, "", new_url); return; } } } _remove_token_from_url(); </script> ```
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
@uhaotian uhaotian added the bug Something isn't working label Feb 19, 2025
@uhaotian
Copy link
Author

relevant issue: #1172
I have tried the config that @srdas shared but no luck opening AI settings

@srdas
Copy link
Collaborator

srdas commented Feb 20, 2025

Hi, it works for me in a fresh environment and a new install. I did the following and maybe see if this works for you?

  1. conda create -n jai-test python=3.11 nodejs=20 (I am using 3.11 just to be sure)
  2. conda activate jai-test
  3. pip install git+https://github.com/jupyterlab/jupyter-ai.git
  4. pip install langchain-aws
  5. pip install langchain-openai
  6. Then run: jupyter lab
    After this, Jupyter Lab opens gracefully and the AI Settings panel also works.

@uhaotian
Copy link
Author

Thanks @srdas this setup worked for me! I think the issue might be:

  1. The GitHub version might have fixes not yet available in the PyPI release
  2. nodejs=20 the Node.js version shall be specified for v3.

@omursalo
Copy link

Thank you @srdas, this setup fixed the issue for me too. For context, I was running into the same issue on Windows.

@srdas
Copy link
Collaborator

srdas commented Feb 20, 2025

Thanks @srdas this setup worked for me! I think the issue might be:

  1. The GitHub version might have fixes not yet available in the PyPI release
  2. nodejs=20 the Node.js version shall be specified for v3.

Thanks @uhaotian and @omursalo for this feedback! Will test this when the new release comes out to make sure it is fixed. Good to know it is not OS dependent. Let's keep this open till we are sure it is fixed. Related Issue: #1250

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

No branches or pull requests

3 participants