Commit graph

51445 commits

Author SHA1 Message Date
mateo-berri
a61bceb0cf fix(files): read storage-backed managed files from their storage backend
The managed files hook's content read looped the file's model mappings and asked each deployment for the file. A file LiteLLM stored itself maps every model to its storage url, so the read sent that internal id to the upstream server, failed, and the batch rate limiter failed open: a key's TPM limit did not apply to a LiteLLM-executed batch. The hook now returns the stored bytes from the file's storage backend before it consults any deployment
2026-09-19 14:00:51 -07:00
mateo-berri
549548de62 fix(files): keep an explicit target_storage on its old path and refuse litellm_db as a caller choice
An explicit target_storage=litellm_db upload was accepted for any model, so an OpenAI model's litellm_db://<uuid> id was sent to OpenAI as input_file_id and a model-less upload left a content row nothing can read; it now answers 400 on target_storage. An explicit target_storage skips the files api probe and the purpose and single-target gates, which only decide whether LiteLLM keeps the file itself, so an azure_storage user_data upload for a vLLM model reaches the storage path again as it did before this branch. cancel_batch authorizes the model of every LiteLLM-managed batch id before it branches, the way retrieve_batch already does, so the LiteLLM-executed branch gets the check its provider sibling had. Restores the test_afile_delete_passes_trusted_model_credentials_to_router definition line an earlier commit dropped
2026-09-19 13:20:02 -07:00
mateo-berri
020cbba4dd refactor(batches): annotate the stored file row so its model import is a real use 2026-09-19 12:39:44 -07:00
mateo-berri
9f0eb5082a fix(batches): authorize executed upload targets before the files api probe
A batch upload naming a model on a LiteLLM-executed provider now checks
that the key may call that model before the upstream server is probed for
a Files API, matching the order batch create already uses. Only targets on
an executed provider are checked here, so provider-model uploads keep
their existing behavior.

File content reads and writes move out of the storage backend into
ManagedFileContentRepository, so the backend no longer queries Prisma
directly.
2026-09-19 12:26:11 -07:00
mateo-berri
03a63db1fd fix(batches): keep provider timeouts as failed rows and move batch rows behind a repository 2026-09-19 11:54:57 -07:00
mateo-berri
1aca37e513 Merge remote-tracking branch 'origin/main' into litellm_vllm_batch_runner
# Conflicts:
#	tests/test_litellm/proxy/openai_files_endpoint/test_files_common_utils.py
2026-09-19 11:51:54 -07:00
kerry-berri
fc5f6c4b50
Merge pull request #41964 from BerriAI/litellm_registry_audit_20260919
fix(model_prices): drop anthropic deprecation floors and correct azure gpt-4.1-nano retirement date
2026-09-19 11:18:32 -07:00
yucheng-berri
2542ea0320
Merge pull request #41787 from BerriAI/litellm_llm_guard_proxy_call_types
fix(llmguard): accept proxy async call types
2026-09-19 11:17:21 -07:00
yucheng-berri
2886b8ee27
Merge pull request #41939 from BerriAI/litellm_responses_missing_input_400
* fix(proxy): return 400 instead of 500 for /v1/responses without input

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

* fix(proxy): validate input before starting background responses polling

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

* fix(proxy): validate responses input after prompt template expansion

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

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 11:02:30 -07:00
yucheng
c38dda2b2f fix(llmguard): drop call types the proxy never routes through moderation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 17:57:47 +00:00
tin-berri
77a4624f13
Merge pull request #41920 from BerriAI/litellm_claude_auto_cache_providers
fix(caching): scope automatic breakpoints to supported Claude transports
2026-09-19 12:54:30 -05:00
yucheng-berri
b6758159dd
Merge pull request #41982 from BerriAI/litellm_otel_v2_langfuse_embedding_output
* fix(otel v2): summarize embedding vectors as Langfuse observation output

The v2 LLM span built its output only from response choices, so /v1/embeddings
rendered a Langfuse generation with input, usage and cost but a blank output.
Embedding calls now carry an EmbeddingOutput(count, dimensions) summary that the
Langfuse mapper serializes as the observation output, and they are exported with
the embedding observation type instead of generation. Chat and Responses output
mapping is unchanged.

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

* fix(otel v2): keep embedding observations typed as generation in Langfuse

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

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 10:53:13 -07:00
yucheng
c4d6c3046e fix(otel v2): keep embedding observations typed as generation in Langfuse
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 17:38:20 +00:00
yuneng-jiang
d0f60fcdec
Merge pull request #41985 from BerriAI/litellm_config_shadows_db_warning
feat(proxy): say when a stored setting is ignored because the config file owns it
2026-09-19 10:36:01 -07:00
Yassin Kortam
4487a9915b
Merge pull request #41915 from BerriAI/litellm_distributed_tpm_shared_redis_check
fix(router): enforce model tpm limits against shared redis usage across replicas
2026-09-19 10:22:25 -07:00
Yuneng Jiang
7353b779c2
feat(proxy): say when a stored setting is ignored because the config file owns it
The config file winning over the database was silent. An admin who had set
a value through the UI and later pinned the same key in the file saw their
stored value quietly stop applying, with nothing said at boot and nothing
said when a later write was refused.

Startup now warns once per key whose stored value differs from the file's,
naming the key and what to do about it. The refusal raised on a write to a
config-owned key carries the same sentence, so the log and the 400 read
identically, and both call out that a stored value exists and will never be
applied. The /config/update refusal gained the same detail.

Keys the file does not declare are untouched: the database still owns them,
and a stored value equal to the file's is not worth a warning.
2026-09-19 10:20:31 -07:00
yujonglee
bd82d73ca1
Merge pull request #41981 from BerriAI/litellm_rust_typed_pyo3
refactor(rust): use typed pyo3 APIs instead of getattr/import strings
2026-09-19 10:09:34 -07:00
Tin Chi Lo
2b086dc7aa fix(caching): scope automatic breakpoints to supported Claude transports 2026-09-19 09:55:38 -07:00
yujonglee
209a780992
Merge pull request #41977 from BerriAI/litellm_rust_sealed_request_textract
feat(rust): add Amazon Textract to litellm.ocr and sign provider requests after host hooks
2026-09-19 09:53:07 -07:00
yucheng
c5181f6178 fix(otel v2): summarize embedding vectors as Langfuse observation output
The v2 LLM span built its output only from response choices, so /v1/embeddings
rendered a Langfuse generation with input, usage and cost but a blank output.
Embedding calls now carry an EmbeddingOutput(count, dimensions) summary that the
Langfuse mapper serializes as the observation output, and they are exported with
the embedding observation type instead of generation. Chat and Responses output
mapping is unchanged.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 16:52:25 +00:00
Yujong Lee
619a19b8a2 refactor(rust): use typed pyo3 APIs instead of getattr/import strings
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 16:46:34 +00:00
kerry-berri
5d28684016
Merge pull request #41966 from BerriAI/litellm-providers/price-sync-azure
chore(prices): sync Azure prices: 5 models, 5 deprecated
2026-09-19 09:41:53 -07:00
Devin AI
2f1c8669ec fix(model_prices): drop anthropic "not sooner than" floors from deprecation_date
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 16:40:05 +00:00
kerry-berri
6718fd67fb
Merge pull request #41328 from BerriAI/litellm_e2e_cost_calculation_scripted_provider
test(integration): literal request/response cost tracking suite on a test-owned cost map
2026-09-19 09:40:04 -07:00
Mateo Wang
f9d4979d21
Merge pull request #41946 from BerriAI/litellm_deflake_20260919 2026-09-19 09:38:25 -07:00
yucheng
13b05af06e fix(proxy): validate responses input after prompt template expansion
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 16:34:53 +00:00
Yujong Lee
eb502824f0 fix stuff 2026-09-19 09:32:46 -07:00
berriai-litellm-provider-info-sync[bot]
196a631835
chore(prices): sync Azure prices: 5 models, 5 deprecated
azure/eu/gpt-4.1-nano: deprecation_date
azure/gpt-4.1-nano: deprecation_date
azure/gpt-4.1-nano-2025-04-14: deprecation_date
azure/us/gpt-4.1-nano: deprecation_date
azure/us/gpt-4.1-nano-2025-04-14: deprecation_date
2026-09-19 16:30:59 +00:00
yucheng
012d82d85d fix(llmguard): scan input and prompt even when messages is present
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 16:30:11 +00:00
joshua-berri
f08b787685
Merge pull request #41975 from BerriAI/litellm_fix_azure_snapshot_fallback_test
test(utils): isolate dated model fallback from pricing additions
2026-09-19 16:20:51 +00:00
Yujong Lee
c404bed9f0 feat(rust): add Amazon Textract to litellm.ocr and sign provider requests after host hooks
Add an aws_textract OCR provider on the Rust route, with no Python path. The
detect-document-text model returns plain lines and analyze-document renders
layout and tables as markdown. Both use Textract's synchronous API, so a
multi-page PDF or TIFF is rejected with an error that names the single-page
limit. A call with no region fails instead of falling back to Bedrock's default

SigV4 covers the request body, and host hooks can rewrite that body before it
is sent. litellm-http now has OutboundRequest, which serializes the body once,
shows those bytes to a RequestSigner and is the only thing a route can send.
Chat, audio transcription and OCR build it after their hooks ran, so a callback
that redacts the body still produces a valid Bedrock or Textract signature

ChatCompletionsAuth and AudioTranscriptionAuth are replaced by
litellm_auth::RequestAuth, and one helper in core turns it into a signed or
unsigned request. Audio transcription now signs only the AWS header set and
rejects a forwarded header that SigV4 computes, the same as chat

The OCR catalog routes aws_textract as Rust required, and the dispatch context
reads the provider from the model prefix so a provider scoped rule can match
2026-09-19 09:11:52 -07:00
Devin AI
e94c9eab03 Merge branch 'main' into litellm_registry_audit_20260919
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 16:06:41 +00:00
Devin AI
8f613511cf test(utils): use a synthetic snapshot date in the dated-to-undated fallback test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 16:03:42 +00:00
yujonglee
362be56bb0
Merge pull request #41969 from BerriAI/litellm_rust_settings_layers
refactor(rust): centralize layered settings resolution
2026-09-19 09:00:19 -07:00
yuneng-jiang
6ed9deb4d7
Merge pull request #41931 from BerriAI/litellm_settings_store_immutable
fix(proxy): refuse runtime writes to config-owned settings
2026-09-19 09:00:13 -07:00
Yujong Lee
0d0c63dde1 fix(rust): suppress private settings resolver lint
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 15:48:07 +00:00
Mateo Wang
638e085dba
Merge pull request #41971 from BerriAI/litellm_fix_dated_snapshot_test_exact_key
test(cost): point dated snapshot tests at a date the cost map cannot carry
2026-09-19 08:39:20 -07:00
Joshua Valluru
0e7ba74f95 test(utils): isolate dated model fallback from pricing additions 2026-09-19 08:39:02 -07:00
Yujong Lee
e2397e7dd3 fix(rust): drop http_proxy under CGI where environment names ignore case 2026-09-19 08:37:27 -07:00
Yujong Lee
1669213eb5 fix(rust): read OCR secrets from the process environment and decline when a secret manager is readable
The OCR route called back into Python's get_secret_str for every env
fallback. With no secret manager configured that is os.environ behind a GIL
hop, and with one configured it blocked a tokio worker on vault I/O and also
sent the Azure and GCP identity variables, which Python reads with os.getenv,
to the vault. The other Rust routes already read the process environment.

Read the process environment here too. When litellm would read secrets from
a secret manager, decline the Rust route so the Python route serves the call
with the vault-backed keys
2026-09-19 08:32:46 -07:00
Yujong Lee
b341d21a76 fix(rust): redact proxy credentials in Debug and build the proxy matcher once
EnvironmentProxies holds raw proxy URLs, which can carry user:password, and
it sits inside HttpSettings and HttpClientConfig, so any {:?} of those would
print the password. Derive veil's Redact like the auth crate does. NO_PROXY
stays readable because it holds no credentials.

The media fetcher also rebuilt the hyper-util matcher for every URL and
redirect hop. Build it once when the fetcher is created
2026-09-19 08:30:35 -07:00
Yujong Lee
0074b943a6 fix(rust): read proxy env vars in urllib's order
Python resolves proxies through urllib.request.getproxies_environment: the
lowercase variable wins, an empty value is unset, an empty lowercase value
clears the uppercase one, and under CGI only the uppercase HTTP_PROXY is
forgotten because a client can set it with a Proxy header. The Rust route
took the uppercase variable even when empty and dropped every proxy under
CGI, so provider calls could skip a required egress proxy
2026-09-19 08:30:11 -07:00
mateo-berri
c735cc3db1 test(cost): point dated snapshot tests at a date the cost map cannot carry
The azure row of test_get_model_info_falls_back_from_dated_snapshot_to_undated_entry used gpt-5.6-luna-2026-07-09, which main's cost map carries as an exact azure key, so the lookup returned the dated key and the required misc test job failed on main. All three dated snapshot tests now use a 2099-01-01 snapshot date, so they keep exercising the strip path whatever real snapshots the map gains
2026-09-19 08:00:12 -07:00
Yujong Lee
0a00021722 fix(rust): resolve Mistral OCR credentials in Python's env order
Python resolves the Mistral key as api_key, MISTRAL_AZURE_API_KEY, then
MISTRAL_API_KEY, and the base as api_base, MISTRAL_AZURE_API_BASE, then
the public endpoint, never reading MISTRAL_API_BASE. Native OCR read
MISTRAL_API_KEY and MISTRAL_API_BASE instead, so with the Azure pair set
it sent the call to a different endpoint with a different key. Empty env
values now fall through like Python's `or` chain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 07:33:02 -07:00
Mateo Wang
8c4c394ecc
Merge pull request #41960 from BerriAI/litellm_deepseek_off_peak_pricing
fix(cost): bill DeepSeek V4.1 Flash and V4 Pro at off-peak rates outside peak hours
2026-09-19 06:45:46 -07:00
mateo-berri
2ee8c1bd0e fix(batches): enforce the completion window and guard executed-batch id parsing 2026-09-19 06:25:42 -07:00
Devin AI
60784c9d8e fix(model_prices): update azure gpt-4.1-nano retirement date to 2027-04-14 per Microsoft schedule
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 13:17:45 +00:00
Devin AI
f5c35034ca fix(model_prices): add claude-mythos-5 deprecation date from Anthropic's model deprecations page
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-19 13:17:01 +00:00
Mateo Wang
12593788a2
Merge pull request #41949 from BerriAI/litellm_bulk_update_keys_keep_unset_fields
fix(proxy): /key/bulk_update writes only the fields each item carries
2026-09-19 06:08:54 -07:00
Mateo Wang
aa0ffee00f
Merge pull request #41423 from BerriAI/litellm_strip_dated_snapshot_cost_lookup
fix(cost): resolve dated openai/azure snapshots to their undated cost map entry
2026-09-19 05:51:46 -07:00