litellm - 💡(How to fix) Fix [Bug]: Impossible to use /images/generations with OpenAI compatible providers

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

11:45:29 - LiteLLM:DEBUG: utils.py:2634 - Model not found or error in checking supports_reasoning support. You passed model=Qwen-Image, custom_llm_provider=None. Error: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen-Image Pass model as E.g. For 'Huggingface' inference endpoints pass in completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers 11:45:29 - LiteLLM:DEBUG: utils.py:485 -

11:45:29 - LiteLLM:DEBUG: utils.py:485 - Request to litellm: 11:45:29 - LiteLLM:DEBUG: utils.py:485 - litellm.aimage_generation(custom_llm_provider='openai', litellm_credential_name='Regolo.ai', use_in_pass_through=False, use_litellm_proxy=False, merge_reasoning_content_in_choices=False, tags=[], model='Qwen-Image', guardrails=[], max_tokens=5, litellm_logging_obj=<litellm.litellm_core_utils.litellm_logging.Logging object at 0x7f4e0b9f5190>, litellm_metadata={'tags': ['litellm-internal-health-check'], 'user_api_key_hash': 'litellm-internal-health-check', 'user_api_key_alias': 'litellm-internal-health-check', 'user_api_key_spend': 0.0, 'user_api_key_max_budget': None, 'user_api_key_team_id': 'litellm-internal-health-check', 'user_api_key_project_id': None, 'user_api_key_project_alias': None, 'user_api_key_user_id': None, 'user_api_key_org_id': None, 'user_api_key_org_alias': None, 'user_api_key_team_alias': 'litellm-internal-health-check', 'user_api_key_end_user_id': None, 'user_api_key_user_email': None, 'user_api_key_request_route': None, 'user_api_key_budget_reset_at': None, 'user_api_key_auth_metadata': {}, 'user_REDACTED', 'agent_id': None, 'user_api_end_user_max_budget': None, 'user_api_key_auth': UserAPIKeyAuth(token='litellm-internal-health-check', key_name=None, key_alias='litellm-internal-health-check', spend=0.0, max_budget=None, expires=None, models=[], aliases={}, config={}, user_id=None, team_id='litellm-internal-health-check', agent_id=None, project_id=None, max_parallel_requests=None, metadata={}, tpm_limit=None, rpm_limit=None, budget_duration=None, budget_reset_at=None, allowed_cache_controls=[], allowed_routes=[], permissions={}, model_spend={}, model_max_budget={}, soft_budget_cooldown=False, blocked=None, litellm_budget_table=None, org_id=None, created_at=None, created_by=None, updated_at=None, updated_by=None, last_active=None, object_permission_id=None, object_permission=None, access_group_ids=None, rotation_count=0, auto_rotate=False, rotation_interval=None, last_rotation_at=None, key_rotation_at=None, router_settings=None, budget_limits=None, team_spend=None, team_alias='litellm-internal-health-check', team_tpm_limit=None, team_rpm_limit=None, team_max_budget=None, team_soft_budget=None, team_models=[], team_blocked=False, soft_budget=None, team_model_aliases=None, team_member=None, team_metadata=None, team_object_permission_id=None, team_member_spend=None, team_member_tpm_limit=None, team_member_rpm_limit=None, end_user_id=None, end_user_tpm_limit=None, end_user_rpm_limit=None, end_user_max_budget=None, end_user_model_max_budget=None, organization_alias=None, organization_max_budget=None, organization_tpm_limit=None, organization_rpm_limit=None, organization_metadata=None, project_alias=None, project_metadata=None, last_refreshed_at=None, REDACTED', user_role=None, allowed_model_region=None, parent_otel_span=None, rpm_limit_per_model=None, tpm_limit_per_model=None, user_tpm_limit=None, user_rpm_limit=None, user_email=None, user_spend=None, user_max_budget=None, request_route=None, budget_reservation=None, user=None, created_by_user=None, end_user_object_permission=None, team_object_permission=None, jwt_claims=None)}, cache={'no-cache': True}, prompt='test from litellm') 11:45:29 - LiteLLM:DEBUG: utils.py:485 - 11:45:29 - LiteLLM:DEBUG: litellm_logging.py:2941 - Logging Details LiteLLM-Failure Call: [<bound method Router.deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>>] 11:45:29 - LiteLLM:DEBUG: callback_controls.py:37 - Dynamically disabled callbacks from x-litellm-disable-callbacks: None 11:45:29 - LiteLLM:DEBUG: callback_controls.py:38 - Checking if <bound method Router.deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>> is disabled via headers. Disable callbacks from headers: None 11:45:29 - LiteLLM Router:DEBUG: router.py:6725 - Router: Entering 'deployment_callback_on_failure' 11:45:29 - LiteLLM:DEBUG: callback_controls.py:37 - Dynamically disabled callbacks from x-litellm-disable-callbacks: None 11:45:29 - LiteLLM:DEBUG: callback_controls.py:38 - Checking if <bound method Router.async_deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>> is disabled via headers. Disable callbacks from headers: None 11:45:29 - LiteLLM:DEBUG: utils.py:485 - Custom Logger Error - Traceback (most recent call last): File "/home/controller/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1899, in wrapper_async result = await original_function(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/controller/litellm/lib/python3.12/site-packages/litellm/images/main.py", line 137, in aimage_generation raise exception_type( File "/home/controller/litellm/lib/python3.12/site-packages/litellm/images/main.py", line 114, in aimage_generation _, custom_llm_provider, _, _ = get_llm_provider( ^^^^^^^^^^^^^^^^^ File "/home/controller/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 529, in get_llm_provider raise e File "/home/controller/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 510, in get_llm_provider raise litellm.exceptions.BadRequestError( # type: ignore litellm.exceptions.BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen-Image Pass model as E.g. For 'Huggingface' inference endpoints pass in completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/controller/litellm/lib/python3.12/site-packages/litellm/integrations/custom_logger.py", line 524, in async_log_event await callback_func( File "/home/controller/litellm/lib/python3.12/site-packages/litellm/router.py", line 6791, in async_deployment_callback_on_failure deployment_name = kwargs["litellm_params"]["metadata"].get( ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^ KeyError: 'metadata'

INFO: 3.11.82.252:53366 - "POST /health/test_connection HTTP/1.1" 200 OK

Code Example

LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen-Image Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers

---

11:45:29 - LiteLLM:DEBUG: utils.py:2634 - Model not found or error in checking supports_reasoning support. You passed model=Qwen-Image, custom_llm_provider=None. Error: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen-Image
 Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers
11:45:29 - LiteLLM:DEBUG: utils.py:485 - 

11:45:29 - LiteLLM:DEBUG: utils.py:485 - Request to litellm:
11:45:29 - LiteLLM:DEBUG: utils.py:485 - litellm.aimage_generation(custom_llm_provider='openai', litellm_credential_name='Regolo.ai', use_in_pass_through=False, use_litellm_proxy=False, merge_reasoning_content_in_choices=False, tags=[], model='Qwen-Image', guardrails=[], max_tokens=5, litellm_logging_obj=<litellm.litellm_core_utils.litellm_logging.Logging object at 0x7f4e0b9f5190>, litellm_metadata={'tags': ['litellm-internal-health-check'], 'user_api_key_hash': 'litellm-internal-health-check', 'user_api_key_alias': 'litellm-internal-health-check', 'user_api_key_spend': 0.0, 'user_api_key_max_budget': None, 'user_api_key_team_id': 'litellm-internal-health-check', 'user_api_key_project_id': None, 'user_api_key_project_alias': None, 'user_api_key_user_id': None, 'user_api_key_org_id': None, 'user_api_key_org_alias': None, 'user_api_key_team_alias': 'litellm-internal-health-check', 'user_api_key_end_user_id': None, 'user_api_key_user_email': None, 'user_api_key_request_route': None, 'user_api_key_budget_reset_at': None, 'user_api_key_auth_metadata': {}, 'user_REDACTED', 'agent_id': None, 'user_api_end_user_max_budget': None, 'user_api_key_auth': UserAPIKeyAuth(token='litellm-internal-health-check', key_name=None, key_alias='litellm-internal-health-check', spend=0.0, max_budget=None, expires=None, models=[], aliases={}, config={}, user_id=None, team_id='litellm-internal-health-check', agent_id=None, project_id=None, max_parallel_requests=None, metadata={}, tpm_limit=None, rpm_limit=None, budget_duration=None, budget_reset_at=None, allowed_cache_controls=[], allowed_routes=[], permissions={}, model_spend={}, model_max_budget={}, soft_budget_cooldown=False, blocked=None, litellm_budget_table=None, org_id=None, created_at=None, created_by=None, updated_at=None, updated_by=None, last_active=None, object_permission_id=None, object_permission=None, access_group_ids=None, rotation_count=0, auto_rotate=False, rotation_interval=None, last_rotation_at=None, key_rotation_at=None, router_settings=None, budget_limits=None, team_spend=None, team_alias='litellm-internal-health-check', team_tpm_limit=None, team_rpm_limit=None, team_max_budget=None, team_soft_budget=None, team_models=[], team_blocked=False, soft_budget=None, team_model_aliases=None, team_member=None, team_metadata=None, team_object_permission_id=None, team_member_spend=None, team_member_tpm_limit=None, team_member_rpm_limit=None, end_user_id=None, end_user_tpm_limit=None, end_user_rpm_limit=None, end_user_max_budget=None, end_user_model_max_budget=None, organization_alias=None, organization_max_budget=None, organization_tpm_limit=None, organization_rpm_limit=None, organization_metadata=None, project_alias=None, project_metadata=None, last_refreshed_at=None, REDACTED', user_role=None, allowed_model_region=None, parent_otel_span=None, rpm_limit_per_model=None, tpm_limit_per_model=None, user_tpm_limit=None, user_rpm_limit=None, user_email=None, user_spend=None, user_max_budget=None, request_route=None, budget_reservation=None, user=None, created_by_user=None, end_user_object_permission=None, team_object_permission=None, jwt_claims=None)}, cache={'no-cache': True}, prompt='test from litellm')
11:45:29 - LiteLLM:DEBUG: utils.py:485 - 
11:45:29 - LiteLLM:DEBUG: litellm_logging.py:2941 - Logging Details LiteLLM-Failure Call: [<bound method Router.deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>>]
11:45:29 - LiteLLM:DEBUG: callback_controls.py:37 - Dynamically disabled callbacks from x-litellm-disable-callbacks: None
11:45:29 - LiteLLM:DEBUG: callback_controls.py:38 - Checking if <bound method Router.deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>> is disabled via headers. Disable callbacks from headers: None
11:45:29 - LiteLLM Router:DEBUG: router.py:6725 - Router: Entering 'deployment_callback_on_failure'
11:45:29 - LiteLLM:DEBUG: callback_controls.py:37 - Dynamically disabled callbacks from x-litellm-disable-callbacks: None
11:45:29 - LiteLLM:DEBUG: callback_controls.py:38 - Checking if <bound method Router.async_deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>> is disabled via headers. Disable callbacks from headers: None
11:45:29 - LiteLLM:DEBUG: utils.py:485 - Custom Logger Error - Traceback (most recent call last):
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1899, in wrapper_async
    result = await original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/images/main.py", line 137, in aimage_generation
    raise exception_type(
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/images/main.py", line 114, in aimage_generation
    _, custom_llm_provider, _, _ = get_llm_provider(
                                   ^^^^^^^^^^^^^^^^^
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 529, in get_llm_provider
    raise e
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 510, in get_llm_provider
    raise litellm.exceptions.BadRequestError(  # type: ignore
litellm.exceptions.BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen-Image
 Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/integrations/custom_logger.py", line 524, in async_log_event
    await callback_func(
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/router.py", line 6791, in async_deployment_callback_on_failure
    deployment_name = kwargs["litellm_params"]["metadata"].get(
                      ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'metadata'

INFO:     3.11.82.252:53366 - "POST /health/test_connection HTTP/1.1" 200 OK
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Using latest stable release, v1.86.2 I am trying to add a model with Mode of Image Generation and Provider of OpenAI but it insists no provider has been provided, failing with this error:

LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen-Image Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers

Steps to Reproduce

Add a db model via the interface with these options:

  • Provider: OpenAI
  • LiteLLM Model Name: Custom -> Qwen-Image (testing with Regolo.ai)
  • Mode: Image Generation
  • enter credentials
  • click Test Connect

You will see the above error message.

If you set Mode to Chat then test succeeds, but of course you can't use the model for image generation.

This is the model I am trying to use, but I tried others with other providers, always the same result:

Relevant log output

11:45:29 - LiteLLM:DEBUG: utils.py:2634 - Model not found or error in checking supports_reasoning support. You passed model=Qwen-Image, custom_llm_provider=None. Error: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen-Image
 Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers
11:45:29 - LiteLLM:DEBUG: utils.py:485 - 

11:45:29 - LiteLLM:DEBUG: utils.py:485 - Request to litellm:
11:45:29 - LiteLLM:DEBUG: utils.py:485 - litellm.aimage_generation(custom_llm_provider='openai', litellm_credential_name='Regolo.ai', use_in_pass_through=False, use_litellm_proxy=False, merge_reasoning_content_in_choices=False, tags=[], model='Qwen-Image', guardrails=[], max_tokens=5, litellm_logging_obj=<litellm.litellm_core_utils.litellm_logging.Logging object at 0x7f4e0b9f5190>, litellm_metadata={'tags': ['litellm-internal-health-check'], 'user_api_key_hash': 'litellm-internal-health-check', 'user_api_key_alias': 'litellm-internal-health-check', 'user_api_key_spend': 0.0, 'user_api_key_max_budget': None, 'user_api_key_team_id': 'litellm-internal-health-check', 'user_api_key_project_id': None, 'user_api_key_project_alias': None, 'user_api_key_user_id': None, 'user_api_key_org_id': None, 'user_api_key_org_alias': None, 'user_api_key_team_alias': 'litellm-internal-health-check', 'user_api_key_end_user_id': None, 'user_api_key_user_email': None, 'user_api_key_request_route': None, 'user_api_key_budget_reset_at': None, 'user_api_key_auth_metadata': {}, 'user_REDACTED', 'agent_id': None, 'user_api_end_user_max_budget': None, 'user_api_key_auth': UserAPIKeyAuth(token='litellm-internal-health-check', key_name=None, key_alias='litellm-internal-health-check', spend=0.0, max_budget=None, expires=None, models=[], aliases={}, config={}, user_id=None, team_id='litellm-internal-health-check', agent_id=None, project_id=None, max_parallel_requests=None, metadata={}, tpm_limit=None, rpm_limit=None, budget_duration=None, budget_reset_at=None, allowed_cache_controls=[], allowed_routes=[], permissions={}, model_spend={}, model_max_budget={}, soft_budget_cooldown=False, blocked=None, litellm_budget_table=None, org_id=None, created_at=None, created_by=None, updated_at=None, updated_by=None, last_active=None, object_permission_id=None, object_permission=None, access_group_ids=None, rotation_count=0, auto_rotate=False, rotation_interval=None, last_rotation_at=None, key_rotation_at=None, router_settings=None, budget_limits=None, team_spend=None, team_alias='litellm-internal-health-check', team_tpm_limit=None, team_rpm_limit=None, team_max_budget=None, team_soft_budget=None, team_models=[], team_blocked=False, soft_budget=None, team_model_aliases=None, team_member=None, team_metadata=None, team_object_permission_id=None, team_member_spend=None, team_member_tpm_limit=None, team_member_rpm_limit=None, end_user_id=None, end_user_tpm_limit=None, end_user_rpm_limit=None, end_user_max_budget=None, end_user_model_max_budget=None, organization_alias=None, organization_max_budget=None, organization_tpm_limit=None, organization_rpm_limit=None, organization_metadata=None, project_alias=None, project_metadata=None, last_refreshed_at=None, REDACTED', user_role=None, allowed_model_region=None, parent_otel_span=None, rpm_limit_per_model=None, tpm_limit_per_model=None, user_tpm_limit=None, user_rpm_limit=None, user_email=None, user_spend=None, user_max_budget=None, request_route=None, budget_reservation=None, user=None, created_by_user=None, end_user_object_permission=None, team_object_permission=None, jwt_claims=None)}, cache={'no-cache': True}, prompt='test from litellm')
11:45:29 - LiteLLM:DEBUG: utils.py:485 - 
11:45:29 - LiteLLM:DEBUG: litellm_logging.py:2941 - Logging Details LiteLLM-Failure Call: [<bound method Router.deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>>]
11:45:29 - LiteLLM:DEBUG: callback_controls.py:37 - Dynamically disabled callbacks from x-litellm-disable-callbacks: None
11:45:29 - LiteLLM:DEBUG: callback_controls.py:38 - Checking if <bound method Router.deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>> is disabled via headers. Disable callbacks from headers: None
11:45:29 - LiteLLM Router:DEBUG: router.py:6725 - Router: Entering 'deployment_callback_on_failure'
11:45:29 - LiteLLM:DEBUG: callback_controls.py:37 - Dynamically disabled callbacks from x-litellm-disable-callbacks: None
11:45:29 - LiteLLM:DEBUG: callback_controls.py:38 - Checking if <bound method Router.async_deployment_callback_on_failure of <litellm.router.Router object at 0x7f4e12e0ebd0>> is disabled via headers. Disable callbacks from headers: None
11:45:29 - LiteLLM:DEBUG: utils.py:485 - Custom Logger Error - Traceback (most recent call last):
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1899, in wrapper_async
    result = await original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/images/main.py", line 137, in aimage_generation
    raise exception_type(
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/images/main.py", line 114, in aimage_generation
    _, custom_llm_provider, _, _ = get_llm_provider(
                                   ^^^^^^^^^^^^^^^^^
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 529, in get_llm_provider
    raise e
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 510, in get_llm_provider
    raise litellm.exceptions.BadRequestError(  # type: ignore
litellm.exceptions.BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=Qwen-Image
 Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/integrations/custom_logger.py", line 524, in async_log_event
    await callback_func(
  File "/home/controller/litellm/lib/python3.12/site-packages/litellm/router.py", line 6791, in async_deployment_callback_on_failure
    deployment_name = kwargs["litellm_params"]["metadata"].get(
                      ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'metadata'

INFO:     3.11.82.252:53366 - "POST /health/test_connection HTTP/1.1" 200 OK

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.86.2

Twitter / LinkedIn details

https://www.linkedin.com/in/gregharvey/

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix [Bug]: Impossible to use /images/generations with OpenAI compatible providers