Commit Graph
32023 Commits
Author SHA1 Message Date
e2fa31edce feat(ui): add license expiration display to usage indicator (#20763)
* feat(ui): add license expiration display to usage indicator

- Add getLicenseInfo() function to networking.tsx that calls /health/license
- Display license expiration as human-readable 'X days remaining' or 'Expires in X months'
- Show warning styling (yellow) if license expires in < 30 days
- Show error styling (red) if license is expired
- Fetch license info in parallel with usage data for efficiency
- Include license type display in expanded card view
- Compact UI suitable for sidebar widget

* fix: timezone mismatch in license expiration calculation

Addresses Greptile review feedback - forces UTC midnight for expiration
date and normalizes current date to local midnight to prevent off-by-one
errors in days remaining calculation.

---------

Co-authored-by: Shin <shin@openclaw.dev>
2026-02-11 15:46:33 +05:30
f32f8ebf70 fix(bedrock): accept AWS_CONTAINER_CREDENTIALS_FULL_URI in validate_environment
ECS/Fargate supports both RELATIVE_URI and FULL_URI credential delivery.
Only RELATIVE_URI was checked, causing false "missing keys" reports for
FULL_URI setups even though boto3 can authenticate fine.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-11 15:45:47 +05:30
6fdfdd27b5 fix(bedrock): address review - cross-account, SSL verify, narrow fallback
1. Cross-account false match: Added _parse_arn_account_and_role_name()
   helper that compares partition + account ID + role name (not just
   role name) to prevent same-name-different-account false matches.

2. SSL verify: _is_already_running_as_role() now passes ssl_verify to
   the STS client via self._get_ssl_verify(), consistent with all other
   boto3 client creation in this module.

3. Overbroad AccessDenied fallback: The catch in _auth_with_aws_role now
   only falls back to ambient credentials when _is_already_running_as_role
   positively confirms the caller is the target role. Genuine trust-policy
   or permission misconfigurations are re-raised.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-11 15:45:47 +05:30
70a1bf92e2 fix(bedrock): skip AssumeRole when ECS/EC2 already running as target IAM role
When aws_role_name is configured but the environment (ECS task role, EC2 instance
profile) is already running as that role, AssumeRole is unnecessary and can fail
with AccessDenied. This adds same-role detection for ECS/EC2 (extending existing
IRSA support) and a fallback to ambient credentials when AssumeRole returns
AccessDenied.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-11 15:45:47 +05:30
mubashir1osmaniandSameer Kankute 2b9b5302ef add test for dynamic project name in metadata 2026-02-11 15:45:47 +05:30
mubashir1osmaniandSameer Kankute d1c6e25723 added tests 2026-02-11 15:45:47 +05:30
mubashir1osmaniandSameer Kankute b3fea9e983 check for typeddict 2026-02-11 15:45:46 +05:30
a422e8b9c9 fix(arize): allow OTEL and Arize Phoenix/Arize tracing to coexist in parallel
Arize Phoenix and Arize loggers now create dedicated TracerProviders
instead of fighting over the global singleton, and the otel callback
dedup check no longer incorrectly matches Arize subclasses.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-11 15:45:46 +05:30
40aeda7a0a fix(arize-phoenix): dynamic project naming from metadata + guardrails on image generation
- Allow per-request Phoenix project name via `metadata.phoenix_project_name`, falling back to PHOENIX_PROJECT_NAME env var
- Add missing `post_call_success_hook` to `/images/generations` endpoint so guardrails and OTEL tracing apply to image generation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-11 15:45:46 +05:30
Harshit JainandSameer Kankute 95a8c2550c fix: handles edge case which are blocked by Lock (#20451) litellm_dev-test-v0 2026-02-11 15:45:46 +05:30
6bedc7decd fix(proxy): return early instead of raising ValueError when standard_logging_payload is missing (#20851)
* fix: Preserved nullable object fields by carrying schema properties

* Fix: _convert_schema_types

* Fix all mypy issues

* Add alert about email notifications

* fixing tests

* extending timeout for long running tests

* Text changes

* [Feat] MCP Oauth2 Fixes - Add support for MCP M2M Oauth2 support (#20788)

* add has_client_credentials

* MCPOAuth2TokenCache

* init MCP Oauth2 constants

* MCPOAuth2TokenCache

* resolve_mcp_auth

* test fixes

* docs fix

* address greptile review: min TTL, env-configurable constants, tests, docs

- Fix zero-TTL edge case: floor at MCP_OAUTH2_TOKEN_CACHE_MIN_TTL (10s)
- Make all MCP OAuth2 constants env-configurable via os.getenv()
- Move test file to follow 1:1 mapping convention (test_oauth2_token_cache.py)
- Add MCP OAuth doc page (mcp_oauth.md) with M2M and PKCE sections
- Update FAQ in mcp.md to reflect M2M support
- Add E2E test script and config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix mypy lint

* fix oauth2

* remove old files

* docs fix

* address greptile comments

* fix: atomic lock creation + validate JSON response shape

- Use dict.setdefault() for atomic per-server lock creation
- Add isinstance(body, dict) check before accessing token response fields

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: replace asserts with proper guards, wrap HTTP errors with context

- Replace `assert` statements with `if/raise ValueError` (asserts can be
  disabled with python -O in production)
- Wrap `httpx.HTTPStatusError` to provide a clear error message with
  server_id and status code
- Add tests for HTTP error and non-dict JSON response error paths
- Remove unused imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* [UI] M2M OAuth2 UI Flow  (#20794)

* add has_client_credentials

* MCPOAuth2TokenCache

* init MCP Oauth2 constants

* MCPOAuth2TokenCache

* resolve_mcp_auth

* test fixes

* docs fix

* address greptile review: min TTL, env-configurable constants, tests, docs

- Fix zero-TTL edge case: floor at MCP_OAUTH2_TOKEN_CACHE_MIN_TTL (10s)
- Make all MCP OAuth2 constants env-configurable via os.getenv()
- Move test file to follow 1:1 mapping convention (test_oauth2_token_cache.py)
- Add MCP OAuth doc page (mcp_oauth.md) with M2M and PKCE sections
- Update FAQ in mcp.md to reflect M2M support
- Add E2E test script and config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix mypy lint

* fix oauth2

* ui feat fixes

* test M2M

* test fix

* ui feats

* ui fixes

* ui fix client ID

* fix: backend endpoints

* docs fix

* fixes greptile

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* [Fix] prevent shared backend model key from being polluted by per-deployment custom pricing (#20679)

* bug: custom price override for models

* added associated test

* fix(mcp): resolve OAuth2 root endpoints returning "MCP server not found" (#20784)

When MCP SDK hits root-level /register, /authorize, /token without
server name prefix, auto-resolve to the single configured OAuth2
server. Also fix WWW-Authenticate header to use correct public URL
behind reverse proxy.

* Add support for langchain_aws via litellm passthrough

* fix(proxy): return early instead of raising ValueError when standard_logging_payload is missing

The `_PROXY_VirtualKeyModelMaxBudgetLimiter.async_log_success_event` hook
raises `ValueError` when `standard_logging_payload` is `None`.  This breaks
non-standard call types (e.g. vLLM `/classify`) that do not populate the
payload, and the resulting exception disrupts downstream success callbacks
like Langfuse.

Return early with a debug log instead, matching the existing pattern used
for missing `user_api_key_model_max_budget`.

Fixes #18986

---------

Co-authored-by: Sameer Kankute <sameer@berri.ai>
Co-authored-by: yuneng-jiang <yuneng.jiang@gmail.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Shivam Rawat <161387515+shivamrawat1@users.noreply.github.com>
Co-authored-by: michelligabriele <gabriele.michelli@icloud.com>
2026-02-11 15:45:46 +05:30
f77eeba186 fix: redaction headers ignored when sent via proxy (#20740)
* fix: redaction headers ignored when sent via proxy

When requests go through the proxy, `litellm_params["litellm_metadata"]`
is always set (even when `None`), so `get_metadata_variable_name_from_kwargs`
always returns "litellm_metadata". The redaction code then reads `None`
instead of the actual metadata dict that contains the headers.

Add a fallback to read from `metadata` when `litellm_metadata` is not a
dict, so `x-litellm-enable-message-redaction` and related headers work
correctly in the proxy flow.

Fixes #20739

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: normalize non-dict metadata after fallback in redact_messages

After falling back from litellm_metadata to metadata, ensure the value
is always a dict so .get("headers") never raises on None/non-dict inputs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:44:37 +05:30
Emerson GomesandSameer Kankute 8f242c42a1 fix(batch_completion): submit all model futures before waiting (#20705)
* fix(batch_completion): submit all model futures before waiting

* test: add batch_completion all responses concurrency regression

* fix(batch_completion): continue collecting responses on per-model failures

* fix(batch_completion): handle empty and string models in all responses

* test(batch_completion): avoid blocking wait in concurrency regression
2026-02-11 15:44:37 +05:30
shin-bot-litellmandGitHub d9c69ae9e5 docs: add Greptile review requirement to PR template (#20762) 2026-02-10 22:08:04 -08:00
yuneng-jiangandGitHub d050404393 Merge pull request #20910 from BerriAI/litellm_ui_hide_usage_modal
[Feature] UI - Navbar: Option to hide Usage Popup
2026-02-10 20:07:40 -08:00
yuneng-jiangandGitHub dc8934cf96 Merge pull request #20908 from BerriAI/litellm_ui_login_sso_redir
[Feature] UI - Login: New Login With SSO Button
2026-02-10 20:07:24 -08:00
Sameer KankuteandGitHub bb53e9dd2e Merge pull request #20548 from kelvin-tran/kt/anthropic-opus-4-6-structured-outputs
feat: enable support for non-tool structured outputs on Anthropic Claude Opus 4.5 and 4.6 (use `output_format` param)
2026-02-11 09:22:57 +05:30
Ishaan Jaffer f29165561f fix linting 2026-02-10 19:28:04 -08:00
2913db783e feat: add dashscope/qwen3-max model with tiered pricing (#20919)
Add support for Alibaba Cloud's Qwen3-Max model with:
- 258K input tokens, 65K output tokens
- Tiered pricing based on context window usage (0-32K, 32K-128K, 128K-252K)
- Function calling and tool choice support
- Reasoning capabilities enabled

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 18:53:32 -08:00
3407006120 [Docs] Add docs guide for using policies (#20914)
* init schema with TAGS

* ui: add policy test

* resolvePoliciesCall

* add_policy_sources_to_metadata + headers

* types Policy

* preview Impact

* def _describe_match_reason(

* match based on TAGs

* TestTagBasedAttachments

* test fixes

* add policy_resolve_router

* add_guardrails_from_policy_engine

* TestMatchAttribution

* refactor

* fix

* fix: address Greptile review feedback on policy resolve endpoints

- Track unnamed keys/teams as separate counts instead of inflating
  affected_keys_count with duplicate "(unnamed key)" placeholders.
  Added unnamed_keys_count and unnamed_teams_count to response.
- Push alias pattern matching to DB via _build_alias_where() which
  converts exact patterns to Prisma "in" and suffix wildcards to
  "startsWith" filters.
- Gate sync_policies_from_db/sync_attachments_from_db behind
  force_sync query param (default false) to avoid 2 DB round-trips
  on every /policies/resolve request.
- Remove worktree-only conftest.py that cleared sys.modules at import
  time — no longer needed since code moved to main repo.
- Rename MAX_ESTIMATE_IMPACT_ROWS → MAX_POLICY_ESTIMATE_IMPACT_ROWS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: eliminate duplicate DB queries and fix header delimiter ambiguity

- Fetch teams table once in estimate_attachment_impact and reuse for
  both tag-based and alias-based lookups (was querying teams twice when
  both tag_patterns and team_patterns were provided).
- Convert tag/team filter functions from async DB queries to sync
  filters that operate on pre-fetched data (_filter_keys_by_tags,
  _filter_teams_by_tags).
- Fix comma ambiguity in x-litellm-policy-sources header: use '; '
  as entry delimiter since matched_via values can contain commas.
- Use '+' as the within-value separator in matched_via reason strings
  (e.g. "tag:healthcare+team:health-team") to avoid conflict with
  header delimiters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs v1 guide with UI imgs

* docs fix

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:52:31 -08:00
Harshit JainandGitHub bc0622692d fix: type error & better error handling (#20689) 2026-02-10 18:33:57 -08:00
Ishaan JaffGitHubClaude Opus 4.6greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
f83620157e [Feat] Policies - Allow connecting Policies to Tags, Simulating Policies, Viewing how many keys, teams it applies on (#20904)
* init schema with TAGS

* ui: add policy test

* resolvePoliciesCall

* add_policy_sources_to_metadata + headers

* types Policy

* preview Impact

* def _describe_match_reason(

* match based on TAGs

* TestTagBasedAttachments

* test fixes

* add policy_resolve_router

* add_guardrails_from_policy_engine

* TestMatchAttribution

* refactor

* fix

* fix: address Greptile review feedback on policy resolve endpoints

- Track unnamed keys/teams as separate counts instead of inflating
  affected_keys_count with duplicate "(unnamed key)" placeholders.
  Added unnamed_keys_count and unnamed_teams_count to response.
- Push alias pattern matching to DB via _build_alias_where() which
  converts exact patterns to Prisma "in" and suffix wildcards to
  "startsWith" filters.
- Gate sync_policies_from_db/sync_attachments_from_db behind
  force_sync query param (default false) to avoid 2 DB round-trips
  on every /policies/resolve request.
- Remove worktree-only conftest.py that cleared sys.modules at import
  time — no longer needed since code moved to main repo.
- Rename MAX_ESTIMATE_IMPACT_ROWS → MAX_POLICY_ESTIMATE_IMPACT_ROWS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: eliminate duplicate DB queries and fix header delimiter ambiguity

- Fetch teams table once in estimate_attachment_impact and reuse for
  both tag-based and alias-based lookups (was querying teams twice when
  both tag_patterns and team_patterns were provided).
- Convert tag/team filter functions from async DB queries to sync
  filters that operate on pre-fetched data (_filter_keys_by_tags,
  _filter_teams_by_tags).
- Fix comma ambiguity in x-litellm-policy-sources header: use '; '
  as entry delimiter since matched_via values can contain commas.
- Use '+' as the within-value separator in matched_via reason strings
  (e.g. "tag:healthcare+team:health-team") to avoid conflict with
  header delimiters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update litellm/proxy/policy_engine/policy_resolve_endpoints.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-10 17:50:37 -08:00
Alexsander HamirandGitHub b7993b14cf Add semgrep & Fix OOMs (#20912) 2026-02-10 17:50:14 -08:00
yuneng-jiang 9a418443d1 Add banner notifying of breaking change 2026-02-10 17:37:06 -08:00
shin-bot-litellmGitHubIshaan Jaffgreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
26d561081b fix(cloudzero): update CBF field mappings per LIT-1907 (#20906)
* fix(cloudzero): update CBF field mappings per LIT-1907

Phase 1 field updates for CloudZero integration:

ADD/UPDATE:
- resource/account: Send concat(api_key_alias, '|', api_key_prefix)
- resource/service: Send model_group instead of service_type
- resource/usage_family: Send provider instead of hardcoded 'llm-usage'
- action/operation: NEW - Send team_id
- resource/id: Send model name instead of CZRN
- resource/tag:organization_alias: Add if exists
- resource/tag:project_alias: Add if exists
- resource/tag:user_alias: Add if exists

REMOVE:
- resource/tag:total_tokens: Removed
- resource/tag:team_id: Removed (team_id now in action/operation)

Fixes LIT-1907

* Update litellm/integrations/cloudzero/transform.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix: define api_key_alias variable, update CBFRecord docstring

- Fix F821 lint error: api_key_alias was used but not defined
- Update CBFRecord docstring to reflect LIT-1907 field mappings
- Remove unused Optional import

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-10 17:33:16 -08:00
yuneng-jiang 97957ae9a3 option to hide usage indicator 2026-02-10 17:21:41 -08:00
yuneng-jiang e86d7f59c6 new login with sso button in login page 2026-02-10 17:04:52 -08:00
yuneng-jiangandGitHub c68383068a Merge pull request #20803 from BerriAI/litellm_ui_e2e_02
[Infra] UI - E2E Tests: Key Delete, Regenerate, and Update TPM/RPM Limits
2026-02-10 17:02:37 -08:00
yuneng-jiangandGitHub a8b4b4ccba Merge pull request #20894 from BerriAI/litellm_ui_chart_fix_02
[Fix] UI - Usage: Request Chart stack variant
2026-02-10 16:32:04 -08:00
yuneng-jiangandGitHub 2730e91356 Merge pull request #20898 from BerriAI/litellm_config_pt_endpoints
[Feature] Include Config Defined Pass Through Endpoints
2026-02-10 16:31:36 -08:00
yuneng-jiangandGitHub df37bc1900 Merge pull request #20796 from BerriAI/litellm_guardrail_list_sec
[Fix] /v2/guardrails/list Returns Sensitive Values
2026-02-10 16:31:16 -08:00
yuneng-jiang cfd261d679 Split e2e ui testing for browser 2026-02-10 16:30:31 -08:00
Alexsander HamirandGitHub ebce0e5f8c [Release - 02/10/2026] v1.81.10-nightly 2026-02-10 16:26:30 -08:00
michelligabrieleandGitHub 8507df483c fix(router): propagate model-level tags from config to SpendLogs (#20769) 2026-02-10 15:52:52 -08:00
yuneng-jiang 39bf5b780b addressing comments 2026-02-10 15:29:07 -08:00
Ishaan Jaffer f311fba194 fix 2026-02-10 15:24:46 -08:00
Ishaan JaffandGitHub f8619e2000 [Stability] Investigate + fix issue where model cost map became poorly formatted (#20895)
* init: GetModelCostMap

* fix

* docs

* docs fix

* docs fixes

* docs fix

* test model cost map resilience

* MODEL_COST_MAP_MIN_MODEL_COUNT

* validate_model_cost_map

* test_should_have_minimum_models_in_backup

* docs fix

* docs fix

* fix

* dos fix

* docs fix

* docs fix

* docs fix

* docs fix

* validate_model_cost_map

* fix

* cleanup
2026-02-10 15:17:01 -08:00
yuneng-jiang e002d6afe8 addressing comments 2026-02-10 15:16:18 -08:00
Krish DholakiaandGitHub 10d891a365 Guardrails - add logging to all unified_guardrails + link to custom code guardrail templates (#20900)
* feat(guardrail_hooks/): add guardrail logging to all unified guardrails

ensures unified guardrails use the 'log_guardrail_information' decorator for logging

* fix(custom_guardrail.py): don't log inputs on guardrail response - just emit state

* refactor: don't double log bedrock guardrail information

* feat: add in-product nudges for contributing + trying community custom code guardrails

allows users to contribute / share custom code guardrails
2026-02-10 15:13:54 -08:00
yuneng-jiang fc0563fab3 get pass through include config defined pass through 2026-02-10 14:55:37 -08:00
Emerson GomesandGitHub a6f90586ac feat(model-db): add azure_ai/kimi-k2.5 pricing entry (#20896) 2026-02-10 14:46:40 -08:00
yuneng-jiang 79b24c8f25 remove stack from charts 2026-02-10 14:11:55 -08:00
yuneng-jiangandGitHub 9f8878ee17 Merge pull request #20893 from BerriAI/pypi_fix_feb10
[Infra] CI/CD - Fix PyPI CI Step
2026-02-10 14:01:05 -08:00
yuneng-jiang 7d2c874434 Fixing ci pypi build 2026-02-10 13:59:48 -08:00
yuneng-jiang ea38630e7c bump: version 0.4.33 → 0.4.34 2026-02-10 13:58:57 -08:00
yuneng-jiangandGitHub b7107ab803 Merge pull request #20892 from BerriAI/litellm_ui_spend_logs_model
[Feature] UI - Spend Logs: Paginated Searchable Model Select
2026-02-10 13:51:53 -08:00
yuneng-jiang 3fe1c1ba24 fixing build 2026-02-10 12:53:51 -08:00
yuneng-jiang 7fd8c0e160 Searchable Paginated Model Select For Spend Logs 2026-02-10 12:44:38 -08:00
michelligabrieleandGitHub 3bbc25a3f0 fix(aiohttp): respect ssl_verify with shared sessions (#20349)
* fix(aiohttp): respect ssl_verify with shared sessions

* fix(aiohttp): resolve mypy error for ssl parameter type

Pass ssl kwarg conditionally to aiohttp request() only when explicitly
configured, since None is not a valid value for the ssl parameter
(expected SSLContext | bool | Fingerprint).
2026-02-10 10:17:35 -08:00
michelligabrieleandGitHub 1afe3032fd fix(otel): auto-infer otlp_http exporter when endpoint is configured (#20438)
When OpenTelemetry is configured via the UI, only OTEL_ENDPOINT and
OTEL_HEADERS are set, but OTEL_EXPORTER is not specified. This caused
the exporter to default to "console", meaning traces were printed to
stdout instead of being sent to the configured endpoint.

This fix adds logic in OpenTelemetryConfig.__post_init__ to automatically
infer "otlp_http" as the exporter when an endpoint is specified but the
exporter is still the default "console".

Fixes issue reported by Elastic team where traces weren't being sent
to their OTEL endpoint when configured through the LiteLLM UI.
2026-02-10 09:33:16 -08:00