cheshire-cat-ai / core

Production ready AI agent framework
https://cheshirecat.ai
GNU General Public License v3.0
2.24k stars 299 forks source link

[BUG] Docker doesn't start when OpenAI API limit is reached #869

Open MatteoSid opened 1 month ago

MatteoSid commented 1 month ago

Describe the bug I'm trying to run the docker but it fails because i reched the OpenAI API limit for my plan.

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'}}

ERROR:    Application startup failed. Exiting.

To Reproduce Steps to reproduce the behavior (as exampple`):

  1. Reach the OpenAI limit for your plan
  2. Use the docker compose down command
  3. Use the docker compose up command
  4. See error

Expected behavior I expect to see a warning that says that i reached the limit but non an error in the startup of the docker.

pieroit commented 1 month ago

Sorry I closed because I did not understand the question

Sounds right to give a warning and not a crash

MatteoSid commented 1 month ago

Sorry I closed because I did not understand the question

Sounds right to give a warning and not a crash

Ah ok perfect, thanks.

zAlweNy26 commented 1 month ago

Sorry I closed because I did not understand the question Sounds right to give a warning and not a crash

Well, I pay for OpenAI's APIs, but I've run out of available tokens. I set up the APIs within the graphical interface after starting Docker, but how can I change the APIs if Docker doesn't start? Isn't it possible that instead of crashing, Docker could notify me in the interface that I've run out of tokens? Or do I have to wait until tomorrow to start Docker?

Until we have a fix, I suggest you to delete the metadata.json so you can reset the llm and embedder settings and start again the container.