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

[Bug]: Model Overloaded exception #9007

Open
andrewn3 opened this issue Mar 5, 2025 · 0 comments
Open

[Bug]: Model Overloaded exception #9007

andrewn3 opened this issue Mar 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@andrewn3
Copy link

andrewn3 commented Mar 5, 2025

What happened?

Would be good if you handle this scenario and pause and retry a few minutes later rather than throwing an exception as in this case the application will bomb out.

Also the api key in the exception message should really be obfuscated but i manually removed it.

Relevant log output

15:36:34 - LiteLLM:WARNING: utils.py:428 - `litellm.set_verbose` is deprecated. Please set `os.environ['LITELLM_LOG'] = 'DEBUG'` for debug logs.
WARNING:LiteLLM:`litellm.set_verbose` is deprecated. Please set `os.environ['LITELLM_LOG'] = 'DEBUG'` for debug logs.
Initialized litellm callbacks, Async Success Callbacks: [<litellm.integrations.langfuse.langfuse_prompt_management.LangfusePromptManagement object at 0x000002CD95369730>, 'cache', <crewai.utilities.token_counter_callback.TokenCalcHandler object at 0x000002CD99E37B90>]
SYNC kwargs[caching]: False; litellm.cache: None; kwargs.get('cache')['no-cache']: False
Final returned optional params: {'stop_sequences': ['\nObservation:']}


LiteLLM.Info: If you need to debug this error, use `litellm._turn_on_debug()'.


Provider List: https://docs.litellm.ai/docs/providers

ERROR:root:LiteLLM call failed: litellm.InternalServerError: litellm.InternalServerError: VertexAIException - {
  "error": {
    "code": 503,
    "message": "The model is overloaded. Please try again later.",
    "status": "UNAVAILABLE"
  }
}

 Error during LLM call: litellm.InternalServerError: litellm.InternalServerError: VertexAIException - {
  "error": {
    "code": 503,
    "message": "The model is overloaded. Please try again later.",
    "status": "UNAVAILABLE"
  }
}

[Flow._execute_single_listener] Error in method PDFExtractor: litellm.InternalServerError: litellm.InternalServerError: VertexAIException - {
  "error": {
    "code": 503,
    "message": "The model is overloaded. Please try again later.",
    "status": "UNAVAILABLE"
  }
}

Traceback (most recent call last):
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\llms\vertex_ai\gemini\vertex_and_google_ai_studio_gemini.py", line 1282, in completion
    response = client.post(url=url, headers=headers, json=data)  # type: ignore
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\llms\custom_httpx\http_handler.py", line 553, in post
    raise e
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\llms\custom_httpx\http_handler.py", line 534, in post
    response.raise_for_status()
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\httpx\_models.py", line 763, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Server error '503 Service Unavailable' for url 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=<manually removed>'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\main.py", line 2299, in completion
    response = vertex_chat_completion.completion(  # type: ignore
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\llms\vertex_ai\gemini\vertex_and_google_ai_studio_gemini.py", line 1286, in completion
    raise VertexAIError(
litellm.llms.vertex_ai.common_utils.VertexAIError: {
  "error": {
    "code": 503,
    "message": "The model is overloaded. Please try again later.",
    "status": "UNAVAILABLE"
  }
}


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\flow\flow.py", line 990, in _execute_single_listener
    listener_result = await self._execute_method(listener_name, method)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\flow\flow.py", line 825, in _execute_method
    else method(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\src\productmanagementflow\main.py", line 120, in PDFExtractor
    .kickoff(inputs={"pdf_filename": self.state.pdffilename,
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\crew.py", line 578, in kickoff
    result = self._run_hierarchical_process()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\crew.py", line 688, in _run_hierarchical_process
    return self._execute_tasks(self.tasks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\crew.py", line 781, in _execute_tasks
    task_output = task.execute_sync(
                  ^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\task.py", line 302, in execute_sync
    return self._execute_core(agent, context, tools)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\task.py", line 366, in _execute_core
    result = agent.execute_task(
             ^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\agent.py", line 254, in execute_task
    raise e
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\agent.py", line 243, in execute_task
    result = self.agent_executor.invoke(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\agents\crew_agent_executor.py", line 112, in invoke
    raise e
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\agents\crew_agent_executor.py", line 102, in invoke
    formatted_answer = self._invoke_loop()
                       ^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\agents\crew_agent_executor.py", line 160, in _invoke_loop
    raise e
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\agents\crew_agent_executor.py", line 140, in _invoke_loop
    answer = self._get_llm_response()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\agents\crew_agent_executor.py", line 210, in _get_llm_response
    raise e
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\agents\crew_agent_executor.py", line 201, in _get_llm_response
    answer = self.llm.call(
             ^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\crewai\llm.py", line 291, in call
    response = litellm.completion(**params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\utils.py", line 1154, in wrapper
    raise e
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\utils.py", line 1032, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\main.py", line 3068, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\litellm_core_utils\exception_mapping_utils.py", line 2201, in exception_type
    raise e
  File "D:\Users\newla\crewai\financial_analyst1\productmanager\productmanagementflow\.venv\Lib\site-packages\litellm\litellm_core_utils\exception_mapping_utils.py", line 1197, in exception_type
    raise litellm.InternalServerError(
litellm.exceptions.InternalServerError: litellm.InternalServerError: litellm.InternalServerError: VertexAIException - {
  "error": {
    "code": 503,
    "message": "The model is overloaded. Please try again later.",
    "status": "UNAVAILABLE"
  }
}

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

1.60.2

Twitter / LinkedIn details

No response

@andrewn3 andrewn3 added the bug Something isn't working label Mar 5, 2025
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