BerriAI/litellm · error · ValueError
custom_llm_provider is required but passed as None
Error message
custom_llm_provider is required but passed as None
What it means
Dispatch guard in the Responses API: custom_llm_provider is None after get_llm_provider_info, so the model string could not be mapped to a provider and no provider config can be selected.
Source
Thrown at litellm/responses/main.py:1103
user=user,
optional_params=dict(responses_api_request_params),
litellm_params={
**responses_api_request_params,
"aresponses": _is_async,
"litellm_call_id": litellm_call_id,
"model_info": kwargs.get("model_info"),
"data_residency": infer_openai_data_residency(custom_llm_provider, litellm_params.api_base),
"metadata": (kwargs["litellm_metadata"] if "litellm_metadata" in kwargs else kwargs.get("metadata")),
},
custom_llm_provider=custom_llm_provider,
)
# Decode any litellm-encoded encrypted-content item IDs back to their original IDs
input = ResponsesAPIRequestUtils._restore_encrypted_content_item_ids_in_input(input)
# Call the handler with _is_async flag instead of directly calling the async handler
if custom_llm_provider is None:
raise ValueError("custom_llm_provider is required but passed as None")
response = base_llm_http_handler.response_api_handler(
model=model,
input=input,
responses_api_provider_config=responses_api_provider_config,
response_api_optional_request_params=responses_api_request_params,
custom_llm_provider=custom_llm_provider,
litellm_params=litellm_params,
logging_obj=litellm_logging_obj,
extra_headers=extra_headers,
extra_body=extra_body,
timeout=timeout or request_timeout,
_is_async=_is_async,
client=kwargs.get("client"),
fake_stream=responses_api_provider_config.should_fake_stream(
model=model, stream=stream, custom_llm_provider=custom_llm_provider
),
litellm_metadata=kwargs.get("litellm_metadata", {}),View on GitHub (pinned to 77b7c6c40c)
Solutions
- Pass custom_llm_provider explicitly (e.g., 'openai') when calling the responses API.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/responses/main.py:1103 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/48a9f54ec2be796f.
Report an issue: GitHub.