Commit graph

30989 commits

Author SHA1 Message Date
Alexsander Hamir
5c2f55bcd5 Add mock support for Braintrust integration and extend mock client factory
- Add braintrust_mock_client.py with mock HTTP client for Braintrust integration testing
- Integrate mock client into BraintrustLogger with mock mode detection
- Refactor Helicone mock client to fully utilize factory's HTTPHandler.post patching
- Extend mock_client_factory to support patching HTTPHandler.post for sync calls
- Enable endpoint-specific mock responses for Braintrust (/project vs /project_logs)
- All mock clients now properly handle both async (AsyncHTTPHandler) and sync (HTTPHandler) calls
2026-01-24 12:09:27 -08:00
Alexsander Hamir
5706ba9fe2 Add Helicone mock client support
- Created helicone_mock_client.py using factory pattern (similar to GCS)
- Integrated mock mode detection and initialization in HeliconeLogger
- Mock client patches HTTPHandler.post to intercept Helicone API calls
- Uses factory pattern for should_use_mock and MockResponse utilities
- Custom HTTPHandler.post patching required since HTTPHandler uses self.client.send()
2026-01-24 11:47:35 -08:00
Alexsander Hamir
05b39a02fb feat: add PostHog mock client support
- Create posthog_mock_client.py using factory pattern
- Integrate mock client into PostHogLogger with mock mode detection
- Add verbose logging for mock mode initialization and batch operations
- Enable mock mode via POSTHOG_MOCK environment variable
2026-01-24 11:26:52 -08:00
Alexsander Hamir
e5bea6dd28 refactor: consolidate mock client logic into factory pattern
- Create mock_client_factory.py to centralize common mock HTTP client logic
- Refactor GCS, Langfuse, LangSmith, and Datadog mock clients to use factory
- Improve GET/DELETE mock accuracy for GCS (return valid StandardLoggingPayload)
- Fix DELETE mock to return empty body (204 No Content) instead of JSON
- Reduce code duplication across integration mock clients
2026-01-24 11:17:36 -08:00
Alexsander Hamir
70598a4944 Add Datadog mock client support
- Create datadog_mock_client.py following GCS, Langfuse, and LangSmith patterns
- Add mock mode detection via DATADOG_MOCK environment variable
- Intercept Datadog API calls via AsyncHTTPHandler.post and httpx.Client.post patching
- Add verbose logging throughout mock implementation
- Update DataDogLogger and DataDogLLMObsLogger to initialize mock client when mock mode enabled
- Supports both async and sync logging paths
- Supports configurable mock latency via DATADOG_MOCK_LATENCY_MS
2026-01-24 11:04:34 -08:00
Alexsander Hamir
dbbd400b21 Add LangSmith mock client support
- Create langsmith_mock_client.py following GCS and Langfuse patterns
- Add mock mode detection via LANGSMITH_MOCK environment variable
- Intercept LangSmith API calls via AsyncHTTPHandler.post patching
- Add verbose logging throughout mock implementation
- Update LangsmithLogger to initialize mock client when mock mode enabled
- Supports configurable mock latency via LANGSMITH_MOCK_LATENCY_MS
2026-01-24 10:58:12 -08:00
Ishaan Jaffer
1a7274aa4e fix: _apply_search_filter_to_models mypy linting 2026-01-24 09:24:50 -08:00
Ishaan Jaffer
489d587332 CI/CD fixes - split local testing 2026-01-24 09:23:03 -08:00
yuneng-jiang
387cb8fde8
Merge pull request #19703 from BerriAI/yj_ui_build_jan24
[Infra] Build UI for Release
2026-01-24 09:20:26 -08:00
yuneng-jiang
17aec96186 chore: update Next.js build artifacts (2026-01-24 17:18 UTC, node v22.16.0) 2026-01-24 09:18:58 -08:00
Ishaan Jaffer
006b810370 bump: version 1.81.2 → 1.81.3 2026-01-24 09:15:06 -08:00
yuneng-jiang
ed1b9529f7
Merge pull request #19601 from BerriAI/litellm_ui_update_org_model
[Feature] UI - Organization Edit Page: Reusable Model Select
2026-01-24 09:10:15 -08:00
yuneng-jiang
5e395db1dc
Merge pull request #19604 from BerriAI/litellm_team_update_org
[Fix] Team Update with Organization having All Proxy Models
2026-01-24 09:09:55 -08:00
yuneng-jiang
f88a32de05
Merge pull request #19622 from BerriAI/litellm_ui_model_backend
[Feature] UI - Models Page: Model Search
2026-01-24 09:09:03 -08:00
yuneng-jiang
b44ac6c682 Fixing ruff check 2026-01-24 09:08:29 -08:00
Ishaan Jaff
0bdb68dea7
Update OSS Adopters section with new table format 2026-01-24 09:07:03 -08:00
yuneng-jiang
09c7d67539
Merge pull request #19701 from BerriAI/litellm_ci_fix_yj_03
[Infra] Fixing CircleCI Config
2026-01-24 08:55:50 -08:00
yuneng-jiang
1c9731527f fixing circleci config 2026-01-24 08:54:22 -08:00
yuneng-jiang
cec367065e
Merge pull request #19695 from BerriAI/litellm_ci_fix_yj_03
[Infra] CI/CD - Fixing failing tests
2026-01-23 23:31:31 -08:00
yuneng-jiang
acd8f21f68 fixing circleci config 2026-01-23 23:30:54 -08:00
yuneng-jiang
00ec939ea6 cache tests serial 2026-01-23 23:13:45 -08:00
yuneng-jiang
63166c3acc fixing arize tests 2026-01-23 23:13:21 -08:00
yuneng-jiang
e1bb4ae280 deactivating non root tests 2026-01-23 22:55:36 -08:00
yuneng-jiang
86676142c9 Fixing failing tests 2026-01-23 22:33:00 -08:00
yuneng-jiang
e181f2daa4
Merge pull request #19694 from BerriAI/litellm_ci_fix_yj_02
[Infra] CI/CD - Fixing UI Build
2026-01-23 22:12:38 -08:00
yuneng-jiang
1dbb6e0d3f fixing build 2026-01-23 22:11:49 -08:00
Cesar Garcia
31a8d76d11
Update Gemini 2.0 Flash deprecation dates to March 31, 2026 (#19592)
Google announced that Gemini 2.0 Flash and Flash Lite models will be discontinued on March 31, 2026. Updated deprecation_date field for all affected model variants across different providers (vertex_ai, gemini, deepinfra, openrouter, vercel_ai_gateway).

Models updated:
- gemini-2.0-flash (added deprecation date)
- gemini-2.0-flash-001 (updated from 2026-02-05)
- gemini-2.0-flash-lite (added deprecation date)
- gemini-2.0-flash-lite-001 (updated from 2026-02-25)

All variants now correctly reflect the March 31, 2026 shutdown date.
2026-01-23 20:36:36 -08:00
Harshit Jain
f4ba5b9209
docs: add litellm-enterprise requirement for managed files (#19689) 2026-01-23 19:51:39 -08:00
Ishaan Jaff
a870722f65
[Feat] UI + Backend - Allow adding policies on Keys/Teams + Viewing on Info panels (#19688)
* ui for policy mgmt

* test_add_guardrails_from_policy_engine_accepts_dynamic_policies_and_pops_from_data
2026-01-23 19:03:44 -08:00
yuneng-jiang
4ed5aa5de0
Merge pull request #19687 from BerriAI/litellm_ui_refresh_mcp
[Fix] UI - Redirect to ui/login on expired JWT
2026-01-23 18:09:44 -08:00
yuneng-jiang
a34664d8b0 redirect to login on expired jwt 2026-01-23 18:03:10 -08:00
Ishaan Jaffer
46ef001150 UI: new build 2026-01-23 17:40:54 -08:00
yuneng-jiang
26a6b86ea9
Merge pull request #19265 from naaa760/fix/guar-patt-edi
fix: ensure guardrail patterns persist on edit and mode toggle
2026-01-23 17:36:09 -08:00
ryan-crabbe
d67d12fc54
perf: Add LRU caching to get_model_info for faster cost lookups (#19606)
- Add @lru_cache decorator to get_model_info() and _cached_get_model_info_helper()
- Update _invalidate_model_cost_lowercase_map() to clear these caches when model_cost changes
- Update test to call cache invalidation after modifying litellm.model_cost

Reduces get_model_cost_information from 46% to <1% of request handling time.
2026-01-23 17:26:45 -08:00
yuneng-jiang
b5dfb57073
Merge pull request #19686 from BerriAI/litellm_key_team_create_routing_setting_ui
[Feature] UI - Create Team and Key Router Settings
2026-01-23 17:26:13 -08:00
ryan-crabbe
6e930c9724
perf: skip pattern_router.route() for non-wildcard models (#19664)
Check "*" in model before calling pattern_router.route() to avoid
unnecessary pattern matching for non-wildcard model configurations.
2026-01-23 17:21:41 -08:00
ryan-crabbe
54f9ad370f
perf: Optimize use_custom_pricing_for_model with set intersection (#19677)
* perf: Optimize use_custom_pricing_for_model with set intersection

Cache CustomPricingLiteLLMParams.model_fields.keys() as a module-level
frozenset and use set intersection to reduce loop iterations from 882k
to 90k (only iterating over keys that exist in both sets).

Performance improvement: 84% faster (6.3x speedup)
- Before: 1.17s total, 65µs per call
- After: 0.19s total, 10µs per call

* Use .get() for defensive dictionary access
2026-01-23 17:18:16 -08:00
yuneng-jiang
de9802578b Fixing tests 2026-01-23 17:15:50 -08:00
ryan-crabbe
0133d50a45
perf: Optimize strip_trailing_slash with O(1) index check (#19679)
* perf: Optimize strip_trailing_slash with O(1) index check

Replace rstrip("/") with direct index check for O(1) performance
instead of O(n) string scanning.

Results:
- strip_trailing_slash: 311ms → 13ms (96% faster)
- get_standard_logging_object_payload: 6.11s → 5.80s (5% faster)

* Handle multiple trailing slashes in strip_trailing_slash

Use rstrip for correctness when URL ends with "//" or more,
otherwise use O(1) index check for single trailing slash.
2026-01-23 17:12:08 -08:00
yuneng-jiang
f9bdc20be2 fixing tests 2026-01-23 17:07:51 -08:00
yuneng-jiang
ee1fd1c6c2 fixing build 2026-01-23 17:04:52 -08:00
yuneng-jiang
804567d681 Merge remote-tracking branch 'origin' into litellm_key_team_create_routing_setting_ui 2026-01-23 16:56:30 -08:00
yuneng-jiang
9850dbe934 Adding router settings to create team and key 2026-01-23 16:56:19 -08:00
Alexsander Hamir
5c61586e65
Add GCS mock mode for testing without API calls (#19683) 2026-01-23 16:25:32 -08:00
Alexsander Hamir
56883add3c
Add Langfuse mock mode for testing without API calls (#19676) 2026-01-23 15:33:40 -08:00
yuneng-jiang
22a268c544
Merge pull request #19673 from BerriAI/litellm_ui_router_fallbacks_02
[Feature] UI - Fallbacks: New Add Fallbacks Modal
2026-01-23 14:33:30 -08:00
yuneng-jiang
3ba9b13390 adding tests 2026-01-23 14:28:47 -08:00
yuneng-jiang
7e6fc6af2c New add fallbacks modal 2026-01-23 14:21:32 -08:00
Ishaan Jaffer
5b341ee842 fix linting 2026-01-23 13:46:02 -08:00
milan-berri
37b7dff194
add spend-queue-troubleshooting docs (#19659)
* add spend-queue-troubleshooting docs

* adjust spend-queue-troubleshooting docs
2026-01-23 13:44:41 -08:00