Commit Graph
26907 Commits
Author SHA1 Message Date
Ishaan Jaffer 8a7f39daa4 tes numeric constants 2025-10-29 18:23:38 -07:00
Ishaan Jaffer f538caaa01 fix proxy_build_from_pip_tests 2025-10-29 18:22:55 -07:00
Ishaan Jaffer a3e70b8885 fix model by provider test 2025-10-29 18:21:06 -07:00
OrionCodeDevandGitHub 5f52533294 Fix spend tracking for OCR/aOCR requests (log pages_processed + recognize OCRResponse) (#16070)
* fix-ocr-cost

* fix1
2025-10-29 18:11:21 -07:00
Ishaan Jaffer a10b0b829e docs fix rbac improvements 2025-10-29 17:42:24 -07:00
Ishaan Jaffer 06449df9d3 fix codestral-embed 2025-10-29 13:15:32 -07:00
Ishaan JaffandGitHub abbb1476ee feat: add codestral-embed-2505 (#16071) 2025-10-29 13:13:55 -07:00
Ishaan JaffandGitHub 99feefd614 [Feat] Add FAL AI Image Generations on LiteLLM (#16067)
* add fal-ai provider

* fix image_generation_handler

* init FalAIImageGenerationConfig

* init cost_calculator

* init FAL AI

* TestFAL_AI_ImageGeneration

* fix load_custom_provider_entrypoints

* TestFAL_AI_ImageGeneration

* add imagen4 transform FAL AI

* add FAL AI imagen 4 transform

* BaseImageGenTest

* test_fal_ai_image_generation_basic

* add BRIA + Recraft img gen

* add recraft + BRIA

* test_fal_ai_image_generation_basic

* tests for flux PRO v11

* Add FAL AI SD

* test FAL AI SD

* docs FAL AI

* docs fal ai

* Using Model-Specific Parameters

* add fal ai model prices

* add fall_ai JPG logo

* ui fixes FAL AI

* fix linting

* fix linting

* fix bedrock test_get_request_body_stability3

* test_custom_llm_provider_entrypoint
2025-10-29 13:10:51 -07:00
Alexsander HamirandGitHub 4939793ade fix: prevent httpx DeprecationWarning memory leak in AsyncHTTPHandler (#16024)
* fix: prevent httpx DeprecationWarning memory leak in AsyncHTTPHandler

Route bytes/str to content= parameter instead of data= to avoid deprecation warning that causes memory leak

* refactor: extract data/content preparation into helper function

Create _prepare_request_data_and_content() helper to DRY up the logic
for routing data/content parameters correctly in httpx requests.

This helper prevents httpx DeprecationWarnings (which cause memory leaks)
by moving bytes/str from data= to content= parameter while keeping
dict/Mapping in data= parameter.

Applied the helper consistently across all HTTP methods in both
AsyncHTTPHandler and HTTPHandler classes:
- post(), put(), patch(), delete()
- single_connection_post_request()

Related to: b850ed1188aced4e8c3cd7ef8b1a065fbc43edbb

* fix: Python 3.8 compatibility - use Tuple instead of tuple in type hints

Replace lowercase tuple[...] with typing.Tuple[...] in http_handler.py
to fix 'TypeError: type object is not subscriptable' on Python 3.8
2025-10-29 12:57:41 -07:00
langpingandGitHub 5bba1e8405 Added fallback logic for detecting file content-type when S3 returns generic (#15635)
* enhance image processing fallback logic

* Extract to comment utils
2025-10-29 08:24:20 -07:00
Dmitrii KomarovandGitHub 1dfdcb0762 Allow using ARNs when generation images via Bedrock (#15789)
* Use model_id in Bedrock's image_handler

* Fix MyPy for converse_handler and invoke_hanlder
2025-10-28 19:41:35 -07:00
Albert DeFuscoandGitHub 559ae96e38 Python entry-point for CustomLLM subclasses (#15881)
* load entrypoints

* mock loading entry-point in pyproject.toml

* simpler group name

* create CustomLLM subclass instance after load
2025-10-28 19:39:14 -07:00
e6a7cae7e1 fix(apscheduler): prevent memory leaks from jitter and frequent job intervals (#15846)
* fix(apscheduler): prevent memory leaks from jitter and frequent job intervals

Fixes critical memory leak in APScheduler that causes 35GB+ memory allocations
during proxy startup and operation. The leak was identified through Memray
analysis showing massive allocations in normalize() and _apply_jitter()
functions.

Key changes:
1. Remove jitter parameters from all scheduled jobs - jitter was causing
   expensive normalize() calculations leading to memory explosion
2. Configure AsyncIOScheduler with optimized job_defaults:
   - misfire_grace_time: 3600s (increased from 120s) to prevent backlog
     calculations that trigger memory leaks
   - coalesce: true to collapse missed runs
   - max_instances: 1 to prevent concurrent job execution
   - replace_existing: true to avoid duplicate jobs on restart
3. Increase minimum job intervals:
   - PROXY_BATCH_WRITE_AT: 30s (was 10s)
   - add_deployment/get_credentials jobs: 30s (was 10s)
4. Use fixed intervals with small random offsets instead of jitter for
   job distribution across workers
5. Explicitly configure jobstores and executors to minimize overhead
6. Disable timezone awareness to reduce computation

Memory impact:
- Before: 35GB with 483M allocations during startup
- After: <1GB with normal allocation patterns

Performance notes:
- Minimum job intervals increased from 10s to 30s (configurable via env vars)
- Jobs can still be distributed across workers using random start offsets
- No functional changes to job behavior, only timing and memory optimization

Testing:
- Added comprehensive test suite for scheduler configuration
- Verified no job execution backlog on startup
- Tested duplicate job prevention with replace_existing

Related issue: Memory leak in production proxy servers with APScheduler

\ud83e\udd16 Generated with [Claude Code](https://claude.ai/code)

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

* docs: update PROXY_BATCH_WRITE_AT default value from 10s to 30s

Update documentation to reflect the new default value for PROXY_BATCH_WRITE_AT
changed in PR #15846. The default was increased from 10 seconds to 30 seconds
to prevent memory leaks in APScheduler.

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

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

* refactor: Move APScheduler config to constants.py

Address code review feedback from ishaan-jaff:
- Move scheduler configuration variables (coalesce, misfire_grace_time,
  max_instances, replace_existing) to litellm/constants.py
- Update all references in proxy_server.py to use the constants
- Improves maintainability and makes configuration values centralized

Requested-by: @ishaan-jaff
Related: #15846

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-28 19:30:17 -07:00
e8e91ac707 docs: improve Grayswan guardrail documentation (#15875)
Co-authored-by: berri-teddy <teddy@berri.ai>
2025-10-28 19:29:40 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3319bbf277 chore(deps): bump hono from 4.9.7 to 4.10.3 in /litellm-js/spend-logs (#15915)
Bumps [hono](https://github.com/honojs/hono) from 4.9.7 to 4.10.3.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](https://github.com/honojs/hono/compare/v4.9.7...v4.10.3)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.10.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 19:28:10 -07:00
d89990e0c5 Add license metadata to health/readiness endpoint. (#15997)
* health: expose license metadata (available & expiration) in /health/readiness endpoint

* test: add health readiness license metadata coverage

* test: ensure /health/readiness response includes license metadata

* chore: remove standalone license metadata test as requested; existing test covers codepath

---------

Co-authored-by: Plan42.ai <robot@plan42.ai>
2025-10-28 19:21:54 -07:00
Ishaan Jaffer a5b725917c fix merge 2025-10-28 19:20:07 -07:00
Ishaan Jaffer f28e6fcbdd ui new build 2025-10-28 19:20:07 -07:00
Daniele ScasciafratteandGitHub 36f0ee6ff9 Remove unnecessary model variable assignment (#16008)
* Remove unnecessary model variable assignment

Remove redundant assignment of model variable.

* Remove redundant model assignment in image generation
2025-10-28 19:19:25 -07:00
Ishaan Jaffer 33371d18f4 test fix claude-sonnet-4-5-20250929 2025-10-28 19:05:13 -07:00
Rodolfo Nobrega de ResendeandGitHub 29f0ed223a fix: Support text.format parameter in Responses API for providers without native ResponsesAPIConfig (#16023)
Fixes #15995

When using the Responses API with providers that don't have a native
ResponsesAPIConfig implementation (like Gemini, Anthropic, Cohere, etc.),
the text.format parameter was being ignored. This happened because these
providers fall back to using the LiteLLMCompletionTransformationHandler,
which converts Responses API requests to Chat Completion API requests.

Changes:
- Added 'text' to the list of supported parameters in
  LiteLLMCompletionResponsesConfig.get_supported_openai_params()
- Added transformation logic to convert text.format (Responses API format)
  to response_format (Chat Completion API format) in
  transform_responses_api_request_to_chat_completion_request()
- Created _transform_text_format_to_response_format() method to handle
  the conversion between the two format structures

The transformation supports:
- json_schema: Converts to Chat Completion's json_schema format with
  proper nested structure
- json_object: Converts to Chat Completion's json_object mode
- text: Returns None (default text format)

This fix benefits all providers that use the fallback transformation
handler, ensuring consistent behavior with OpenAI's native Responses API
implementation.
2025-10-28 18:06:48 -07:00
Ishaan Jaffer b0a2e08a60 fixes test 2025-10-28 17:43:04 -07:00
Ishaan Jaffer d32890ba55 fix _redact_base64 2025-10-28 17:38:16 -07:00
Ishaan Jaffer 1b49dba1dd fix claude-sonnet-4-5 2025-10-28 17:37:08 -07:00
Ishaan Jaffer 74e4d3f6da fixes for mock tests 2025-10-28 17:31:54 -07:00
Ishaan Jaffer 23b1f1afda fix _process_messages 2025-10-28 16:47:52 -07:00
Ishaan Jaffer cf78b3464c fix linting 2025-10-28 16:46:44 -07:00
Sameer KankuteandGitHub 8f2becd1c4 Fix: Redact reasoning summaries in ResponsesAPI output when message logging is disabled (#15965)
* redact reasoning content as well

* fix mypy error
2025-10-28 16:42:41 -07:00
Sameer KankuteandGitHub 25f12924c4 Fix deletion of original request (#16002) 2025-10-28 16:42:08 -07:00
ab8a3a5d9e [Fix] SQS Logger - Add Base64 handling (#16028)
* Enable base64 stripping from sqs (#15927)

* Add sqs logger

* Add sqs logger

* Add sqs strp base64

* Add sqs strp base64

* Add sqs strp base64

* strip base64

* Add sqs strp base64

* strip base64

* Add sqs strp base64

* Add max depth recursion

* Add max depth recursion

---------

Co-authored-by: deepanshu <deepanshu.lulla@hq.bill.com>

* refactor _strip_base64_from_messages

* test fixes SQS logger

* fix SQS linting

---------

Co-authored-by: Deepanshu Lulla <deepanshu.lulla@gmail.com>
Co-authored-by: deepanshu <deepanshu.lulla@hq.bill.com>
2025-10-28 16:41:32 -07:00
Ishaan JaffandGitHub 95dd216150 [UI] Feature - Add Apply Guardrail Testing Playground (#16030)
* add applyGuardrail endpoints

* v0 testing apply guard

* fix: use tabs

* move apply guardrails endpoint

* fix apply_guardrail

* fix applyGuardrail

* fix apply guardrail for bedrock

* test guard endpoints

* add tooltip for enter button

* refactor

* add guardrail test

* tests guardrails selector

* TestNomaApplyGuardrail
2025-10-28 16:41:17 -07:00
Ishaan JaffandGitHub 5c375b23ae [Fix] Guardrails - Ensure Key Guardrails are applied (#16025)
* _add_guardrails_from_key_or_team_metadata

* test_team_guardrails_append_to_key_guardrails

* fix move_guardrails_to_metadata

* fix _add_guardrails_from_key_or_team_metadata
2025-10-28 16:40:49 -07:00
yuneng-jiangandGitHub 12de66dad6 Config Models should not be editable (#16020) 2025-10-28 15:27:10 -07:00
Sameer KankuteandGitHub 59189c0579 fix errors in videos documentation (#15996) 2025-10-28 14:48:04 -07:00
3a7c498eff Add GitlabPromptCache and enable subfolder access (#15712)
* Add GitlabPromptCache and enable subfolder access

* Add GitlabPromptCache and enable subfolder access

* Add GitlabPromptCache and enable subfolder access

---------

Co-authored-by: deepanshu <deepanshu.lulla@hq.bill.com>
2025-10-28 14:46:50 -07:00
ArielandGitHub 647f2f5d86 [feat]: graceful degradation for pillar service when using litellm (#15857)
* graceful degradation for pillar service when using litellm

* remove unnecessary mode

* simplify docs

* final fixes

* lint fixes

* fix linting
2025-10-27 19:51:29 -07:00
Thomas MildnerandGitHub e27bab3238 fix(opik): enhance requester metadata retrieval from API key auth (#15897) 2025-10-27 19:48:40 -07:00
Thomas SchmidtandGitHub 2e7dc56895 Add Haiku 4.5 pricing for open router (#15909)
* Add Haiku 4.5 pricing for open router

* Add haiku 4.5 pricing for open router
2025-10-27 19:47:50 -07:00
2074b4d662 Fix: Support tool usage messages with Langfuse OTEL integration (#15932)
* Log tool use in langfuse otel integration

* Add test for logging function calling

---------

Co-authored-by: eycjur <eycjur@example.com>
2025-10-27 19:47:31 -07:00
Chris GibbonsandGitHub 2bef7c3662 fix: Preserve Bedrock inference profile IDs in health checks (#15947)
* fix: Preserve Bedrock inference profile IDs in health checks

- Fixes issue where health checks were stripping inference profile IDs
- Preserves cross-region inference profile prefixes (us., eu., apac., jp., au., us-gov., global.)
- Strips only AWS region routing while preserving routes and handlers
- Resolves both issue #15807 and inference profile requirement errors
- Adds comprehensive tests for all Bedrock model format combinations

Issue #15807 attempted to fix regional Bedrock model health checks but was too
aggressive, stripping cross-region inference profile prefixes that AWS requires.
This caused errors: "Invocation of model ID X with on-demand throughput isn't
supported. Retry your request with the ID or ARN of an inference profile."

The fix now correctly:
- Strips AWS regions (us-west-2, eu-central-1, etc.) from routing
- Preserves CRIS prefixes (us., eu., etc.) required by AWS
- Preserves routes (converse/, invoke/)
- Preserves handlers (llama/, deepseek_r1/)
- Only affects Bedrock models (checked via startswith)

Test coverage includes 20+ scenarios for all Bedrock model format combinations.

* Remove unused traceback import
2025-10-27 19:44:45 -07:00
YutaSaitoandGitHub 8b33328cc1 Perf speed up pytest (#15951)
* perf: Skip sleep delays in base_mail.py during tests to improve test speed

* perf: Mock datetime.now in parallel_request_limiter_v3.py to improve test speed

* pref: Mock urllib system calls in test_aiohttp_transport.py to improve test speed

* chore: add --durations=50 to visualize slowest tests

* pref: reduce setup phase overhead by widening fixture scope in conftest.py

* test: stabilize flaky tests

* fix: minor issue
2025-10-27 19:43:40 -07:00
Mac MisiuraandGitHub 5ad108bc9b 📝 updated ibm_guardrails.md to better indicate how detectors could be configured (#15971) 2025-10-27 19:41:10 -07:00
dima-hx430andGitHub c5c37bf7f5 Add models missing deprecation dates (#15976) 2025-10-27 19:39:38 -07:00
Ishaan JaffandGitHub 4cef208c5f [Fix] - Responses API - add /openai routes for responses API. (Azure OpenAI SDK Compatibility) (#15988)
* add /openai routes for responses API

* TestResponsesAPIEndpoints
2025-10-27 19:12:13 -07:00
yuneng-jiangandGitHub 43af45ab88 Key Already Exist Error Notification (#15993) 2025-10-27 18:00:38 -07:00
Ishaan Jaffer a3d64fb843 fix omni-moderation-latest 2025-10-27 17:48:35 -07:00
Ishaan Jaffer 0e23f89eb7 fix ModelArmorGuardrail 2025-10-27 17:47:19 -07:00
Ishaan Jaffer d5f48c7e23 get_metadata_variable_name_from_kwargs 2025-10-27 17:38:24 -07:00
Ishaan Jaffer de6fffe743 bump: version 1.79.0 → 1.79.1 2025-10-27 17:22:54 -07:00
yuneng-jiangandGitHub 64167b7e34 Remove limit from admin UI numerical input fix (#15991) 2025-10-27 17:20:58 -07:00