litellm/tests/test_litellm/llms
devin-ai-integration[bot] fecc8c8f74
feat(bedrock): serve the OpenAI models on bedrock-runtime's native Responses API (internal copy of #38489) (#42767)
* feat(bedrock): serve the OpenAI models on bedrock-runtime's native Responses API

AWS serves the OpenAI models on bedrock-runtime through an OpenAI-compatible
surface at /openai/v1/responses, alongside Converse. LiteLLM had no Responses
config for the bedrock provider, so /v1/responses fell back to the Chat
Completions bridge and was translated into Converse. A realistic Codex session
does not survive that translation: its function_call / function_call_output
history becomes Converse toolUse / toolResult blocks with no toolConfig, and
Converse rejects the request outright.

Add a Responses config for that surface, opted into per model from the price-map
supported_endpoints so models without the signal keep the bridge exactly as
before. Auth is Bearer when a Bedrock API key is present, SigV4 otherwise.

Both Bedrock endpoints reject the Codex history item types agent_message,
context_compaction and local_shell_call, so the normalization bedrock_mantle
carried privately moves into a shared module and both providers use it. They are
history items, so they only bite from the second turn onward -- a first-turn
smoke test passes and hides the problem. Verified against bedrock-runtime with
global.openai.gpt-5.6-sol: additional_tools is accepted there (unlike on
bedrock-mantle) while those three types are rejected, so the two endpoints do
not share one validator and each provider opts in explicitly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(bedrock): build the Responses endpoint from the region's partition suffix

get_complete_url hardcoded amazonaws.com in an f-string, so every non-commercial
partition got the wrong host: cn-north-1 resolved to amazonaws.com instead of
amazonaws.com.cn, and GovCloud/ISO regions were wrong the same way. Defer to
BaseAWSLLM._select_default_endpoint_url, which this config already inherits and
which resolves the suffix per partition.

test_no_fstring_hardcodes_the_commercial_dns_suffix scans the whole tree, so it
caught this even though it is not one of this PR's test files. Register the
config in ENDPOINT_BUILDERS so the cn/GovCloud endpoint sweep covers this
surface from now on rather than only the f-string guard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(bedrock): opt the gpt-6 family into the native Responses API

* fix(bedrock): drop the Responses tool types bedrock-runtime rejects

Codex sends a web_search tool on every turn. api.openai.com runs that tool
itself, and the Converse bridge dropped it silently, but bedrock-runtime's
native Responses endpoint rejects the whole request with 400 "web search is
not supported for this request". Filter the request's tools down to the
types bedrock-runtime's own validation error names, logging what was dropped,
through a helper shared with the Mantle route, which already did the same.

* fix(bedrock): emulate file_search and collapse custom Responses paths

* fix(bedrock): keep background and remote image inputs working on the native Responses route

* fix(bedrock): inline remote images inside tool outputs on the native Responses route

* fix(bedrock): inline remote computer screenshots on the native Responses route

---------

Co-authored-by: Leonardo Freitas dos Santos <leonardo.freitas.s@outlook.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-23 15:12:39 -07:00
..
aiml/image_generation test: delete assertions that pin vendor cost map facts 2026-09-18 00:28:49 +00:00
anthropic fix(anthropic): preserve MCP tool results in the non-Anthropic Messages bridge (#42783) 2026-09-23 13:03:25 -07:00
azure test(realtime): drop legacy InvalidStatusCode tests and pin websockets imports (#42624) 2026-09-22 17:42:12 -07:00
azure_ai fix(cost): honor deployment pricing for image generation (#39311) 2026-09-22 11:40:39 -07:00
base_llm feat(bedrock): serve the OpenAI models on bedrock-runtime's native Responses API (internal copy of #38489) (#42767) 2026-09-23 15:12:39 -07:00
bedrock feat(bedrock): serve the OpenAI models on bedrock-runtime's native Responses API (internal copy of #38489) (#42767) 2026-09-23 15:12:39 -07:00
bedrock_mantle fix(anthropic): map the dangerous-tool-use beta for Bedrock Mantle so safeguards never reach it without the beta 2026-09-21 13:24:52 -07:00
black_forest_labs test(llms): migrate phase 5 provider unit tests to tests/unit 2026-09-20 07:50:38 +00:00
cerebras test(llms): migrate phase 5 provider unit tests to tests/unit 2026-09-20 07:50:38 +00:00
chatgpt Merge pull request #42109 from BerriAI/litellm_migrate_tests_p5 2026-09-20 04:00:48 -07:00
cometapi/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
compactifai fix(exceptions): map upstream status codes for providers with no exception_type branch 2026-08-26 00:47:28 -07:00
crusoe test(llms): migrate phase 6 provider unit tests to tests/unit 2026-09-20 07:50:30 +00:00
custom_httpx feat(bedrock): serve the OpenAI models on bedrock-runtime's native Responses API (internal copy of #38489) (#42767) 2026-09-23 15:12:39 -07:00
dashscope test: keep the Qwen brand missing-key tests off the network and split the ChatGPT fields test back out 2026-09-21 12:54:23 -07:00
databricks chore(cost-map): remove models past their deprecation date (#42435) 2026-09-22 21:19:26 +00:00
deepgram fix(deepgram): forward only the first model and language values to /listen 2026-09-18 21:29:29 +00:00
deepinfra test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
deepseek test(llms): migrate phase 6 provider unit tests to tests/unit 2026-09-20 07:50:30 +00:00
edenai fix(edenai): advertise reasoning_effort only for models the price map flags as reasoning 2026-09-21 19:58:58 +00:00
fal_ai fix(fal_ai): honour global api_base for image generation and reject non-string reasoning_effort with 400 (#42512) 2026-09-22 13:13:54 -07:00
featherless_ai/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
fireworks_ai/completion test(llms): migrate phase 7 provider unit tests to tests/unit 2026-09-20 08:08:12 +00:00
gdc/chat Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5 2026-08-29 06:03:33 -07:00
gemini chore(cost-map): remove models past their deprecation date (#42435) 2026-09-22 21:19:26 +00:00
gigachat test(llms): migrate phase 7 provider unit tests to tests/unit 2026-09-20 08:08:12 +00:00
github_copilot chore(cost-map): remove models past their deprecation date (#42435) 2026-09-22 21:19:26 +00:00
gradient_ai test: migrate wave 1 phase 8 legacy llm tests to tests/unit 2026-09-20 08:03:54 +00:00
groq test: migrate wave 1 phase 8 legacy llm tests to tests/unit 2026-09-20 08:03:54 +00:00
heroku
huggingface test: migrate wave 1 phase 8 legacy llm tests to tests/unit 2026-09-20 08:03:54 +00:00
inception test: migrate wave 1 phase 8 legacy llm tests to tests/unit 2026-09-20 08:03:54 +00:00
langflow test: migrate wave 1 phase 8 legacy llm tests to tests/unit 2026-09-20 08:03:54 +00:00
lemonade test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
lm_studio
manus test: migrate phase 9 legacy llm provider tests to tests/unit 2026-09-20 08:13:11 +00:00
minimax test: migrate phase 9 legacy llm provider tests to tests/unit 2026-09-20 08:13:11 +00:00
mistral test: migrate phase 9 legacy llm provider tests to tests/unit 2026-09-20 08:13:11 +00:00
modelscope/chat test: migrate phase 9 legacy llm provider tests to tests/unit 2026-09-20 08:13:11 +00:00
nebius test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
nvidia_riva test: migrate nvidia, oci, ocr, oobabooga and openai legacy tests to tests/unit 2026-09-20 08:09:49 +00:00
oci test: migrate nvidia, oci, ocr, oobabooga and openai legacy tests to tests/unit 2026-09-20 08:09:49 +00:00
ocr test: migrate nvidia, oci, ocr, oobabooga and openai legacy tests to tests/unit 2026-09-20 08:09:49 +00:00
ollama fix(ollama): send PNG and JPEG images without requiring Pillow. (#41979) 2026-09-22 17:09:39 -07:00
openai ci: add merge smoke checks workflow with loopback-only harness and 11 curated cases (#42709) 2026-09-23 11:01:08 -07:00
openai_like feat: add configurable provider affinity header mapping (#41033) 2026-09-22 13:31:33 -07:00
ovhcloud test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
parallel_ai test: migrate phase 12 legacy llm provider tests to tests/unit 2026-09-20 11:02:53 +00:00
pass_through test: remove four mirror test files that exercise none of their module 2026-07-25 10:57:19 -07:00
perplexity test: migrate phase 12 legacy llm provider tests to tests/unit 2026-09-20 11:02:53 +00:00
pg_vector/vector_stores test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
reducto test: keep the pinning-test removal free of unrelated reformatting 2026-09-18 04:27:28 +00:00
s3_vectors test: migrate phase 12 legacy llm provider tests to tests/unit 2026-09-20 11:02:53 +00:00
sagemaker feat(bedrock): thread aws_session_tags into STS AssumeRole 2026-09-09 12:37:36 -07:00
sambanova
sap test: migrate phase 12 legacy llm provider tests to tests/unit 2026-09-20 11:02:53 +00:00
snowflake test: migrate phase 12 legacy llm provider tests to tests/unit 2026-09-20 11:02:53 +00:00
soniox test: migrate phase 12 legacy llm provider tests to tests/unit 2026-09-20 11:02:53 +00:00
stability test: migrate phase 12 legacy llm provider tests to tests/unit 2026-09-20 11:02:53 +00:00
tencent Merge pull request #42145 from BerriAI/litellm_migrate_tests_p13 2026-09-20 10:50:18 -07:00
tinyfish test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
vercel_ai_gateway test: migrate legacy provider tests to tests/unit (wave 2, phase 13) 2026-09-20 14:18:49 +00:00
vertex_ai fix: repair seven regressions caught by CircleCI on main (#42640) 2026-09-23 02:26:36 +00:00
volcengine test: migrate phase 14 wave 2 provider tests to tests/unit 2026-09-20 11:01:40 +00:00
voyage/rerank test: migrate phase 14 wave 2 provider tests to tests/unit 2026-09-20 11:01:40 +00:00
wandb chore(cost-map): remove models past their deprecation date (#42435) 2026-09-22 21:19:26 +00:00
watsonx test: migrate phase 14 wave 2 provider tests to tests/unit 2026-09-20 11:01:40 +00:00
xai chore(cost-map): remove models past their deprecation date (#42435) 2026-09-22 21:19:26 +00:00
you_com test: migrate phase 14 wave 2 provider tests to tests/unit 2026-09-20 11:01:40 +00:00
test_cache_control_and_reasoning.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_file_content_block.py
test_file_search_responses.py fix(file_search): escape the dropped vector_store_id in the warning 2026-09-05 16:44:54 -07:00
test_lifecycle_fix.py
test_polling_url_origin_match.py
test_predibase_transformation.py