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

API Connection Error when config points to no-longer-valid model #346

Closed
Vluptronic opened this issue Aug 16, 2023 · 12 comments
Closed

API Connection Error when config points to no-longer-valid model #346

Vluptronic opened this issue Aug 16, 2023 · 12 comments
Labels
bug Something isn't working
Milestone

Comments

@Vluptronic
Copy link

Screenshot 2023-08-16 at 4 54 04 PM

Very Funny, I followed the instruction on the readme file, properly installed and initiated jupyter lab. After I put in the API key I tried to talk to the jupyternaut.
This is what I got in terminal. And it raises an error messgae APIConnectionError.
Screenshot 2023-08-16 at 4 58 27 PM

Here are more error messges
Screenshot 2023-08-16 at 4 59 33 PM

However, by installing jupyter-ai, maybe some of my environments were changed and now I'm able to run some other jupyterlab plugins like chapyter.

Can someone explain to me what is going on? Really appreciate it.

@Vluptronic Vluptronic added the bug Something isn't working label Aug 16, 2023
@welcome
Copy link

welcome bot commented Aug 16, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@dlqqq
Copy link
Collaborator

dlqqq commented Aug 16, 2023

@Vluptronic Did you encounter the first error listed in your PR? I'm not sure how you managed to send a request to Jupyternaut if the chat panel did not work at all.

As for the latter two errors you see, those are server logs that can be safely ignored. The second one (APIConnectionError) is sometimes raised when using models from providers that rate-limit users, most notably OpenAI. The third and last error is a list of warnings emitted from Jupyter Server, which doesn't cause any issues to our knowledge. If you did not encounter the first issue, then your environment should be behaving as expected.

@Vluptronic
Copy link
Author

@dlqqq
Your are right, I did initiate the chat window, selected the llm and passed in the api key, etc; that's when it raises the api connection error because I tried to make conversations with jupyternaut.

In addition, some of my previously installed extentions were removed after I installed jupyter-ai. So I closed down the server and reinstalled those extentions.

Finally when I reopened the jupyter server the first error message above was raised.

@Vluptronic
Copy link
Author

@dlqqq OK, probably cuz I messed up the versions of jupyter lab. I will create a new environment and retry this

@Vluptronic
Copy link
Author

Retried and the first error persist.

!jupyter lab --version
4.0.5

!python --version
Python 3.11.4

!ipython --version
8.14.0

I can still use the magic commands to call the llm, though. So it's just the chat box on the left that is problematic

@VectorZhao
Copy link

Today, when I opened Jupyter Lab, I encountered this situation. After configuring it last time, it was working fine and I haven't uninstalled or installed any other libraries in the current environment.

@VectorZhao
Copy link

Find the config.json file in the directory C:\Users\10923\AppData\Roaming\jupyter\jupyter_ai. Delete this file and then relaunch Jupyter Lab. You should be able to use it normally again, but please note that you will need to reconfigure OpenAI settings.
At the moment, it is unclear whether the 404 error will reoccur.

@Niko-La
Copy link

Niko-La commented Aug 18, 2023

Hey I am using docker-compose Jupyterlab

where would this config.json file be here?

(base) jovyan@fb1475cb5b1d:/$ ls
bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

Is this a temp solution? @VectorZhao thx

@Vluptronic
Copy link
Author

@VectorZhao
This is my directory for config.json

myenv/lib/python3.11/site-packages/zmq/utils/config.json

But I can't seem to delete it

rm config.json

is it because it's a read only directory?

@dlqqq
Copy link
Collaborator

dlqqq commented Aug 18, 2023

@Vluptronic @VectorZhao @Niko-La That is not the correct path to our configuration. Running this command in your shell should yield the correct Jupyter AI configuration path:

echo "$(jupyter --data-dir)/jupyter_ai/config.json"

I would recommend 1) copying and pasting the contents of that file here to help us debug your issue, and 2) deleting that file locally and restarting Jupyter AI to see if you're able to use Jupyter AI again.

@Niko-La
Copy link

Niko-La commented Aug 21, 2023

@Vluptronic @VectorZhao @Niko-La That is not the correct path to our configuration. Running this command in your shell should yield the correct Jupyter AI configuration path:

echo "$(jupyter --data-dir)/jupyter_ai/config.json"

I would recommend 1) copying and pasting the contents of that file here to help us debug your issue, and 2) deleting that file locally and restarting Jupyter AI to see if you're able to use Jupyter AI again.

(base) jovyan@fb1475cb5b1d:~/.local/share/jupyter$ ls
nbsignatures.db  notebook_secret  runtime
(base) jovyan@fb1475cb5b1d:~/.local/share/jupyter$ echo "$(jupyter --data-dir)/jupyter_ai/config.json"
/home/jovyan/.local/share/jupyter/jupyter_ai/config.json
(base) jovyan@fb1475cb5b1d:~/.local/share/jupyter$ cd jupyter_ai
bash: cd: jupyter_ai: No such file or directory

Ran this in the jupyterlab terminal. jupyter_ai folder not there.

find /home/jovyan/.local/share -type d 
/home/jovyan/.local/share
/home/jovyan/.local/share/jupyter
/home/jovyan/.local/share/jupyter/runtime

these are the folders in there.

find /home/jovyan/.local/share -type d -name jupyter_ai not found in here.

my docker image (standard from jupyter stacks github)

  jupyter:
    image: 'jupyter/datascience-notebook:latest'
    ports:
      - '8888:8888'
    volumes:
      - /workspace:/home/jovyan/work
    container_name: jupyter
    environment:
        JUPYTER_ENABLE_LAB: 'yes'
        JUPYTER_TOKEN: "docker"

updated: devop setup

@JasonWeill JasonWeill changed the title API Connection Error. API Connection Error when config points to no-longer-valid model Aug 30, 2023
@JasonWeill JasonWeill added this to the 2.3.0 Release milestone Aug 30, 2023
@JasonWeill JasonWeill mentioned this issue Sep 6, 2023
@JasonWeill
Copy link
Collaborator

Closing because we cannot reproduce this issue, and it seems to be resolved by the commenters, per conversation with @dlqqq

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

5 participants