litellm/litellm/llms
zoveki 22252073e7
feat(bedrock): search knowledge bases by image and return image hits (#51063)
* feat(bedrock): search knowledge bases by image and return image hits

vector_stores.search and asearch take a query_image (base64 jpeg, png, gif or webp), and query is optional when it is sent. Bedrock sends it as an IMAGE retrievalQuery, and a caller's own retrievalQuery in extra_body still wins

Bedrock IMAGE hits now come back as image content items instead of being dropped. The media type comes from the source file mime type metadata, then the data URI label, then application/octet-stream

A request with both query and query_image, with neither, or with a malformed image gets a 400. So does query_image on a provider without image search, unless drop_params is on. The proxy accepts query_image in place of query on /v1/vector_stores/{id}/search

Spend logs redact image data when prompts are not stored. Emulated file_search skips image-only hits, RAG rerank maps its indices to the text documents it ranked, and the dashboard tester renders image hits

* fix(vector-stores): keep image hits to image searches and reject a caller retrievalQuery

Text searches on a multimodal Bedrock knowledge base return the same text hits as before, so chat, RAG and logging payloads stay unchanged. Image hits come back only when the caller sent query_image

A caller retrievalQuery now answers 400 pointing at query_image, or is dropped under drop_params, instead of replacing the built query unchecked

A file_search chat tool that carries query_image or rewrite_query searches again instead of failing, and a non-string query next to an image answers 400 instead of 500. query_image is keyword-only on search and asearch

* fix(vector-stores): redact query images and keep store search params out of image checks

* fix(vector-stores): redact images nested in extra_body and keep a store's extra_body retrievalQuery out of searches

* fix(vector_stores): keep a caller's image query through store and router params

A deployment's retrievalQuery no longer reaches a routed search, a caller's query fields survive a store's own extra_body, and an extra_body image stops before the provider. file_search forwards rewrite_query, both retrieval query spellings are redacted, and the cost error stops echoing the response when message logging is off

* fix(cost): leave image search responses out of the cost error text

* fix(vector_stores): accept line-wrapped base64 in query_image data

Bedrock takes inlineContent wrapped with \n or \r\n line breaks, as plain base64 writes it, so the check ignores only those before decoding and the data goes to Bedrock as sent

* fix(vector_stores): drop rewrite_query false from the chat file_search tool

False asks for the default search every store already runs, and MongoDB
rejects the field outright, so forwarding it made a MongoDB chat lose the
store's context for a no-op flag. True is still forwarded.

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-12 00:19:34 +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 feat(messages): serve anthropic messages on rust only (#51119) 2026-11-12 00:07:20 +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 fix(bedrock): derive the web identity session policy per AWS caller (#50592) 2026-11-08 19:13:53 +00:00
azure fix(azure): use supported API versions for Responses requests (#51116) 2026-11-11 18:53:54 +00:00
azure_ai refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
base_llm refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
baseten refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
bedrock feat(bedrock): search knowledge bases by image and return image hits (#51063) 2026-11-12 00:19:34 +00:00
bedrock_mantle fix(bedrock): forward Codex agent messages that carry encrypted content intact (#50457) 2026-11-06 17:47:43 -08: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 refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +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 feat(messages): serve anthropic messages on rust only (#51119) 2026-11-12 00:07:20 +00:00
dashscope feat(messages): serve anthropic messages on rust only (#51119) 2026-11-12 00:07:20 +00:00
databricks fix(anthropic): disable optional default thinking for reasoning effort none (#50541) 2026-11-07 12:51:37 -08: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(openai): download PDF URLs off the event loop and transform async chat messages once (#49176) 2026-11-10 16:37:00 +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 fix(audio-transcription): keep transcripts out of transcription error messages (#50137) 2026-11-05 18:07:15 -08: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 feat(videos): add first-class OpenRouter video request fields (#50319) 2026-11-06 16:50:48 -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 refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +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 feat(gemini): file-backed batch jobs on /v1/batches with output download and spend tracking (#51032) 2026-11-11 12:00:32 -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): send the GitHub token directly instead of exchanging it (#50126) 2026-11-05 09:45:17 -08: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 refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00: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 refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -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
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(openai): download PDF URLs off the event loop and transform async chat messages once (#49176) 2026-11-10 16:37:00 +00: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: add Nace Drex decisions provider (#46523) 2026-10-16 18:07:50 -07:00
nadir/chat refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
nebius
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 refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
nvidia_riva refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
oci refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
ollama refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
oobabooga refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
openai refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
openai_like refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
opencode refactor: clean up fresh tech debt in proxy auth reads, chatgpt credential forwarding, messages drop_params reads, router context signatures and spend log reads (#46643) 2026-11-04 09:09:50 +00:00
openrouter feat(openrouter): record upstream provider in logging payload and spend logs (#49287) 2026-10-30 12:51:48 -07:00
opensandbox refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
opensearch feat(proxy): add OpenSearch index pass-through with per-key read/write grants (#50573) 2026-11-09 18:54:20 +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 fix(azure): strip output-only reasoning content from Responses input (#50046) 2026-11-04 17:05:03 -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(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +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 refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00: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 refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
vertex_ai refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00: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
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 refactor(types): replace Any with proven types in 24 files (#46663) 2026-10-15 06:10:12 -07: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/.