Commit graph

11559 commits

Author SHA1 Message Date
yucheng
09dfd7e50d feat(langfuse): honour caller generation ids and assert v4 OTLP exports in legacy tests
Some checks are pending
ai-gateway image / ai-gateway release image (push) Waiting to run
LiteLLM Rust / rust-lint (push) Waiting to run
LiteLLM Rust / rust-test (push) Waiting to run
Terraform Modules / fmt, validate, test (aws) (push) Waiting to run
Terraform Modules / fmt, validate, test (gcp) (push) Waiting to run
Terraform Provider / gofmt, vet, build, test (push) Waiting to run
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Waiting to run
v2 accepted generation(id=...). v4 derives the observation id from the OTel
span id, so the isolated tracer provider now carries an id generator that
hands out the id start_generation asked for through a context variable, and
the callback passes the resolved generation_id metadata into it.

The legacy e2e suite patched httpx.Client.post and compared v2 ingestion
batches; it now patches requests.Session.post, decodes the OTLP protobuf
and compares the exported generation against regenerated fixtures. The
local readback test replaces the removed get_generations() with
api.observations.get_many() and polls Langfuse Cloud instead of sleeping.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 23:12:03 +00:00
yucheng
124ac5e8dd fix(langfuse): hash all-zero trace and observation ids instead of passing them through
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 22:15:10 +00:00
yucheng
a9cb8070ce test(slack): cover the langfuse trace url built from the logger host
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 21:31:38 +00:00
yucheng
a7333ff00d refactor(langfuse): type the slack trace-url lookup and drop dead v2 test shims
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 21:23:39 +00:00
yucheng
c37e2488de feat(langfuse): migrate the sdk callback to langfuse v4
Replace the v2 trace()/generation()/span() calls with SDK v4 observations exported over OpenTelemetry, with one isolated tracer provider per Langfuse credential set, a discarding exporter for mock mode, and v4 trace and observation id normalization. Keeps the session-header trace provenance logic from main so each call under a session alias still gets its own trace

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 21:14:31 +00:00
Yassin Kortam
4123b4bc2b
Merge pull request #41086 from BerriAI/litellm_team_list_org_admin_membership_lit3723
fix(proxy): keep org admins' own team memberships in other orgs visible on team list
2026-09-14 13:57:08 -07:00
Yassin Kortam
ee03bad8c6
Merge pull request #41064 from BerriAI/litellm_bedrock_realtime_propagate_provider_failures
fix(bedrock/realtime): propagate deferred Nova Sonic stream failures to the router
2026-09-14 13:56:26 -07:00
tin-berri
2cad7a49af
Merge pull request #41116 from BerriAI/litellm_auto_router_session_api_access
fix(proxy): allow LLM API keys to read auto-router sessions
2026-09-14 13:49:03 -07:00
Yassin Kortam
161ae2f3b4
Merge pull request #41107 from BerriAI/litellm_hide_credentials_hint_when_ui_password_set
fix(proxy): hide default credentials login hint when UI_PASSWORD is set
2026-09-14 13:44:09 -07:00
Yassin Kortam
97ddb9494e
Merge pull request #40930 from BerriAI/litellm_flat_retry_records
fix(router): record flat retry attempts and cap retries from attempted_retries
2026-09-14 13:37:10 -07:00
Tin Chi Lo
3177c37e22 fix(cli): show routed models and session stats for LLM API keys 2026-09-14 13:36:00 -07:00
Yassin Kortam
856aedd14a
Merge pull request #40817 from BerriAI/litellm_redis_timeout_log_throttle
fix(redis): log a timeout streak once per interval instead of one line per cache call
2026-09-14 13:34:45 -07:00
Yassin Kortam
ab09abc3c8
Merge pull request #41115 from BerriAI/litellm_fix_wrapper_async_double_sync_success_handler_main
fix(utils): stop wrapper_async submitting the sync success handler twice
2026-09-14 13:28:16 -07:00
Yassin Kortam
963522207d
Merge pull request #41114 from BerriAI/litellm_model_info_skip_jsonable_encoder_main
perf(proxy): serialize /model/info listing once with orjson
2026-09-14 13:28:06 -07:00
yassin
a4e34d6e1b test(caching): wrap the DualCache fixture line to the 120 character limit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 20:05:14 +00:00
yassin
bea22df6c2 fix(caching): keep generic add_cache failures at ERROR unless the backend is Redis
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:59:10 +00:00
yassin
845596063d fix(prometheus): label pre-call rate limit failures with the resolved api_provider
Pre-call limiters reject before a deployment is attached to request_data, so
the failure hook could not resolve api_provider for router aliases and emitted
api_provider="None" on litellm_proxy_failed_requests_metric_total and
litellm_proxy_total_requests_metric_total. Fall back to the provider the
limiter already resolved onto RateLimitError.llm_provider, keeping request
data as the first source and ignoring the proxy placeholder.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:50:21 +00:00
yassin
39f6ac4788 perf(proxy): serialize /model/info listing once with orjson
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:47:51 +00:00
yassin
d13e8dcae2 fix(utils): stop wrapper_async submitting the sync success handler twice
_client_async_logging_helper re-submitted logging_obj.success_handler to the
executor after _dispatch_success_logging had already done so, running the same
success pipeline twice per async request and racing on shared logging state.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:47:43 +00:00
Yassin Kortam
b94b8bca21
Merge pull request #41096 from BerriAI/litellm_disable_access_log_paths
feat(proxy): honor LITELLM_DISABLE_ACCESS_LOG_PATHS to drop noisy uvicorn access log lines
2026-09-14 12:41:34 -07:00
Yassin Kortam
f67cc62032
Merge pull request #40995 from BerriAI/litellm_all_deployments_cooldown_error
fix(router): name the all-deployments-in-cooldown error on 429 responses
2026-09-14 12:39:42 -07:00
yassin
c4354c248a fix(redis): route the per-TTL pipeline write timeout log through the shared throttle
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:38:14 +00:00
Yassin Kortam
7c55c4ba7d
Merge pull request #40925 from BerriAI/litellm_proxy_error_headers_from_litellm_response_headers
fix(proxy): forward provider request id headers on mapped error responses
2026-09-14 12:36:59 -07:00
Yassin Kortam
d541792b30
Merge pull request #41106 from BerriAI/litellm_allowed_file_extensions
feat(proxy): add general_settings.allowed_file_extensions for /v1/files uploads
2026-09-14 12:34:19 -07:00
yassin
f9d0cd6409 chore(proxy): drop explanatory docstrings from credentials hint helper and tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:29:30 +00:00
yassin
53c8a82a31 Merge remote-tracking branch 'origin/main' into pr-40817
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	litellm/caching/redis_cache.py
#	litellm/proxy/proxy_server.py
#	tests/test_litellm/caching/test_redis_cache.py
2026-09-14 19:11:03 +00:00
yassin
771430df7b fix(bedrock/realtime): keep partial spend on cancelled output task and make the committed-session refusal non-retryable
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:07:21 +00:00
yassin
5c04ec2b93 fix(bedrock/realtime): keep the pending session.update until a provider stream is committed
Peek at the pending session.update instead of popping it, so an eager fallback failure before the bridge starts does not lose the replay for the next attempt. Move the websocket scope keys to constants.py

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:07:20 +00:00
yassin
cb5d901774 fix(bedrock/realtime): propagate deferred Nova Sonic stream failures to the router
Bedrock realtime caught every exception inside both forwarding tasks and
gathered them with return_exceptions=True, so a provider failure surfacing
after the websocket handshake (lazy duplex stream: 503/429/validation only
show up on await_output or the input publisher) made async_realtime return
normally and the router recorded a success instead of running fallbacks and
cooldown accounting. session.updated is now acked only after Bedrock is
ready, provider failures escape as BedrockError with the AWS status code,
a failure after the client disconnected is not reported as a provider
failure, and a fallback attempt on the same websocket replays the pending
session.update instead of emitting a second session.created.

Resolves LIT-6484

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:07:20 +00:00
yassin
ba171d9eb4 fix(proxy): hide default credentials login hint when UI_PASSWORD is set
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:06:04 +00:00
yassin
ce0301c23f refactor(proxy): drop redundant docstrings from upload allowlist helpers and tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 19:00:49 +00:00
yucheng-berri
cae4a65545
Merge pull request #40562 from BerriAI/litellm_otel_openinference_message_cap
fix(otel): cap per-index OpenInference message attributes span-wide
2026-09-14 11:55:37 -07:00
yassin
82ef6ea6ab feat(proxy): add general_settings.allowed_file_extensions for /v1/files
Opt-in allowlist for upload filename extensions, checked before the existing blocked_file_extensions blocklist and mapped through the same upload validation failure path. None keeps today's behaviour, [] rejects every upload, matching is case-insensitive on both sides, and a filename with no extension is rejected when the allowlist is set.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 18:53:29 +00:00
Mateo Wang
cab1e113f7
Merge pull request #40976 from BerriAI/litellm_azure_gpt_chat_latest_pricing
feat(pricing): add azure gpt-chat-latest rates and drop retired friendliai llama-3.1 entries
2026-09-14 11:21:20 -07:00
Yassin Kortam
08a78a3982
Merge pull request #41054 from BerriAI/litellm_gate_correlation_contextvar_stamp
perf(logging): skip correlation contextvar stamping when request_correlation_in_logs is off
2026-09-14 11:14:44 -07:00
Mateo Wang
6e9e08475a
Merge pull request #40627 from BerriAI/litellm_fix_realtime_cached_audio_cost
fix(cost): bill cached realtime audio tokens at the audio cache-read rate
2026-09-14 10:50:00 -07:00
yucheng
34e702c571 test(otel): build the clipped-blob conversation without mutating the payload
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 17:46:18 +00:00
yassin
83d16a4690 fix(proxy): read LITELLM_DISABLE_ACCESS_LOG_PATHS per record and match before redaction
Values loaded after import via proxy config environment_variables or dotenv
were ignored, and a long query string was truncated by the redaction filter
before the path filter could match it. Tests now go through the production
registration on the uvicorn.access logger instead of a hand-built filter.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 17:27:43 +00:00
Devin AI
66ce1eea97 test(proxy): cover non-string access log paths
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:54:38 +00:00
yassin
4b39344d13 fix(proxy): only treat a missing user as no memberships on team list, surface db errors
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:49:54 +00:00
Devin AI
2268bbaf5e feat(proxy): honor LITELLM_DISABLE_ACCESS_LOG_PATHS to drop noisy uvicorn access log lines
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:39:54 +00:00
yassin
dc30be006b refactor(proxy): read org admin's own team ids via get_user_object(check_db_only=True)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:27:31 +00:00
yassin
d643909789 fix(proxy): read org admin's own team ids from db and assert v2 list results
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:03:23 +00:00
yassin
8d9edfc03c fix(proxy): keep /team/list self query for org admins membership-only across orgs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 15:40:41 +00:00
yassin
58c3ccf668 fix(proxy): keep org admins' own team memberships in other orgs visible on team list
An org admin listing their own teams on GET /team/list and GET /v2/team/list
only saw teams in the orgs they administer. Teams they belong to in other
orgs were dropped because the org scope and the membership scope were ANDed.
A self query now unions the two, while a query for another user keeps the
org boundary intersection.

Resolves LIT-3723

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 15:27:06 +00:00
Devin AI
a70f9a17cc perf(logging): skip correlation contextvar stamping when request_correlation_in_logs is off
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 08:54:34 +00:00
yassin
e61b6bfd5f fix(router): classify pass-through cooldown against pass-through deployments only
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 09:48:35 +00:00
yassin
10f411e60d fix(router): name the all-deployments-in-cooldown error on 429 responses
RouterRateLimitError now carries the model group's deployment ids so it
can tell when every deployment is cooled down, and exposes that as
type=all_deployments_in_cooldown with an explicit message. A partial
cooldown keeps type=rate_limit_error. Either way the proxy no longer
reports type=internal_server_error next to code 429

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 09:34:16 +00:00
mateo-berri
76ae35dfcd fix(types): break the CachedTokensDetails import cycle
CodeQL flagged two module-level cyclic imports introduced by defining
CachedTokensDetails in litellm.types.llms.openai and importing it from
litellm.types.utils and litellm.cost_calculator. The class now lives in
litellm.types.llms.base, which imports nothing from litellm, and every
user imports it from there.

Also pins that combining realtime usages where only one response.done
carries cached_tokens_details keeps the earlier modality split in both
orders, and commits the regenerated dashboard API types.
2026-09-13 01:14:35 -07:00
mateo-berri
4c022a3089 feat(pricing): add azure gpt-chat-latest global and data zone rates 2026-09-12 23:34:12 -07:00