Commit graph

28683 commits

Author SHA1 Message Date
Sameer Kankute
d98ee8a448
Merge pull request #17872 from BerriAI/litellm_embedding_header_forwarding
fix: bedrock header forwarding with cutom api
2025-12-12 22:25:45 +05:30
Sameer Kankute
abbf8be07b
Merge pull request #17864 from BerriAI/litellm_fix_x-litellm-key-spend
Fix x-litellm-key-spend header update
2025-12-12 22:23:42 +05:30
Sameer Kankute
e0428388a7
Merge pull request #17860 from BerriAI/litellm_openai_files_expire_after_support
Add support for expires after param in Files endpoint
2025-12-12 22:23:11 +05:30
Alexsander Hamir
d196e0b9c8
refactor(router): replace time.perf_counter() with time.time() for timing measurements (#17881) 2025-12-12 08:51:18 -08:00
AlexsanderHamir
1ad6763500 fix: add PROMETHEUS_MULTIPROC_DIR to docs 2025-12-12 08:33:38 -08:00
Alexsander Hamir
d9cf53b555
fix: remove dependency on database and redis from health test (#17880) 2025-12-12 08:21:48 -08:00
Alexsander Hamir
9c39539d78
revert CI changes (#17879) 2025-12-12 08:13:18 -08:00
Alexsander Hamir
5f2f823d44
fix: use docker executor (#17878) 2025-12-12 07:56:03 -08:00
Alexsander Hamir
c9063d13b1
Add health endpoint tests to CI with database and Redis support (#17877)
- Add database and Redis setup to litellm_mapped_tests_proxy job in CircleCI
- Create shared test helpers in tests/test_litellm/proxy/conftest.py for proxy test setup
- Refactor health endpoint tests to use shared helpers from conftest
- Support automatic Redis cache configuration when REDIS_HOST is set
- Ensure minimal config is created when Redis/database is needed
2025-12-12 07:35:50 -08:00
Alexsander Hamir
762b429d6c
enhance: create_litellm_branch tool to be more robust (#17874) 2025-12-12 05:35:50 -08:00
Krish Dholakia
eab5bca583
Add Milvus REST client and update examples (#17736)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-12-12 04:38:28 -08:00
Devaj Mody
f25344484f
fix(router): add minimum request threshold for error rate cooldown (#17464)
Fixes #17418

  - Add DEFAULT_FAILURE_THRESHOLD_MINIMUM_REQUESTS constant (default: 5)
  - Require minimum requests before applying error rate cooldown
  - Prevents cooldown from triggering on first failure
2025-12-12 04:36:10 -08:00
razvan_butnaru
f6251efab9
Update proxy_server.py (#17468)
Co-authored-by: razvan9991 <57962056+razvan9991@users.noreply.github.com>
2025-12-12 04:34:43 -08:00
Ariel
5df701d15c
[feat]: Add opt-in evidence results for Pillar Security guardrail during monitoring (#17812)
* add evidence headers to litellm

* ensure that evidence is surface-able, even in opt-in mode

* update the docs
2025-12-12 04:09:13 -08:00
Peter Chanthamynavong
f8e7e153d5
fix(cache): handle string content in is_cached_message (#17853)
Fixes #17821

The `is_cached_message` function crashed with TypeError when message
content was a string instead of a list of content blocks.

Changes:
- Add explicit `isinstance(content, list)` check before iteration
- Add `isinstance(content_item, dict)` check inside loop to skip non-dict items
- Use `.get()` for safer nested dict access
- Follow same pattern as `extract_ttl_from_cached_messages` (same module)

Tests:
- Add TestIsCachedMessage class with 9 test cases covering:
  - String content (the reported bug)
  - None content
  - Missing content key
  - Empty list content
  - List with/without cache_control
  - Mixed content types (strings + dicts)
  - Wrong cache_control type
2025-12-12 03:59:52 -08:00
Vinnie Giarrusso
78012ad9a9
fix(prometheus): add 'exception_status' to prometheus logger (#17847)
* fix(prometheus): add 'exception_status' to prometheus logger

* use existing prometheuslogger

* remove unneeded test
2025-12-12 03:57:46 -08:00
nlineback
e223cadb9f
fix: add speechConfig to GenerationConfig for Gemini TTS (#17851)
Moved speechConfig from RequestBody to GenerationConfig TypedDict so that
TTS configuration survives the filtering in _transform_request_body().

This fixes the 400 INVALID_ARGUMENT error when using Gemini TTS models
(gemini-2.5-flash-tts, gemini-2.5-flash-preview-tts, etc.) with both
vertex_ai and gemini providers.

Fixes: speechConfig was being created correctly in map_openai_params()
but then filtered out because GenerationConfig.__annotations__.keys()
didn't include it.

Tested with both preview and non-preview TTS model names and both
vertex_ai and gemini providers.
2025-12-12 03:56:44 -08:00
Cesar Garcia
eb94c95e72
fix: add semver prerelease suffix to helm chart versions for non-stable releases (#17678)
Helm chart versions now include a prerelease suffix based on release_type:
- stable: 0.1.830 (no suffix)
- rc: 0.1.830-rc
- latest: 0.1.830-latest

This allows users to easily identify stable vs non-stable chart versions.
Helm also hides prerelease versions by default, preventing accidental
upgrades to non-stable versions.

Also fixes version extraction to strip existing suffixes before bumping.
2025-12-12 03:51:37 -08:00
Marty Sullivan
63df9392d4
add azure gpt-5.2 models (#17866) 2025-12-12 03:47:08 -08:00
Sameer Kankute
19b48d7bad fix: bedrock header forwarding with cutom api 2025-12-12 16:12:06 +05:30
Sameer Kankute
caaf8a6784 Fix x-litellm-key-spend update 2025-12-12 11:44:51 +05:30
yuneng-jiang
cf5dab7f52
Merge pull request #17859 from BerriAI/litellm_ui_links_rearrange
[Feature] Model Hub Useful Links Rearrange
2025-12-11 22:12:55 -08:00
yuneng-jiang
d1e53365a8 Change useful_links to include index for UI 2025-12-11 21:25:40 -08:00
Sameer Kankute
283b4c208e Fix code quality issue 2025-12-12 10:04:51 +05:30
Sameer Kankute
49e0f8e95f Add support for expires after param 2025-12-12 10:01:18 +05:30
yuneng-jiang
7ea407b239 Rearrange Links UI 2025-12-11 20:23:02 -08:00
Sameer Kankute
bdb8c169be
Merge pull request #17818 from BerriAI/litellm_openai_package_bump
bump openai package to 2.9.0
2025-12-12 08:38:22 +05:30
ryan-crabbe
4a8629ce8b
updated docs links for mistral and anthropic (#17852) 2025-12-11 17:57:56 -08:00
yuneng-jiang
4f79a026ad
Merge pull request #17854 from BerriAI/litellm_ui_usage_select
[Feature] UI - Usage Page View Select
2025-12-11 17:57:23 -08:00
yuneng-jiang
3f1473d9a2 fixing build 2025-12-11 17:49:06 -08:00
yuneng-jiang
ac52d2aeef tests 2025-12-11 17:47:11 -08:00
yuneng-jiang
dfdd74f9ac Usage View Select 2025-12-11 17:37:09 -08:00
yuneng-jiang
a48f048219
Merge pull request #17848 from BerriAI/litellm_ui_usage_refactor
[Refactor] UI - Usage Page Components
2025-12-11 16:43:11 -08:00
yuneng-jiang
0635b1cbf0 rename 2025-12-11 16:33:23 -08:00
yuneng-jiang
52cb54968a Change to useAuthorized hook 2025-12-11 16:28:03 -08:00
yuneng-jiang
c1c8a6937e Renaming + fixing tests 2025-12-11 16:11:09 -08:00
Krish Dholakia
7e58931ec1
Prompt Management - new API for integrating providers (#17829)
* Prompt Management API - new API to interact with Prompt Management integrations (no PR required) (#17800)

* feat: initial commit adding prompt management api

* feat: initial commit adding prompt management api

* fix: refactoring to make sure get prompt is async

* fix: additional fixes

* fix: partially working generic api prompt management
2025-12-11 15:43:40 -08:00
yuneng-jiang
424934296f adding all files 2025-12-11 15:40:26 -08:00
yuneng-jiang
4e20f0793f Move Usage into its own folder 2025-12-11 15:37:39 -08:00
Cesar Garcia
d693596e87
feat(langfuse): Add support for custom masking function (#17826)
* feat(langfuse): Add support for custom masking function

Allow users to pass a custom masking function via metadata to selectively
redact sensitive data (credit cards, emails, PII) before sending to Langfuse.

Usage:
```python
def mask_pii(data):
    if isinstance(data, str):
        data = re.sub(r'\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b', '[CARD]', data)
    return data

litellm.completion(
    model="gpt-4",
    messages=[...],
    metadata={"langfuse_masking_function": mask_pii}
)
```

* fix(langfuse): Isolate masking function from other logging integrations

Extract langfuse_masking_function from metadata early in the flow and store
it in a dedicated key (_langfuse_masking_function) that only the Langfuse
logger knows to look for. This prevents the callable from leaking to other
logging integrations (Datadog, S3, etc.) which would serialize it as
"<function at 0x...>".

Changes:
- scrub_sensitive_keys_in_metadata() now extracts and stores the function
- Langfuse logger looks in the dedicated key first, falls back to metadata
- Added tests to verify isolation works correctly
2025-12-11 15:36:54 -08:00
Yuge Zhang
1aed37b8ea
Fix missing content in Anthropic to OpenAI conversion (#17693) 2025-12-11 15:31:47 -08:00
jichmi
a13ee39da2
fix: update pricing for global.anthropic.claude-haiku-4-5-20251001-v1:0 (#17703)
* fix: update pricing for global.anthropic.claude-haiku-4-5-20251001-v1:0

* Update cache_creation_input_token_cost value
2025-12-11 15:29:46 -08:00
Cesar Garcia
a2f5174941
fix: use Union syntax for Python 3.9 compatibility (#17714)
Replace `str | List[str]` with `Union[str, List[str]]` in
EmbeddingInput model to support Python 3.9.

The pipe union syntax (PEP 604) is only available in Python 3.10+,
but LiteLLM supports Python >=3.9.

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2025-12-11 15:29:16 -08:00
Cesar Garcia
a037414985
feat(deepseek): add native support for thinking and reasoning_effort params (#17712)
* feat(deepseek): add native support for thinking and reasoning_effort params

Add proper parameter mapping for DeepSeek thinking mode, allowing users
to use the unified LiteLLM interface instead of extra_body workarounds.

Supported formats:
- thinking={"type": "enabled"}
- thinking={"type": "enabled", "budget_tokens": X} (budget_tokens ignored)
- reasoning_effort="low|medium|high" (maps to thinking enabled)

DeepSeek only supports {"type": "enabled"} without budget_tokens,
so any budget_tokens are stripped and all reasoning_effort values
(except "none") map to enabled.

Reference: https://api-docs.deepseek.com/guides/thinking_mode

* docs(deepseek): add thinking and reasoning_effort parameter documentation
2025-12-11 15:28:43 -08:00
Peter Chanthamynavong
df9a644e37
fix: add Python 3.14 support via grpcio version constraints (#17666)
* fix: add Python 3.14 support via grpcio version constraints

Updates grpcio dependency to support Python 3.14 while maintaining
backward compatibility:

- Python <3.14: grpcio >=1.62.3,<1.68.0 (avoids buggy 1.68.x versions)
- Python >=3.14: grpcio >=1.75.0 (has cp314 wheels + bug fix)

The grpc/grpc#38290 bug was fixed in grpcio 1.75.0+, which also
added Python 3.14 wheel support.

Fixes #15504
Fixes #17374

* chore: regenerate poetry.lock

Update lock file to match pyproject.toml changes for grpcio
Python 3.14 conditional dependency.
2025-12-11 15:24:48 -08:00
Jason Roberts
6fc39d31b4
feat(guardrails): add configurable fail-open, timeout, and app_user to PANW Prisma AIRS guardrail (#17785)
Add configurable fail-open/fail-closed behavior, timeout settings, and app_user
metadata tracking. Includes security hardening, enhanced
observability (:unscanned header), and comprehensive test coverage (44/44 passing).

No breaking changes.
2025-12-11 15:23:59 -08:00
Ishaan Jaff
cca21c0926
[Feat] New API Provider - Add Azure AI Foundry Agents on /chat/completions, /responses, /messages + Agent Gateway (#17845)
* init get_azure_ai_route

* init AzureAIAgentsConfig

* init AzureAIAgentsConfig

* AzureAIAgentsHandler

* test_azure_ai_agents_acompletion_non_streaming

* test_azure_ai_agents_acompletion_streaming

* fix stream

* _process_sse_stream

* Azure AI Foundry Agents

* init  Azure AI Foundry Agent

* fix code QA checks

* fix api key

* docs fix
2025-12-11 15:21:28 -08:00
Ishaan Jaff
8041e373d6
[Bug Fix] Watsonx Audio Transcription - ensure only correct params are sent to API (#17840)
* fix transform

* test_watsonx_transcription_only_user_params_sent
2025-12-11 15:21:09 -08:00
yuneng-jiang
cb9bae1aba
Merge pull request #16764 from BerriAI/litellm_tag_spend_dedupe
[Fix] Deduplicate /tag/daily/activity metadata
2025-12-11 15:20:16 -08:00
Dominic Fallows
756c60540e
feat: add support for configurable confidence score thresholds and scope in Presidio PII masking (#17817)
* feat: add support for configurable confidence score thresholds in Presidio PII masking

* feat: enhance Presidio PII masking with configurable score thresholds and behavior documentation

* feat: add configurable output masking and filter scope for Presidio PII guardrail
2025-12-11 15:19:11 -08:00