Repository navigation
Description
Check for existing issues
- I have searched the existing issues and checked that my issue is not a duplicate.
What happened?
Anthropic recently added support to pass "role": "system" info in messages list.
announcement article - https://www.anthropic.com/news/claude-opus-4-8
The Messages API now accepts system entries inside the messages array.
however, requests send to AWS bedrock have started breaking with 400 error because it doesnt really support this format. Requests coming into LiteLLM will have to be formatted so that bedrock (and other provides i'm guessing) can consume it.
bedrock error-
{
"error": {
"message": "{\"message\":\"Guardrail was enabled but input is in incorrect format.\"}. Received Model Group=Dummy Model \nAvailable Model Group Fallbacks=None",
"type": "None",
"param": "None",
"code": "400"
}
}
traceback -
{
"message": "litellm.proxy.proxy_server.anthropic_response(): Exception occured - 400: {'error': 'anthropic_messages: Invalid model name passed in model=Test Model. Call `/v1/models` to view available models for your key.'}",
"level": "ERROR",
"timestamp": "2026-06-04T19:25:54.312579",
"error": "anthropic_messages: Invalid model name passed in model=Test Model. Call `/v1/models` to view available models for your key.",
"component": "LiteLLM Proxy",
"logger": "endpoints.py:121",
"stacktrace": "Traceback (most recent call last):\n File \"/app/.venv/lib/python3.13/site-packages/litellm/proxy/anthropic_endpoints/endpoints.py\", line 53, in anthropic_response\n result = await base_llm_response_processor.base_process_llm_request(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n ...<16 lines>...\n )\n ^\n File \"/app/.venv/lib/python3.13/site-packages/litellm/proxy/common_request_processing.py\", line 1054, in base_process_llm_request\n llm_call = await route_request(\n ^^^^^^^^^^^^^^^^^^^^\n ...<5 lines>...\n )\n ^\n File \"/app/.venv/lib/python3.13/site-packages/litellm/proxy/route_llm_request.py\", line 567, in route_request\n raise ProxyModelNotFoundError(\n ...<2 lines>...\n )\nlitellm.proxy.route_llm_request.ProxyModelNotFoundError: 400: {'error': 'anthropic_messages: Invalid model name passed in model=Test Model. Call `/v1/models` to view available models for your key.'}"
}
Steps to Reproduce
deploy litellm, connect it to bedrock and send a curl
curl -X POST http://localhost:4000/v1/messages
-H "Content-Type: application/json"
-H "Authorization: Bearer KEY"
-d '{
"model": "Test Model",
"max_tokens": 100,
"messages": [
{"role": "user", "content": "hello"},
{"role": "system", "content": "You are a helpful assistant."}
]
}'
What part of LiteLLM is this about?
API
What LiteLLM version are you on ?
v1.83.14
Activity
hclsys commentedon Jun 4, 2026
PR up: #29709. hoists role=system out of messages[] into the top-level system field before bedrock/etc see it. 6 new tests + negative-test verified.
fix(bedrock): normalize in-array system in /v1/messages handler (Berr…
fix(bedrock/converse): translate in-array system in anthropic->openai…
fix(bedrock): handle role:"system" inside the messages array on /v1/m…
Revert "fix(bedrock): handle role:"system" inside the messages array …
chore: litellm oss 170626 (#30637)
chore: litellm oss 170626 (BerriAI#30637)
test: add unit tests for system role message normalization
fix: normalize system role messages for Anthropic partner endpoints
test: add unit tests for system role message normalization