litellm/litellm/llms
Mateo Wang 65d30c26ac
fix(streaming): preserve failure context without retaining requests (#52408)
* fix(streaming): preserve failure context without retaining requests

Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(streaming): let the failure hook refresh its request fields

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(router): drop redundant error clearing wrappers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(router): cover error clearing on raised retries

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): add live disconnect failure callback check

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): route live QA observation resets to relay

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): script disconnected Bedrock callback upstream

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-18 06:18:22 +00:00
..
a2a refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
ai21/chat refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
aiml fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
aiohttp_openai/chat refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
amazon_nova refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
anthropic fix(streaming): preserve failure context without retaining requests (#52408) 2026-11-18 06:18:22 +00:00
apiserpent refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
aws_polly feat(tts)!: stream audio from the provider as it arrives on /v1/audio/speech (#46222) 2026-11-17 15:03:12 +00:00
azure fix(azure_ai)!: send chat on Foundry project and /openai/v1 bases to the v1 chat route (#51144) 2026-11-18 05:50:05 +00:00
azure_ai fix(azure_ai)!: send chat on Foundry project and /openai/v1 bases to the v1 chat route (#51144) 2026-11-18 05:50:05 +00:00
base_llm fix(bedrock): stop the prefill 400 when the last user message is empty (#50701) 2026-11-18 03:44:11 +00:00
baseten refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
bedrock fix(bedrock): stop the prefill 400 when the last user message is empty (#50701) 2026-11-18 03:44:11 +00:00
bedrock_mantle fix(responses): prevent duplicate authorization headers (#52259) 2026-11-18 01:15:52 +00:00
bespoke/decisions feat(decisions): add Laya and Bespoke providers to the Add Model form (#45260) 2026-10-14 08:11:11 -07:00
bigmodel feat(zai): support response_format and max_completion_tokens, add glm-5v-turbo pricing (#48335) 2026-10-29 20:30:50 -07:00
black_forest_labs refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
brave/search chore(typing): clear 670 basedpyright Any errors by validating provider payloads at the boundary (#45388) 2026-10-13 15:35:23 -07:00
bytez refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
cerebras refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
chatgpt fix(reasoning): log the GPT-5 reasoning_effort drop warning only when the provider gets no effort (#50995) 2026-11-10 19:38:52 -08:00
clarifai/chat refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
claude_code refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
clf_ai_gateway/chat refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
cloudflare fix(cloudflare): clarify chat and decisions endpoints (#47965) (#48265) 2026-10-25 00:29:48 +00:00
codestral/completion refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
codex refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
cohere fix(cohere)!: map tool_choice, reasoning_effort and json_schema response_format on the v2 chat route (#50834) 2026-11-17 18:10:37 +00:00
cometapi refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
compactifai refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
custom_httpx fix(aiohttp_transport): close sessions of evicted Azure and base64 embedding clients (#52266) 2026-11-17 17:16:41 -08:00
dashscope fix(dashscope): bill 1h cache writes at the 1h rate (#52331) 2026-11-17 12:07:01 -08:00
databricks fix(vertex_ai): resolve correct default max_tokens for versioned claude ids (#40376) 2026-11-14 17:36:51 -05:00
dataforseo/search refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
datarobot/chat refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
deepagents refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
deepgram fix(audio-transcription): keep transcripts out of transcription error messages (#50137) 2026-11-05 18:07:15 -08:00
deepinfra fix(openai): stop stripping cache_control from the caller's own messages and tools (#35602) 2026-10-31 00:29:10 -07:00
deepseek fix(proxy): count tokens with the thinking, effort, and tool_choice that inference sends (#51079) 2026-11-14 02:29:16 +00:00
deprecated_providers refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
docker_model_runner/chat fix(openai): download PDF URLs off the event loop and transform async chat messages once (#49176) 2026-11-10 16:37:00 +00:00
duckduckgo/search fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
e2b fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
edenai refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
elevenlabs feat(tts)!: stream audio from the provider as it arrives on /v1/audio/speech (#46222) 2026-11-17 15:03:12 +00:00
empiriolabs/decisions feat(decisions): add EmpirioLabs AI as a decisions provider (#49977) 2026-11-04 10:41:16 -08:00
empower/chat
eu_jev feat(pass-through): add eu/jev decision API pass-through with spend tracking (#46875) 2026-10-29 17:52:43 -07:00
exa_ai/search fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
fal_ai fix(fal_ai): bill a video request without a resolution at the row's default rate (#51665) 2026-11-16 03:30:51 +08:00
fastcrw fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
featherless_ai/chat refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
firecrawl fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
fireworks_ai fix(fireworks_ai): read fractional sizes like 1p5b in the size bucket fallback (#51451) 2026-11-13 17:49:49 +00:00
friendliai/chat fix(friendliai): drop litellm-internal message fields before sending (#45092) 2026-10-20 01:22:07 +00:00
galadriel/chat
gdc refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
gemini fix(gemini): return n images for image generations and edits when n > 1 (#52103) 2026-11-16 14:50:13 -08:00
gigachat refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
github/chat
github_copilot fix(github_copilot): explain why a Copilot call failed and how to fix it (#52352) 2026-11-18 02:31:12 +00:00
google_pse/search chore(typing): clear 670 basedpyright Any errors by validating provider payloads at the boundary (#45388) 2026-10-13 15:35:23 -07:00
gradient_ai/chat refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
groq fix(openai): stop stripping cache_control from the caller's own messages and tools (#35602) 2026-10-31 00:29:10 -07:00
heroku/chat fix(openai): download PDF URLs off the event loop and transform async chat messages once (#49176) 2026-11-10 16:37:00 +00:00
hosted_vllm fix(hosted_vllm): omit empty tools list from chat requests (#50812) 2026-11-09 19:49:13 -08:00
huggingface fix(huggingface): honor HUGGINGFACE_API_BASE and env endpoints for chat (#51449) 2026-11-13 10:35:34 -08:00
hyperbolic refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
inception refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
infinity fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
jina_ai fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
lambda_ai refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
langflow refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
langgraph fix(streaming)!: fail a stream that ends without a finish reason (#47665) 2026-10-31 11:29:26 -07:00
laya feat(decisions): add Laya and Bespoke providers to the Add Model form (#45260) 2026-10-14 08:11:11 -07:00
lemonade refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
linkup fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
litellm_proxy chore: move LiteLLM's configs and e2e tests off gpt-4o and gpt-4.1 before their 2027-01-14 shutdown (#51800) 2026-11-14 10:50:59 -08:00
llamafile/chat refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
lm_studio feat(decisions): support LM Studio decision models (#48448) 2026-10-27 02:24:09 +00:00
manus refactor(prompt_templates): move JSON schema helpers out of common_utils into json_schema_utils (#50241) 2026-11-05 17:25:53 -08:00
meta/realtime fix(realtime)!: keep turn_detection.type when a transcript guardrail disables auto-response (#44939) 2026-10-16 15:24:40 +00:00
meta_llama/chat feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
microsoft_365_copilot fix(router)!: bound fake-streamed calls by the request timeout, not stream_timeout (#47162) 2026-10-17 22:08:02 +00:00
milvus/vector_stores refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
minimax refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
mistral fix(responses): accept a string or tuple allowed_openai_params on Responses models instead of answering 500 (#51751) 2026-11-14 04:32:38 -05:00
modelscope refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
mongodb fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
moonshot/chat fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
morph feat(morph): support open models and cached input pricing (#48676) 2026-10-27 18:06:14 -07:00
nace/decisions feat(nace): add Drex Max decisions and inline images (#48426) 2026-11-12 21:27:37 -08:00
nadir/chat refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
nebius feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
nimble fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
nlp_cloud refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
novita/chat fix(openai-compat): send provider attribution headers on the default SDK path (+ Perplexity) (#44291) 2026-10-07 13:21:27 -07:00
nscale/chat refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
nvidia_nim fix(embeddings): unwrap extra_body for providers with their own embedding handlers (#51335) 2026-11-12 15:41:50 -08:00
nvidia_riva refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
oci fix(fips): hash MCP advisory-lock keys with SHA-256 in fips_mode and compute the OCI body digest as a security hash (#51165) 2026-11-11 16:22:14 -08:00
ollama fix(embeddings): unwrap extra_body for providers with their own embedding handlers (#51335) 2026-11-12 15:41:50 -08:00
oobabooga refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
openai fix(decisions): forward OpenAI prompt cache fields (#51457) 2026-11-18 03:25:09 +00:00
openai_like feat(sarvam): send a litellm User-Agent on chat requests (#52012) 2026-11-17 23:52:53 +00:00
opencode fix(opencode_go): forward chat reasoning effort (#52156) 2026-11-16 16:31:56 -08:00
openrouter feat(decisions): support Vercel AI Gateway decision models (#50642) 2026-11-14 09:43:08 -05:00
opensandbox refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
opensearch feat(opensearch): map vector store search filters to k-NN filters and add hybrid search (#51131) 2026-11-14 03:30:55 +00:00
ovhcloud fix(audio-transcription): keep transcripts out of transcription error messages (#50137) 2026-11-05 18:07:15 -08:00
parallel_ai feat(decisions): add Parallel AI web-grounded decisions (#49188) 2026-11-03 04:47:02 +00:00
pass_through fix(spend): keep a NaN or infinite cost from wedging daily spend writes (#48829) 2026-10-30 08:27:35 -07:00
perplexity refactor: clean up fresh tech debt from 2026-11-15 window (#51996) 2026-11-16 10:08:30 -08:00
petals refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
pg_vector/vector_stores refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
pi feat(harness): add pi harness for litellm.agent() (#45467) 2026-10-20 09:01:40 +00:00
predibase refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
ragflow refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
recraft refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
reducto refactor(ocr): remove the Python OCR execution path and require the Rust route (#43081) 2026-09-24 18:18:50 -07:00
replicate refactor: share Replicate HTTP client factories and declare PagerDuty type alias (#51594) 2026-11-17 02:32:54 +00:00
runwayml feat(videos): add first-class OpenRouter video request fields (#50319) 2026-11-06 16:50:48 -08:00
s3_vectors fix(bedrock): derive the web identity session policy per AWS caller (#50592) 2026-11-08 19:13:53 +00:00
sagemaker fix(embeddings): unwrap extra_body for providers with their own embedding handlers (#51335) 2026-11-12 15:41:50 -08:00
sail chore(lint): remove the LIT002 mutable-construction rule (#43971) 2026-10-01 12:24:02 -07:00
sambanova fix(openai): download PDF URLs off the event loop and transform async chat messages once (#49176) 2026-11-10 16:37:00 +00:00
sap refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
scaledown fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
scaleway fix(audio-transcription): keep transcripts out of transcription error messages (#50137) 2026-11-05 18:07:15 -08:00
searchapi chore(typing): clear 670 basedpyright Any errors by validating provider payloads at the boundary (#45388) 2026-10-13 15:35:23 -07:00
searxng fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
serper/search fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
snowflake refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
soniox refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
stability refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
strands_decider/decisions feat(strands_decider): call a Strands Decider on an AgentCore runtime ARN (#45678) 2026-10-09 22:51:19 -07:00
tavily/search fix(tavily): return raw_content, score, favicon and the response envelope from Tavily search (#48684) 2026-10-27 18:52:06 -07:00
tencent fix(logging): warn when drop_params drops a requested reasoning level on the remaining paths (#48933) 2026-10-30 08:48:43 -07:00
tinyfish/search refactor(types): replace Any with proven types in 137 files (#44478) 2026-10-05 11:01:45 -07:00
together_ai refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
tool_loop feat(harness): add Harness.TOOL_LOOP, a minimal in-process tool-calling loop (#44391) 2026-10-03 17:33:01 +00:00
topaz fix(llms): join api_base and route with one shared helper (#47535) 2026-10-21 06:59:32 +00:00
triton refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
typesafe/decisions fix(router): budget classifier input by provider limits (#49306) 2026-10-30 14:38:14 -07:00
v0 refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
valkey refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
vercel_ai_gateway fix(decisions): forward OpenAI prompt cache fields (#51457) 2026-11-18 03:25:09 +00:00
vertex_ai fix(gemini): keep Google's reason on streamed chunks and the assembled response (#52242) 2026-11-17 16:01:46 -08:00
vllm fix(vllm): list hosted_vllm wildcard models when the server has no api key (#40066) 2026-11-03 04:13:28 +00:00
volcengine refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
voyage refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
wandb chore(lint): remove the LIT002 mutable-construction rule (#43971) 2026-10-01 12:24:02 -07:00
watsonx refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
webiq feat(search): add Microsoft Web IQ provider (#50883) 2026-11-10 22:43:36 +00:00
xai refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
xinference/image_generation feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
you_com refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
zai feat(zai): support response_format and max_completion_tokens, add glm-5v-turbo pricing (#48335) 2026-10-29 20:30:50 -07:00
__init__.py fix(vertex_ai): bill Claude web search per request on deployments priced in model_info (#49160) 2026-10-30 23:14:51 -07:00
base.py refactor(types): replace Any with proven types in 24 files (#46663) 2026-10-15 06:10:12 -07:00
compaction.py refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
custom_llm.py feat(custom_llm): let custom providers serve native generateContent (#51083) 2026-11-14 05:57:58 -05:00
maritalk.py refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
oss_decision.py feat(decisions): add Laya and Bespoke providers to the Add Model form (#45260) 2026-10-14 08:11:11 -07:00
README.md
subscription_accounts.py feat(usage): show subscription-covered providers and account fees separately (#44772) 2026-10-30 03:58:36 -07:00

File Structure

August 27th, 2024

To make it easy to see how calls are transformed for each model/provider:

we are working on moving all supported litellm providers to a folder structure, where folder name is the supported litellm provider name.

Each folder will contain a *_transformation.py file, which has all the request/response transformation logic, making it easy to see how calls are modified.

E.g. cohere/, bedrock/.