litellm/tests/test_litellm/llms
Mateo Wang f05280f71b
fix: stop use_chat_completions_api flag from leaking into provider request body (#29447)
* fix: stop use_chat_completions_api flag from leaking into provider request body

use_chat_completions_api is a LiteLLM control flag that forces the
/responses -> /chat/completions bridge. It was missing from
all_litellm_params, so get_non_default_completion_params treated it as a
model-specific param and forwarded it to the upstream provider. A
model-level "use_chat_completions_api: true" in the proxy config therefore
reached the chat-completions path and was rejected by strict providers
(OpenAI/Anthropic) with HTTP 400 for an unknown body field.

Register it as a known internal param so it is stripped on every path
(completion, the responses bridge that calls litellm.completion, and
filter_out_litellm_params).

Adds a regression test driving litellm.completion() with a mocked OpenAI
client that asserts the flag never reaches the request body.

* test: clarify extra_body assertion in use_chat_completions_api leak test

Replace the misleading 'not in ... or {}' precedence idiom with an explicit
parenthesized guard that also handles extra_body being None.

(cherry picked from commit 65b6e04da6)
2026-06-20 11:45:14 -07:00
..
amazon_nova/chat style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
anthropic fix: completion_cost AttributeError on streaming Anthropic web_search responses (#26153) (#27346) 2026-06-11 04:32:33 +00:00
azure fix(azure): preserve AD token refresh in v1 OpenAI client path (#28627) 2026-05-25 21:08:52 -07:00
azure_ai refactor: remove unnecessary comments from #27074 2026-05-04 19:34:56 +00:00
base_llm fix(team): keep team_alias cache in sync on _cache_team_object writes (#28737) 2026-05-25 19:16:36 -07:00
baseten/chat style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
bedrock Add Claude Fable 5 across Anthropic, Bedrock, Vertex AI, and Azure AI (#30064) 2026-06-10 18:10:21 +00:00
bedrock_mantle feat(bedrock_mantle): add SigV4/IAM auth to Responses API route (#29788) 2026-06-11 03:09:30 +00:00
black_forest_labs style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
bytez/chat fix: preserve safe provider model path segments 2026-04-29 22:09:54 -07:00
chat style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
chatgpt Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
cloudflare fix: preserve safe provider model path segments 2026-04-29 22:09:54 -07:00
cohere style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
cometapi/chat style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
compactifai style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
crusoe fix(crusoe): remove trailing slashes from API base URLs and fix list indentation 2026-05-01 17:27:52 +05:30
custom_httpx feat(bedrock_mantle): add SigV4/IAM auth to Responses API route (#29788) 2026-06-11 03:09:30 +00:00
dashscope Litellm oss staging (#28161) 2026-05-18 16:27:44 -07:00
databricks style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
datarobot style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
deepgram style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
deepinfra style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
deepseek fix(deepseek): use native /anthropic/v1/messages endpoint and sanitize tools (#28200) 2026-05-18 18:14:13 -07:00
docker_model_runner style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
elevenlabs test: avoid provider test module name collision 2026-04-29 22:36:57 -07:00
featherless_ai/chat style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
fireworks_ai Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
gemini [Feat] Add tool calling support for gemini and vertex ai live api (#26590) 2026-05-26 14:40:42 -07:00
github_copilot fix black and github mock test 2026-05-11 20:41:10 +05:30
heroku style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
hosted_vllm fix(hosted_vllm): normalize custom tools for chat completions (#25763) 2026-05-05 17:27:02 -07:00
huggingface style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
jina_ai/embedding feat(JinaAI): support multimodal embedding models (#13181) 2025-08-05 19:21:56 -07:00
lemonade style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
litellm_proxy chore: simplify ownership tracking — drop thin stores, in-memory fallback, hand-rolled cache 2026-05-05 00:23:32 +00:00
llamafile/chat style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
lm_studio style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
manus fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
meta_llama fix: add missing OpenAI chat completion params to OPENAI_CHAT_COMPLETION_PARAMS (#21360) 2026-02-16 20:31:21 -08:00
minimax style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
mistral Merge pull request #25256 from BerriAI/litellm_ishaan_april6 2026-04-17 16:26:45 -07:00
moonshot add moonshot/kimi-k2.6 to model registry (#26203) 2026-04-21 19:58:43 -07:00
nebius test: fixes 2025-05-31 12:42:56 -07:00
novita/chat
nscale/chat
nvidia_riva feat(audio_transcription): add NVIDIA Riva STT provider (#27185) 2026-05-05 17:17:51 -07:00
oci CI: copy of #25177 (OCI GenAI: embeddings, streaming/reasoning fixes, model catalog) (#28223) 2026-05-23 12:15:41 -07:00
ocr Add OCR guardrail_translation handler and support (#22145) 2026-02-28 17:39:36 -08:00
ollama Litellm agent oss staging 05 11 2026 (#27733) 2026-05-13 14:09:12 -07:00
openai fix: stop use_chat_completions_api flag from leaking into provider request body (#29447) 2026-06-20 11:45:14 -07:00
openai_like style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
openrouter style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
ovhcloud fix(ovhcloud): remove dead transform_response override 2026-04-28 23:09:17 +05:30
perplexity style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
pg_vector/vector_stores fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
publicai style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
ragflow/chat fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
recraft style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
reducto Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
runwayml fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
s3_vectors Fix extra body error 2026-04-29 08:34:31 +05:30
sagemaker fix(sagemaker): send native Cohere embed payload to Cohere SageMaker endpoints (#28613) 2026-05-22 12:00:42 -07:00
sambanova Feat/sambanova embeddings (#13308) 2025-08-12 17:15:26 -07:00
sap style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
scaleway Feature/add audio support for scaleway (#26110) 2026-04-20 14:49:41 -07:00
snowflake style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
stability style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
vercel_ai_gateway style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
vertex_ai fix(vertex): strip output_config.effort for Vertex Claude models that reject it (Haiku 4.5) (#29585) 2026-06-03 22:54:06 +00:00
volcengine fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
voyage/rerank style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
wandb (feat): Add W&B Inference to LiteLLM 2025-09-11 00:07:30 +05:30
watsonx style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
xai Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
zai style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_cache_control_and_reasoning.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_file_content_block.py Litellm oss staging (#28161) 2026-05-18 16:27:44 -07:00
test_file_search_responses.py fix(tests): use canonical litellm_enterprise import path (#27699) 2026-05-12 12:32:57 -07:00
test_lifecycle_fix.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_oom_fixes.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_polling_url_origin_match.py chore(security): close two unaddressed SSRF cases 2026-05-01 18:43:47 +00:00
test_predibase_transformation.py refactor(predibase): migrate transform_request and transform_response… (#25249) 2026-04-27 08:58:22 +05:30