Skip to content

fix: keep model capability flags out of provider requests - #46647

Merged
mateo-berri merged 7 commits into
mainfrom
litellm_fix_capability_flags_reach_provider
Oct 15, 2026
Merged

mateo-berri merged 7 commits into
mainfrom
litellm_fix_capability_flags_reach_provider

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • A capability flag in a deployment's litellm_params reached the provider
  • Bedrock answers 400 Extra inputs are not permitted for it
  • So /health and chat both fail

How it solves it:

  • The router and health probes drop capability flags from a deployment's litellm_params
  • A warning at load points the flag to model_info

User Flow

Before: a proxy admin whose Bedrock Claude deployment carries a capability flag sees it fail on /health and on chat

  1. The admin puts supports_max_reasoning_effort: false under the deployment's litellm_params, turns on background health checks, and starts the proxy
  2. They call GET https://litellm-domain/health and see the deployment under unhealthy_endpoints with {"message":"supports_max_reasoning_effort: Extra inputs are not permitted"}
  3. A developer sends POST https://litellm-domain/v1/chat/completions to that model and gets a 400 with the same message

After: the same deployment shows healthy and serves chat

  1. The admin puts supports_max_reasoning_effort: false under the deployment's litellm_params, turns on background health checks, and starts the proxy
  2. They call GET https://litellm-domain/health and see the deployment under healthy_endpoints
  3. The developer sends the same POST https://litellm-domain/v1/chat/completions and gets a 200 with the model's reply

Design decisions

No provider accepts a capability flag, so the router drops them from its own copy of each deployment, which chat, embeddings, /v1/responses and /health read. Health probes drop them too, for the dashboard's Test Connect, whose litellm_params skip the router

A capability flag is a ProviderSpecificModelInfo field or a supports_ key in the model map as loaded. A bare supports_ prefix, or keys other deployments register, would drop real provider params like Replicate's supports_system_prompt

A flag sent in the request body still gets the provider's 400, as on main, since dropping it would hide a caller's mistake behind a 200

Admin views like /model/info show the deployment as litellm serves it, without the flag, while the database row keeps it as saved. Copying flags into model_info was rejected, since a dashboard edit would save the copy, which outlives its source

Relevant issues

Refs #38941, which stays open for the reporter's retest

Replaces #40952 by @leilei3167, which found the leak but fixed only the health check

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Both legs hit real Bedrock in us-west-2 through a proxy with 2 uvicorn workers, from the config.yaml below or on Postgres for the dashboard and Test Connect cases. Before is the merge base 958cba7016, after is the head 2db878f915

config.yaml (both legs)
model_list:
  - model_name: litellm-qa-capability-flag-false
    litellm_params:
      model: bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0
      aws_region_name: us-west-2
      supports_max_reasoning_effort: false
  - model_name: litellm-qa-capability-flag-true
    litellm_params:
      model: bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0
      aws_region_name: us-west-2
      supports_max_reasoning_effort: true
  - model_name: litellm-qa-capability-flag-converse
    litellm_params:
      model: bedrock/converse/us.anthropic.claude-sonnet-4-5-20250929-v1:0
      aws_region_name: us-west-2
      supports_max_reasoning_effort: false
  - model_name: litellm-qa-capability-flag-unlisted
    litellm_params:
      model: bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0
      aws_region_name: us-west-2
      supports_forced_tool_use: true
  - model_name: litellm-qa-capability-flag-ceiling
    litellm_params:
      model: bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0
      aws_region_name: us-west-2
      bedrock_output_config_effort_ceiling: high
  - model_name: litellm-qa-capability-flag-embed
    litellm_params:
      model: bedrock/amazon.titan-embed-text-v2:0
      aws_region_name: us-west-2
      supports_embedding_image_input: true
    model_info:
      mode: embedding
  - model_name: litellm-qa-capability-flag
    litellm_params:
      model: bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0
      aws_region_name: us-west-2

general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
  background_health_checks: true
  health_check_interval: 30
$ python litellm/proxy/proxy_cli.py --config config.yaml --port $PORT --num_workers 2 --detailed_debug
Case Before After
/health 6 unhealthy 7 healthy
Chat, flag false 400 200
Chat, streaming 400 200
Chat, converse 400 200
/v1/responses 400 200
/v1/messages 200 200
Chat, flag true 400 200
Chat, effort ceiling key 400 200
Chat, unlisted flag 400 200
Embeddings, Titan 400 200
Chat, control 200 200
Dashboard model, chat 400 200
Dashboard model, /health 503 200
Flag in request body 400 400
Test Connect, flag error success
Test Connect, no flag error success

Headline case, User Flow step 2, raw before

Before:

$ curl -sS http://localhost:$PORT/health -H "Authorization: Bearer $LITELLM_MASTER_KEY" | jq '{healthy_count, unhealthy_count, errors: ([.unhealthy_endpoints[].error | split("\n")[0]] | unique)}'
{
  "healthy_count": 1,
  "unhealthy_count": 6,
  "errors": [
    "litellm.BadRequestError: BedrockException - {\"message\":\"Malformed input request: extraneous key [supports_embedding_image_input] is not permitted, please reformat your input and try again.\"}",
    "litellm.BadRequestError: BedrockException - {\"message\":\"The model returned the following errors: supports_max_reasoning_effort: Extra inputs are not permitted\"}",
    "litellm.BadRequestError: BedrockException - {\"message\":\"bedrock_output_config_effort_ceiling: Extra inputs are not permitted\"}",
    "litellm.BadRequestError: BedrockException - {\"message\":\"supports_forced_tool_use: Extra inputs are not permitted\"}",
    "litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}"
  ]
}

After:

$ curl -sS http://localhost:$PORT/health -H "Authorization: Bearer $LITELLM_MASTER_KEY" | jq '{healthy_count, unhealthy_count, errors: ([.unhealthy_endpoints[].error | split("\n")[0]] | unique)}'
{
  "healthy_count": 7,
  "unhealthy_count": 0,
  "errors": []
}
What the admin sees in the proxy console at startup, after only
13:54:17 - LiteLLM Router:WARNING: common_utils.py:441 - Deployment 'litellm-qa-capability-flag-false' sets ['supports_max_reasoning_effort'] under litellm_params, where litellm ignores them and never sends them to the provider. Move them under model_info for litellm to use them.
The other 14 cases, each with its command and raw output

Chat, flag false, User Flow step 3

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-false","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-false' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-false","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-69cc78d6-37a9-4c2f-85fc-448b022e3572","created":1792072461,"model":"litellm-qa-capability-flag-false","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"Hello! I'm Claude, an AI assistant made","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200

Chat, streaming, flag false

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-false","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10,"stream":true}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-false' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-false","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10,"stream":true}' -w '\nHTTP_STATUS=%{http_code}\n'
data: {"id":"chatcmpl-0ba93d82-ddd3-4e31-8eb2-279d7522c036","object":"chat.completion.chunk","created":1792072463,"model":"litellm-qa-capability-flag-false","choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"}}]}

data: {"id":"chatcmpl-0ba93d82-ddd3-4e31-8eb2-279d7522c036","object":"chat.completion.chunk","created":1792072463,"model":"litellm-qa-capability-flag-false","choices":[{"index":0,"delta":{"content":"! I'm Claude"}}]}

data: {"id":"chatcmpl-0ba93d82-ddd3-4e31-8eb2-279d7522c036","object":"chat.completion.chunk","created":1792072463,"model":"litellm-qa-capability-flag-false","choices":[{"index":0,"delta":{"content":", an AI assistant made"}}]}

data: {"id":"chatcmpl-0ba93d82-ddd3-4e31-8eb2-279d7522c036","object":"chat.completion.chunk","created":1792072463,"model":"litellm-qa-capability-flag-false","choices":[{"index":0,"delta":{},"finish_reason":"length"}]}

data: [DONE]


HTTP_STATUS=200

Chat, converse route, flag false

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-converse","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"The model returned the following errors: supports_max_reasoning_effort: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-converse' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-converse","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-6fef4950-bc4d-4399-b89f-b828ec13e5d7","created":1792072465,"model":"litellm-qa-capability-flag-converse","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"Hello! I'm Claude, an AI assistant made","role":"assistant"}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200

/v1/responses, flag false

Before:

$ curl -sS http://localhost:$PORT/v1/responses -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-false","input":"test from litellm","max_output_tokens":16}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-false' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/responses -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-false","input":"test from litellm","max_output_tokens":16}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"resp_Jasy1jxG4q_cxwYPPsFQ-AMeRO5fio3xqKnfqxPiEu45LB6FOIugKPHTrgFuC4dhABj9WGYOeo60tG12XrhaJHVqdKWp3aJZS4vat9-jXdqhWbE-f4oZjO908JtNjIjBKYC9diUXcchsIxYP87ZkBcT-TAWwaMf6yLB_hvTLuuanESFO_PmFrESh2aqmGBAzE6QvsRaKD_5hog51FEukMuncDKEjjFBOEnZ22eeuRjjGmEGryQgvd1M84NOO_wseEUb6IGBX3JbY4qtyDQfIxOjDY7Nx1Q8A-xCZKGfYMZwQAjeJWGLGF0V_ozYoWQYCk2s3dBLpRH49BLveRCPuuv-GaNG5oufQ6zMk-UiyNuISquiifOX5qBmFVtypE7LsPmlExQVpN-6OHGk-u3wFG0f8Wjrq1ukJ5Q20vkCKnNZ5b9Jp2lT_C7fVoGqGpb6pToI5ND40","created_at":1792072467,"error":null,"incomplete_details":{"reason":"max_output_tokens"},"instructions":null,"metadata":{},"model":"litellm-qa-capability-flag-false","object":"response","output":[{"type":"message","id":"msg_715e43e0-1348-4be8-8729-1e0b2a33ad2f","status":"incomplete","role":"assistant","content":[{"type":"output_text","text":"Hello! I received your test message. 👋\n\nI'm Claude,","annotations":[]}],"phase":null}],"parallel_tool_calls":false,"temperature":null,"tool_choice":"auto","tools":[],"top_p":null,"max_output_tokens":16,"previous_response_id":null,"reasoning":null,"status":"incomplete","text":{},"truncation":null,"usage":{"input_tokens":12,"input_tokens_details":{"audio_tokens":null,"cached_tokens":0,"cached_tokens_details":null,"image_tokens":null,"text_tokens":12,"video_tokens":null,"cache_write_tokens":0},"output_tokens":16,"output_tokens_details":{"audio_tokens":null,"reasoning_tokens":0,"text_tokens":16},"total_tokens":28,"cost":null},"user":null,"store":null,"provider_specific_fields":{"citations":null,"thinking_blocks":null}}
HTTP_STATUS=200

/v1/messages, flag false

Before:

$ curl -sS http://localhost:$PORT/v1/messages -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-false","max_tokens":10,"messages":[{"role":"user","content":"test from litellm"}]}' -w '\nHTTP_STATUS=%{http_code}\n'
{"model":"litellm-qa-capability-flag-false","id":"msg_bdrk_011Cg4AKKhnrLkwPVdztRgyf","type":"message","role":"assistant","content":[{"type":"text","text":"Hello! I received your test message. "}],"stop_reason":"max_tokens","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":12,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":10}}
HTTP_STATUS=200

After:

$ curl -sS http://localhost:$PORT/v1/messages -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-false","max_tokens":10,"messages":[{"role":"user","content":"test from litellm"}]}' -w '\nHTTP_STATUS=%{http_code}\n'
{"model":"litellm-qa-capability-flag-false","id":"msg_bdrk_011Cg48qgVJNQzHSuFZXbPeW","type":"message","role":"assistant","content":[{"type":"text","text":"Hello! I'm Claude, an AI assistant made"}],"stop_reason":"max_tokens","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":12,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":10}}
HTTP_STATUS=200

Chat, flag true

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-true","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-true' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-true","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-21be5303-4252-424e-98f4-28b36fdde576","created":1792072470,"model":"litellm-qa-capability-flag-true","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"Hello! I received your test message. I'm","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200

Chat, bedrock_output_config_effort_ceiling: high

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-ceiling","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"bedrock_output_config_effort_ceiling: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-ceiling' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-ceiling","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-cd74083a-0bb5-4252-b929-f717692348e0","created":1792072472,"model":"litellm-qa-capability-flag-ceiling","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"Hello! I'm Claude, an AI assistant made","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200

Chat, supports_forced_tool_use: true

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-unlisted","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_forced_tool_use: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-unlisted' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-unlisted","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-cf7a3de9-ece5-47d2-aa7a-9a8dd7d13261","created":1792072474,"model":"litellm-qa-capability-flag-unlisted","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"Hello! I'm Claude, an AI assistant made","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200

Embeddings, Titan v2

Before:

$ curl -sS http://localhost:$PORT/v1/embeddings -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-embed","input":"test from litellm"}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"Malformed input request: extraneous key [supports_embedding_image_input] is not permitted, please reformat your input and try again.\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-embed' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/embeddings -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-embed","input":"test from litellm"}' -w '\nHTTP_STATUS=%{http_code}\n'

HTTP 200 with a 1024-float embedding and "prompt_tokens":6. The raw 21 KB response is in after_2db878f915_embeddings.txt

Chat, control with no flag

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-c0ef8907-7d20-4b13-8685-cd490545983a","created":1792073634,"model":"litellm-qa-capability-flag","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"I can see you're testing a message from L","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-2535597b-f521-468c-9c63-e4784a4f9e8a","created":1792072476,"model":"litellm-qa-capability-flag","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"Hello! I'm Claude, an AI assistant made","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200

Dashboard model, chat

The proxy starts from this config with DATABASE_URL set and STORE_MODEL_IN_DB=True:

model_list: []

general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY

Each leg adds the flagged model and a control model with no flag. Values the proxy encrypts are shown as <encrypted>, and the after leg's response is the same shape:

$ curl -sS http://localhost:$PORT/model/new -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model_name":"litellm-qa-capability-flag-dashboard","litellm_params":{"model":"bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","aws_region_name":"us-west-2","supports_max_reasoning_effort":false},"model_info":{}}' -w '\nHTTP_STATUS=%{http_code}\n'
{"model_id":"a5197547-5902-45cf-b887-4b7e5afee5e2","model_name":"litellm-qa-capability-flag-dashboard","litellm_params":{"model":"<encrypted>","use_xai_oauth":false,"aws_region_name":"<encrypted>","use_litellm_proxy":false,"use_in_pass_through":false,"supports_max_reasoning_effort":false,"allow_client_keepalive_override":false,"merge_reasoning_content_in_choices":false},"model_info":{"id":"a5197547-5902-45cf-b887-4b7e5afee5e2","db_model":false,"member_auto_router":false},"blocked":false,"created_at":"2026-10-15T14:15:12.992000Z","created_by":"default_user_id","updated_at":"2026-10-15T14:15:12.992000Z","updated_by":"default_user_id"}
HTTP_STATUS=200

Both legs then poll GET /v1/models until both models show on 8 calls in a row, so both workers have loaded them, and call chat twice.

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-dashboard","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-dashboard' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400
$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-dashboard","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-dashboard' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-dashboard","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-63623f60-7743-458e-a9d0-3fab73b37c33","created":1792072565,"model":"litellm-qa-capability-flag-dashboard","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"I'm Claude, an AI assistant made by","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200
$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-dashboard","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10}' -w '\nHTTP_STATUS=%{http_code}\n'
{"id":"chatcmpl-4994dcee-d19c-4a1d-afa7-8c818e3bc9f7","created":1792072567,"model":"litellm-qa-capability-flag-dashboard","object":"chat.completion","choices":[{"finish_reason":"length","index":0,"message":{"content":"I'm Claude, an AI assistant made by","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":12,"total_tokens":22,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":12,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0}}
HTTP_STATUS=200

Dashboard model, /health

The before error is cut to its first line here, and the raw response with its stack trace is in before_958cba7016_dashboard_health.txt

Before:

$ curl -sS 'http://localhost:$PORT/health?model=litellm-qa-capability-flag-dashboard' -H "Authorization: Bearer $LITELLM_MASTER_KEY" -w '\nHTTP_STATUS=%{http_code}\n'
{"healthy_endpoints":[],"unhealthy_endpoints":[{"aws_region_name":"us-west-2","model":"invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","custom_llm_provider":"bedrock","error":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}","raw_request_typed_dict":{"raw_request_api_base":"https://bedrock-runtime.us-west-2.amazonaws.com/model/us.anthropic.claude-sonnet-4-5-20250929-v1:0/invoke","raw_request_body":{"messages":[{"role":"user","content":[{"type":"text","text":"What's 1 + 1?"}]}],"max_tokens":16,"supports_max_reasoning_effort":false,"anthropic_version":"bedrock-2023-05-31"},"raw_request_headers":{"Content-Type":"application/json","X-Amz-Date":"20261015T141613Z","Authorization":"AW****c0"},"error":null},"model_id":"a5197547-5902-45cf-b887-4b7e5afee5e2","exception_status":400}],"healthy_count":0,"unhealthy_count":1}
HTTP_STATUS=503

After:

$ curl -sS 'http://localhost:$PORT/health?model=litellm-qa-capability-flag-dashboard' -H "Authorization: Bearer $LITELLM_MASTER_KEY" -w '\nHTTP_STATUS=%{http_code}\n'
{"healthy_endpoints":[{"aws_region_name":"us-west-2","model":"invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","custom_llm_provider":"bedrock","model_id":"46b841dc-83f9-405a-a199-a6606c092983"}],"unhealthy_endpoints":[],"healthy_count":1,"unhealthy_count":0}
HTTP_STATUS=200

Flag in request body, unchanged

The request goes to the control model, which has no flag in its litellm_params.

Before:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-dashboard-control","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10,"supports_vision":true}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_vision: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-dashboard-control' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

After:

$ curl -sS http://localhost:$PORT/v1/chat/completions -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"model":"litellm-qa-capability-flag-dashboard-control","messages":[{"role":"user","content":"test from litellm"}],"max_tokens":10,"supports_vision":true}' -w '\nHTTP_STATUS=%{http_code}\n'
{"error":{"message":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_vision: Extra inputs are not permitted\"}\n\nLiteLLM: model group 'litellm-qa-capability-flag-dashboard-control' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}
HTTP_STATUS=400

Test Connect, flag false and no flag

The dashboard's Test Connect button on the Add Model page sends these requests, on the Postgres proxy after the dashboard cases. Test Connect takes a stored model with the same model string as its base config, so on the base the request with no flag still sent the dashboard model's flag.

Before:

$ curl -sS http://localhost:$PORT/health/test_connection -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"mode":"chat","litellm_params":{"model":"bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","aws_region_name":"us-west-2","supports_max_reasoning_effort":false}}' -w '\nHTTP_STATUS=%{http_code}\n'
{"status":"error","result":{"aws_region_name":"us-west-2","model":"invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","custom_llm_provider":"bedrock","error":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}\nstack trace: Traceback (most recent call last):\n  File \"/Users/mateo/Development/litellm-worktrees/repro-capability-flag-main/litellm/llms/custom_httpx/llm_http_handler.py\", line 542, in _make_common_async_call\n    response = await async_httpx_client.post(\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/mateo/Development/litellm-worktrees/repro-capability-flag-main/litellm/litellm_core_utils/logging_utils.py\", line 344, in async_wrapper\n    result: Final = await func(*args, **kwargs)\n                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/mateo/Development/litellm-worktrees/repro-capability-flag-main/litellm/llms/custom_httpx/http_handler.py\", line 886, in post\n    await _raise_masked_async_error(e, stream)\n  File \"/Users/mateo/Development/litellm-worktrees/repro-capability-flag-main/litellm/llms/custom_httpx/http_handler.py\", line 566, in _raise_masked_async_error\n    raise MaskedHTTPStatusError(e, message=_text, text=_text) from None\nlitellm.llms.custom_httpx.http_handler.Mask","raw_request_typed_dict":{"raw_request_api_base":"https://bedrock-runtime.us-west-2.amazonaws.com/model/us.anthropic.claude-sonnet-4-5-20250929-v1:0/invoke","raw_request_body":{"messages":[{"role":"user","content":[{"type":"text","text":"What's 1 + 1?"}]}],"max_tokens":16,"supports_max_reasoning_effort":false,"anthropic_version":"bedrock-2023-05-31"},"raw_request_headers":{"Content-Type":"application/json","X-Amz-Date":"20261015T141614Z","Authorization":"AW****9c"},"error":null}}}
HTTP_STATUS=200
$ curl -sS http://localhost:$PORT/health/test_connection -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"mode":"chat","litellm_params":{"model":"bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","aws_region_name":"us-west-2"}}' -w '\nHTTP_STATUS=%{http_code}\n'
{"status":"error","result":{"aws_region_name":"us-west-2","model":"invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","custom_llm_provider":"bedrock","error":"litellm.BadRequestError: BedrockException - {\"message\":\"supports_max_reasoning_effort: Extra inputs are not permitted\"}\nstack trace: Traceback (most recent call last):\n  File \"/Users/mateo/Development/litellm-worktrees/repro-capability-flag-main/litellm/llms/custom_httpx/llm_http_handler.py\", line 542, in _make_common_async_call\n    response = await async_httpx_client.post(\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/mateo/Development/litellm-worktrees/repro-capability-flag-main/litellm/litellm_core_utils/logging_utils.py\", line 344, in async_wrapper\n    result: Final = await func(*args, **kwargs)\n                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/mateo/Development/litellm-worktrees/repro-capability-flag-main/litellm/llms/custom_httpx/http_handler.py\", line 886, in post\n    await _raise_masked_async_error(e, stream)\n  File \"/Users/mateo/Development/litellm-worktrees/repro-capability-flag-main/litellm/llms/custom_httpx/http_handler.py\", line 566, in _raise_masked_async_error\n    raise MaskedHTTPStatusError(e, message=_text, text=_text) from None\nlitellm.llms.custom_httpx.http_handler.Mask","raw_request_typed_dict":{"raw_request_api_base":"https://bedrock-runtime.us-west-2.amazonaws.com/model/us.anthropic.claude-sonnet-4-5-20250929-v1:0/invoke","raw_request_body":{"messages":[{"role":"user","content":[{"type":"text","text":"Hey how's it going?"}]}],"max_tokens":16,"supports_max_reasoning_effort":false,"anthropic_version":"bedrock-2023-05-31"},"raw_request_headers":{"Content-Type":"application/json","X-Amz-Date":"20261015T141615Z","Authorization":"AW****67"},"error":null}}}
HTTP_STATUS=200

After:

$ curl -sS http://localhost:$PORT/health/test_connection -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"mode":"chat","litellm_params":{"model":"bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","aws_region_name":"us-west-2","supports_max_reasoning_effort":false}}' -w '\nHTTP_STATUS=%{http_code}\n'
{"status":"success","result":{"model":"invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","aws_region_name":"us-west-2","custom_llm_provider":"bedrock"}}
HTTP_STATUS=200
$ curl -sS http://localhost:$PORT/health/test_connection -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{"mode":"chat","litellm_params":{"model":"bedrock/invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","aws_region_name":"us-west-2"}}' -w '\nHTTP_STATUS=%{http_code}\n'
{"status":"success","result":{"aws_region_name":"us-west-2","model":"invoke/us.anthropic.claude-sonnet-4-5-20250929-v1:0","custom_llm_provider":"bedrock"}}
HTTP_STATUS=200

Observed during the run

  • /v1/messages already passed before, this PR leaves it
  • Unflagged Test Connect inherited a stored model's flag, fixed here

/audit at 2db878f915

PASS. The 36 cells in tests/integration/routing/test_model_capability_flags.py are red on the merge base wherever the flag reached the vendor, and green on both head runs

Matrix, one row per cell

Each rig ran two-worker proxies with its own Postgres, Redis and a scripted vendor that rejects any flag with that vendor's own 400. Both head runs used the same seeds, and the 10 control cells in the same group passed on the head

Row Surface Client Node id Base 958cba7016 Head run 1 Head run 2 Verdict
H1 /v1/chat/completions, openai, static flag OpenAI SDK sync test_chat_completions_send_a_flagged_deployment_the_control_request[openai-static] red pass pass PASS
H2 /v1/chat/completions stream, openai OpenAI SDK async test_streamed_chat_completions_send_a_flagged_deployment_the_control_request[openai] red pass pass PASS
H3 /v1/responses, openai OpenAI SDK sync test_responses_send_a_flagged_deployment_the_control_request pass pass pass PASS
H4 /v1/messages, openai deployment Anthropic SDK test_messages_send_a_flagged_deployment_the_control_request[openai] pass pass pass PASS
H5 /v1/embeddings, openai, embedding flag OpenAI SDK sync test_embeddings_send_a_flagged_deployment_the_control_request red pass pass PASS
H6 /v1/chat/completions, anthropic OpenAI SDK sync test_chat_completions_send_a_flagged_deployment_the_control_request[anthropic] red pass pass PASS
H7 /v1/messages, anthropic Anthropic SDK test_messages_send_a_flagged_deployment_the_control_request[anthropic] pass pass pass PASS
H8 /v1/chat/completions, bedrock converse, issue's flag OpenAI SDK sync test_chat_completions_send_a_flagged_deployment_the_control_request[bedrock_converse] red pass pass PASS
H9 /v1/chat/completions stream, bedrock converse OpenAI SDK async test_streamed_chat_completions_send_a_flagged_deployment_the_control_request[converse] red pass pass PASS
H10 /v1/messages, bedrock converse Anthropic SDK test_messages_send_a_flagged_deployment_the_control_request[converse] red pass pass PASS
H11 /v1/chat/completions, bedrock invoke OpenAI SDK sync test_chat_completions_send_a_flagged_deployment_the_control_request[bedrock_invoke] red pass pass PASS
H12 chat, catalog-only flag (supports_speed) OpenAI SDK sync test_chat_completions_send_a_flagged_deployment_the_control_request[openai-catalog_only] red pass pass PASS
H13 chat, bedrock_output_config_effort_ceiling OpenAI SDK sync test_chat_completions_send_a_flagged_deployment_the_control_request[openai-ceiling] red pass pass PASS
H14 chat, wildcard openai/* with flag OpenAI SDK sync test_a_flagged_wildcard_deployment_sends_the_control_request red pass pass PASS
H15 GET /health?model=flagged httpx test_health_probes_a_flagged_deployment_with_the_control_probe red pass pass PASS
H16 POST /health/test_connection with flag httpx test_test_connection_probes_flagged_params_with_the_unflagged_probe red pass pass PASS
S1 flag value int, list, "", 5 KB, null, false OpenAI SDK sync test_any_flag_value_sends_the_control_request[int] red pass pass PASS
S1 flag value int, list, "", 5 KB, null, false OpenAI SDK sync test_any_flag_value_sends_the_control_request[list] red pass pass PASS
S1 flag value int, list, "", 5 KB, null, false OpenAI SDK sync test_any_flag_value_sends_the_control_request[empty_string] red pass pass PASS
S1 flag value int, list, "", 5 KB, null, false OpenAI SDK sync test_any_flag_value_sends_the_control_request[five_kb] red pass pass PASS
S1 flag value int, list, "", 5 KB, null, false OpenAI SDK sync test_any_flag_value_sends_the_control_request[null] pass pass pass PASS
S1 flag value int, list, "", 5 KB, null, false OpenAI SDK sync test_any_flag_value_sends_the_control_request[false] red pass pass PASS
S2 flag twice, litellm_params true and model_info false OpenAI SDK + httpx test_a_flag_in_litellm_params_and_model_info_keeps_the_model_info_value red pass pass PASS
S3 unknown supports_ key not in the catalog OpenAI SDK sync test_an_undeclared_or_provider_supports_key_still_reaches_the_vendor[supports_litellm_qa_unknown] pass pass pass PASS
S3 unknown supports_ key not in the catalog OpenAI SDK sync test_an_undeclared_or_provider_supports_key_still_reaches_the_vendor[supports_system_prompt] pass pass pass PASS
S4 flagged deployment with a revoked key OpenAI SDK sync test_a_flagged_deployment_with_a_revoked_key_returns_the_vendor_401 pass pass pass PASS
S5 fallback from a 401 deployment to the flagged one OpenAI SDK sync test_a_fallback_to_a_flagged_deployment_sends_the_control_request red pass pass PASS
S6 GET /model/info and /v2/model/info httpx test_model_info_lists_the_served_params_without_the_flag[model_info] red pass pass PASS
S6 GET /model/info and /v2/model/info httpx test_model_info_lists_the_served_params_without_the_flag[v2_model_info] red pass pass PASS
S7 GET /model_group/info capabilities httpx test_model_group_info_reports_a_flagged_group_like_a_plain_one pass pass pass PASS
E1 supports_system_message false kept and honored OpenAI SDK sync test_supports_system_message_false_still_folds_the_system_prompt pass pass pass PASS
E2 three identical requests, each logged once OpenAI SDK sync + Postgres test_three_identical_requests_to_a_flagged_deployment_each_log_once red pass pass PASS
E3 PATCH /model/{id}/update adds a flag to a DB model httpx + OpenAI SDK test_a_flag_patched_onto_a_db_deployment_never_reaches_the_vendor red pass pass PASS
E4 concurrent updates under a 20-request burst OpenAI SDK sync threads test_updates_during_a_burst_never_send_the_flag red pass pass PASS
C1 config and POST /model/new flagged models on each worker, then a worker killed and its replacement (covers the old H17) OpenAI SDK + owned proxy test_each_worker_and_a_replacement_send_config_and_db_flagged_deployments_without_the_flag red pass pass PASS
C2 vendor drops connections between bursts OpenAI SDK + httpx test_a_vendor_outage_between_bursts_reports_unhealthy_then_healthy_and_never_sends_the_flag red pass pass PASS

Type

🐛 Bug Fix

Caveats (if any)

Low

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

  • 2db878f passes /audit

  • 2db878f passes /live-pr-risk

Cursor Bugbot summary

[!NOTE]
Medium Risk
Changes deployment registration and all outbound calls that read router litellm_params, but scope is narrow (metadata keys only) with explicit allowlists and extensive tests; admins may notice capability keys disappearing from /model/info while remaining in the DB.

Overview
Stops model capability metadata (e.g. supports_max_reasoning_effort, catalog supports_* keys, ProviderSpecificModelInfo fields) from being forwarded when it is mistakenly placed under a deployment’s litellm_params, which was causing Bedrock and other providers to return 400 “extra inputs not permitted” on chat, embeddings, /health, and Test Connect.

The router now strips those keys from the served deployment’s litellm_params at registration/upsert (config, DB sync, updates) and logs a warning to move them to model_info. Health-check probe building applies the same filter so dashboard probes match real traffic. Classification uses typed capability fields plus supports_* names present in the loaded model cost map (loaded_model_cost_map_fields), so real provider params like Replicate’s supports_system_prompt are not dropped blindly.

/model/info reflects the stripped params; flags in the request body are unchanged. Broad integration and unit tests cover routing, fallbacks, wildcards, concurrency, and multi-worker reloads.

Reviewed by Cursor Bugbot for commit 2db878f. Bugbot is set up for automated code reviews on this repo. Configure here.

A supports_* flag or another model map field set on a deployment's litellm_params was forwarded
to the provider as a request field, so Bedrock answered 400 Extra inputs are not permitted on
chat traffic and on the background health check alike. The shared owned-kwarg predicate now
treats every ProviderSpecificModelInfo field as litellm-owned.

Builds on the health-check-only approach in #40952 by leilei3167.
@devin-ai-integration

devin-ai-integration Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Automatic reviews are disabled for this repository.

@codspeed

codspeed Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

⚠️ 1 benchmark spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 31 untouched benchmarks


Comparing litellm_fix_capability_flags_reach_provider (2db878f) with main (958cba7)

Open in CodSpeed

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@litereview

litereview Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ code-review

5/5 · Ready for human review

Scope: full · Full PR review.

No correctness findings.

Checks and execution details
  • Passed · Real testing evidence (required): Not applicable: no LLM translation changes in the scoped paths. The changed files are litellm/litellm_core_utils/get_model_cost_map.py, litellm/proxy/health_check.py, litellm/router.py, litellm/router_utils/common_utils.py and tests. None of them is under litellm/llms/** or litellm/litellm_core_utils/prompt_templates/**.
  • Passed · Changed unit tests (optional): uv run --all-extras --group proxy-dev pytest -q tests/unit/router_utils/test_router_utils_common_utils.py tests/unit/proxy/test_health_check_max_tokens.py tests/unit/proxy/test_health_check_functions.py finished with 226 passed.
  • Passed · Capability filter does not drop declared litellm params (optional): A local run found no LiteLLM_Params.model_fields and no all_litellm_params member for which is_model_capability_field returns True. As a result, supports_system_message (read by main.py from kwargs) and the other declared params survive both the router filter and the health-probe filter. A grep found no reader that takes a supports_* key from a deployment's litellm_params other than supports_system_message.
  • Passed · Router write paths (optional): _create_deployment, add_deployment and upsert_deployment all use without_model_capability_flags. upsert_deployment compares the filtered params against the router copy, which is also filtered, so a DB resync is a no-op and warns only once, as the new test asserts.
  • Passed · Prior finding c10c17c8dd56499db9f5acd803de9ef8:0 (optional): This finding was already withdrawn. The current is_model_capability_field still excludes supports_system_message: it matches only ProviderSpecificModelInfo keys and supports_ keys in the cost map, and supports_system_message is in neither. The declared-litellm-param test still covers this case.

View review · Reviewed 2db878f915e3

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

return inferred


def warn_on_ignored_model_capability_flags(model_name: str, litellm_params: Mapping[str, object]) -> str | None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium · Startup warning tells admins to move supports_system_message to model_info, which disables it

  1. An admin sets supports_system_message: false under a deployment's litellm_params. This is a real LiteLLM_Params field (litellm/types/litellm_params.py:268), and it appears in all_litellm_params.
  2. The admin starts the proxy, and Router._create_deployment calls warn_on_ignored_model_capability_flags.
  3. That helper matches any key that starts with supports_. So it logs: Deployment 'm' sets ['supports_system_message'] under litellm_params, where litellm ignores them ... Move them under model_info.
  4. The warning is false. completion() reads this key from its kwargs (litellm/main.py:5376) and uses it to rewrite system messages (main.py:5584-5589).
  5. Suppose the admin follows the advice. Nothing reads supports_system_message from model_info, so system messages go to the provider unchanged and models that reject them start failing.

Smallest fix: leave all_litellm_params members out of the warning, for example by adding and key not in all_litellm_params, or reuse is_model_capability_field only after that check.

Evidence

Code-derived, plus a local reproduction of the warning. Running Router(model_list=[{"model_name":"m","litellm_params":{"model":"openai/gpt-4o","api_key":"x","supports_system_message":False}}]) logged: LiteLLM Router:WARNING: common_utils.py:411 - Deployment 'm' sets ['supports_system_message'] under litellm_params, where litellm ignores them and never sends them to the provider. Move them under model_info for litellm to use them.

uv run python -c "from litellm.types.utils import all_litellm_params; print('supports_system_message' in all_litellm_params)" printed True. It is the only supports_ name in all_litellm_params.

litellm/main.py:5376: supports_system_message: Final = kwargs.get("supports_system_message", None), then map_system_message_pt(messages=messages) when it is False.

grep -rn supports_system_message litellm finds no reader that takes this key from model_info.

Latest summary by code-review · View this review · Reviewed c827a36e4ae5

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f94ced7. The warning now skips declared litellm params like supports_system_message, and a router test covers that deployment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finding withdrawn

The reply is correct. In litellm/router_utils/common_utils.py:401-406, warn_on_ignored_model_capability_flags now warns only about keys that pass both is_model_capability_field(key) and key not in all_litellm_params. supports_system_message is a declared litellm param, so it no longer triggers the misleading "move it to model_info" advice. Both router call sites (router.py:9497 and router.py:10325) go through this helper. A new router test pins the behavior, and I confirmed it with a live Router run.

Evidence

litellm/router_utils/common_utils.py:401-406: if value is not None and is_model_capability_field(key) and key not in all_litellm_params

Local run on head: a deployment with supports_system_message: False and supports_vision: True logged a warning that listed only ['supports_vision'].

tests/unit/router_utils/test_router_utils_common_utils.py:865-875: the declared-litellm-param deployment with supports_system_message: False produces no capability warning (assert len(capability_warnings) == 1, and that one warning names only flag-in-litellm-params).

uv run pytest -q tests/unit/router_utils/test_router_utils_common_utils.py -k "capability or system_message" reported 2 passed.

GitHub does not allow this App to resolve this thread. A repository maintainer must do it manually.

Reviewed f94ced71aa70 · View follow-up

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

…p load

Cache the loaded catalog's field names when the cost map snapshot is taken so the capability-flag check stops walking every catalog entry per deployment, and add integration cells that drive the flagged and control deployments through chat, streaming, messages, responses, embeddings, health and model management against a vendor that rejects the flags
@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2db878f. Configure here.

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litellm-stampbot

@mateo-berri
mateo-berri enabled auto-merge (squash) October 15, 2026 14:27
@litellm-stampbot

Copy link
Copy Markdown

litellm-stampbot: risk low

Approved at 2db878f.

Rules (stampbot/risk_rules.yml):

  • low: no rule flagged it

Judge (gpt-6-luna): low, probability of high 0.12 (high at or above 0.90)

  • risk: low (probability of high 0.12)

Pushes do not re-run this check. Comment @litellm-stampbot again to re-check the new head.

@litellm-stampbot litellm-stampbot Bot added the risk:low Small, isolated, low-risk change label Oct 15, 2026

@kerry-berri kerry-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low risk by rule and by judgement at 2db878f

@mateo-berri
mateo-berri merged commit 18831b8 into main Oct 15, 2026
96 checks passed
@mateo-berri
mateo-berri deleted the litellm_fix_capability_flags_reach_provider branch October 15, 2026 14:30
pamanseau pushed a commit to KubeTEE-AI/litellm that referenced this pull request Oct 25, 2026
Prerequisite for the BerriAI#47419 backport to stable/1.103.x, taken from the stable/1.104.x hand-port 49cacdb4b2.
Minimal port of helpers from BerriAI#41523/BerriAI#43890/BerriAI#46647 needed by BerriAI#47419; behavior changes of those PRs not included. Registrations are tracked in a _runtime_registered_fields side table and cost-map entries stay plain dicts.
haowang1013 pushed a commit to directivegames/litellm that referenced this pull request Nov 3, 2026
…I#47419 calls to stable/1.105.x

Prerequisite for BerriAI#47419 on stable/1.105.x. Hand-ports from main (BerriAI#41523, BerriAI#46647):
ModelInfoLookupMiss and lookup_model_info_for_registration, the flat-price override helpers
(_without_overridden_price_variants and its rate-table helpers), and runtime_model_cost_registrations.
runtime_model_cost_registrations reads the line's _runtime_registered_model_cost store instead of
main's AliasedCostEntry.registered_fields, so cost-map alias entries stay plain dicts. Nothing on the
line calls these until BerriAI#47419 lands, and register_model's behavior is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Small, isolated, low-risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants