BerriAI/litellm · error · ValueError

litellm_params is required for BedrockAgentCoreA2AConfig (mu

Error message

litellm_params is required for BedrockAgentCoreA2AConfig (must contain model with AgentCore ARN)

What it means

BedrockAgentCoreA2AConfig.handle_non_streaming raises ValueError when kwargs lacks `litellm_params`. The AgentCore handler derives the agent endpoint from the model string (AgentCore ARN) carried in litellm_params, so without it the request cannot be routed.

Source

Thrown at litellm/a2a_protocol/providers/bedrock_agentcore/config.py:33

    """
    Provider configuration for Bedrock AgentCore A2A-native agents.

    AgentCore agents that speak A2A natively expect the full JSON-RPC envelope.
    This config bypasses the completion bridge and forwards requests directly,
    deriving the endpoint URL from the model ARN and signing with SigV4/JWT.
    """

    async def handle_non_streaming(
        self,
        request_id: str,
        params: dict[str, Any],
        api_base: str | None = None,
        **kwargs,
    ) -> dict[str, Any]:
        """Handle non-streaming request to AgentCore A2A agent."""
        litellm_params: Final = kwargs.get("litellm_params")
        if not litellm_params:
            raise ValueError(
                "litellm_params is required for BedrockAgentCoreA2AConfig (must contain model with AgentCore ARN)"
            )
        return await BedrockAgentCoreA2AHandler.handle_non_streaming(
            request_id=request_id,
            params=params,
            litellm_params=litellm_params,
            agent_extra_headers=kwargs.get("agent_extra_headers"),
        )

    async def handle_streaming(
        self,
        request_id: str,
        params: dict[str, Any],
        api_base: str | None = None,
        **kwargs,
    ) -> AsyncIterator[dict[str, Any]]:
        """Handle streaming request to AgentCore A2A agent."""
        litellm_params: Final = kwargs.get("litellm_params")

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Pass litellm_params (a dict containing at least `model` set to the AgentCore agent ARN) in the kwargs
  2. If calling through LiteLLM's normal completion/a2a path, ensure the model is configured with custom_llm_provider=bedrock and the AgentCore ARN so params propagate

Example fix

# before
resp = await config.handle_non_streaming(request_id=rid, params=params)
# after
resp = await config.handle_non_streaming(
    request_id=rid, params=params,
    litellm_params={"custom_llm_provider": "bedrock", "model": "arn:aws:bedrock-agentcore:..."},
)
Defensive patterns

Strategy: validation

Validate before calling

lp = kwargs.get("litellm_params")
if not lp or not lp.get("model"):
    raise ValueError("bedrock_agentcore needs litellm_params.model = AgentCore ARN")

Prevention

When it happens

Trigger: Invoking the bedrock_agentcore A2A config handler directly (or via a bridge call path) without passing litellm_params in kwargs, e.g. handler.handle_non_streaming(request_id=..., params=..., api_base=None).

Common situations: Custom dispatch code that calls provider configs manually and forwards only some kwargs; a LiteLLM version mismatch where the caller stopped forwarding litellm_params.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/91655a45fb885270. Report an issue: GitHub.