BerriAI/litellm · error · ValueError

No model ID found after 'model' keyword. Expected format: /m

Error message

No model ID found after 'model' keyword. Expected format: /model/{modelId}/{action}. Got: {endpoint}

What it means

Bedrock model-ID extraction fallback: a 'model' keyword segment was found in the endpoint path, but there are no non-empty path segments after it (and no action segment delimiting the ID), so the model ID portion of /model/{modelId}/{action} is empty. Thrown as ValueError during endpoint parsing.

Source

Thrown at litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py:700

            )

        # Find the index of the action in the endpoint parts
        action_index = None
        for idx, part in enumerate(endpoint_parts):
            if part in BEDROCK_ENDPOINT_ACTIONS:
                action_index = idx
                break

        if action_index is not None and action_index > model_index + 1:
            # Join all parts between "model" and the action (excluding "model" itself)
            return "/".join(endpoint_parts[model_index + 1 : action_index])

        # Fallback to taking everything after "model" if no action found
        model_parts = [p for p in endpoint_parts[model_index + 1 :] if p]
        if model_parts:
            return "/".join(model_parts)

        raise ValueError(
            f"No model ID found after 'model' keyword. Expected format: /model/{{modelId}}/{{action}}. Got: {endpoint}"
        )

    except ValueError:
        # Re-raise ValueError as-is
        raise
    except Exception as e:
        raise ValueError(
            f"Model missing from endpoint. Expected format: /model/{{modelId}}/{{action}}. Got: {endpoint}"
        ) from e


async def handle_bedrock_passthrough_router_model(
    model: str,
    endpoint: str,
    request: Request,
    request_body: dict,
    llm_router: litellm.Router,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide a model ID after the 'model' segment: /model/{modelId}/{action}.
  2. Check the endpoint path for an empty model segment or missing action.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py:700 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/ad8c6d0510b39394. Report an issue: GitHub.