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

Jupyter-ai error 'exceeded quota' in docker container #659

Closed
evogelpohl opened this issue Feb 28, 2024 · 2 comments
Closed

Jupyter-ai error 'exceeded quota' in docker container #659

evogelpohl opened this issue Feb 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@evogelpohl
Copy link

evogelpohl commented Feb 28, 2024

Description

Note this dockerFile and compose (mac) file: https://github.com/evogelpohl/docker_spark_delta_jupyter_ai_tools

BUG: Upon image build & compose-up, I start the Jupyter Labs AI 'setup', select one of several OpenAI GPT models, enter my API key and attempt a session. I get the following error:

openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}

I know my key works. I've used it several times in other projects. I've also set it in my docker '.env' variable.

Reproduce

  1. clone my github project
  2. open in VSCode w/ Docker installed, right click on the mac yaml compose file, select 'compose up'
  3. it will build the image and set the url to localhost to 8888
  4. navigate to the localost:8888
  5. click the chat jupter-ai extension icon on the left nav, start the setup
  6. select openai gpt-4 (or others)
  7. enter your api key, (click enter twice)
  8. go back to chat panel
  9. enter "hello" - I get bug.

Expected behavior

normal convo w/ gpt-4

Context

full trace error:
Traceback (most recent call last):
File "/opt/conda/lib/python3.11/site-packages/jupyter_ai/chat_handlers/base.py", line 113, in on_message
await self.process_message(message)
File "/opt/conda/lib/python3.11/site-packages/jupyter_ai/chat_handlers/default.py", line 54, in process_message
response = await self.llm_chain.apredict(input=message.body, stop=["\nHuman:"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain/chains/llm.py", line 310, in apredict
return (await self.acall(kwargs, callbacks=callbacks))[self.output_key]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain_core/_api/deprecation.py", line 154, in awarning_emitting_wrapper
return await wrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain/chains/base.py", line 428, in acall
return await self.ainvoke(
^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain/chains/base.py", line 212, in ainvoke
raise e
File "/opt/conda/lib/python3.11/site-packages/langchain/chains/base.py", line 203, in ainvoke
await self._acall(inputs, run_manager=run_manager)
File "/opt/conda/lib/python3.11/site-packages/langchain/chains/llm.py", line 275, in _acall
response = await self.agenerate([inputs], run_manager=run_manager)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain/chains/llm.py", line 142, in agenerate
return await self.llm.agenerate_prompt(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain_core/language_models/chat_models.py", line 554, in agenerate_prompt
return await self.agenerate(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain_core/language_models/chat_models.py", line 514, in agenerate
raise exceptions[0]
File "/opt/conda/lib/python3.11/site-packages/langchain_core/language_models/chat_models.py", line 617, in _agenerate_with_cache
return await self._agenerate(
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain_community/chat_models/openai.py", line 534, in _agenerate
response = await acompletion_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/langchain_community/chat_models/openai.py", line 105, in acompletion_with_retry
return await llm.async_client.create(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1330, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1725, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1428, in request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1504, in _request
return await self._retry_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1550, in _retry_request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1504, in _request
return await self._retry_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1550, in _retry_request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1519, in _request
raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}

@evogelpohl evogelpohl added the bug Something isn't working label Feb 28, 2024
Copy link

welcome bot commented Feb 28, 2024

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! 🎉

@evogelpohl
Copy link
Author

My mistake! I indeed was out of credits. This project works.

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

1 participant