Commit Graph

22954 Commits

Author SHA1 Message Date
Ishaan Jaff 7da4e2197d Benefits of using gemini-cli with LiteLLM 2025-06-28 21:59:07 -07:00
Ishaan Jaff 50dd9980dc docs - update release notes 2025-06-28 21:56:58 -07:00
Krish Dholakia f7af8902b0 /v1/messages - Remove hardcoded model name on streaming + Tags - enable setting custom header tags (#12131)
* fix(anthropic/experimental_pass_through): use given model name when returning streaming chunks

don't harcode model name on streaming

confusing for user

* fix(anthropic/streaming_iterator.py): remove scope of import

* feat(litellm_logging.py): allow admin to specify additional headers for using as spend tags

Closes https://github.com/BerriAI/litellm/issues/12129

* test(test_litellm_logging.py): add unit tests

* feat(openweb_ui.md): add custom tag tutorial to docs

* docs(cost_tracking.md): add tag based usage UI screenshot

* test: update test

* fix: fix import
2025-06-28 21:49:35 -07:00
Krrish Dholakia 123631c93d docs(index.md): update release note with cleaner table for updated models 2025-06-28 21:48:24 -07:00
Ishaan Jaff a021e7cb9d bump poetry 2025-06-28 21:16:52 -07:00
Ishaan Jaff 973520255b fix for o-series param checks 2025-06-28 15:13:54 -07:00
Ishaan Jaff 04f5ccfee9 fix - revert list team changes 2025-06-28 15:09:36 -07:00
Ishaan Jaff ca8910496e fix imports 2025-06-28 15:01:47 -07:00
Ishaan Jaff 0c19414b36 [️ Python SDK import] - reduce python sdk import time by .3s (#12140)
* use 1 file for KeyManagementSystem

* move key management settings

* fix import locs

* test_proxy_types_not_imported

* test the import loc

* fix import item

* fix imports

* fix import loc

* fix imports
2025-06-28 14:57:10 -07:00
Ishaan Jaff 79a8b1a953 Revert "🧹 Refactor init.py to use a model registry (#12138)" (#12141)
This reverts commit f93326a214.
2025-06-28 14:56:39 -07:00
Ishaan Jaff 6b623f9c98 test whitelisted models 2025-06-28 14:46:16 -07:00
Ishaan Jaff 092e3591f5 fix import loc 2025-06-28 14:27:12 -07:00
Ishaan Jaff f93326a214 🧹 Refactor init.py to use a model registry (#12138)
* fix - refactor init to use a registry

* # noqa: PLR0915
2025-06-28 13:54:54 -07:00
Krrish Dholakia e77eb82cd6 docs(index.md): initial pre-release note 2025-06-28 13:24:19 -07:00
Ishaan Jaff 9b4f26faff [️ Python SDK Import] - 2 second faster import times (#12135)
* speedup - move wb logger to conditional

* fix import path
2025-06-28 12:40:04 -07:00
Ishaan Jaff a83f8f3de6 fix - using on python 3.9 v1.73.6-nightly 2025-06-28 12:03:35 -07:00
Guanghui Liu 27849359a9 fix example config.yaml in claude code tutorial (#12133) v1.73.6.rc-draft 2025-06-28 11:07:48 -07:00
Ishaan Jaff 8b73716a66 add docs 2025-06-28 09:26:12 -07:00
Ishaan Jaff 59aaef07ef fix code qa checks 2025-06-28 09:23:02 -07:00
Ishaan Jaff 1897abb147 bump: version 1.73.5 → 1.73.6 2025-06-28 09:20:23 -07:00
Ishaan Jaff fe8250be18 bump: version 1.73.4 → 1.73.5 2025-06-28 09:19:55 -07:00
Ishaan Jaff cfc07f361b [Bug Fix] Invite links email should contain the correct invite id (#12130)
* use common helper create_invitation_for_user

* use common util in proxy

* fix create_invitation_for_user

* refactor base email

* test_get_invitation_link_creates_new_when_none_exist

* fix code QA checks
2025-06-28 09:19:32 -07:00
tanjiro edc84b6b6d Update conditional_public_model_name.tsx (#11713) 2025-06-28 08:06:01 -07:00
Krish Dholakia d895ae827d Litellm batch api background cost calc (#12125)
* feat(check_batch_cost.py): emit spend log on successful request

ensures cost tracked for batch requests

* feat(proxy_server.py): add background job to poll completed batch jobs

used for calculating cost for batch jobs

* fix(proxy_server.py): run batch cost tracking job every hour

batch jobs take time to complete, no need to run every few seconds

* feat(proxy_server.py): run batch cost tracking job every hour
2025-06-27 21:46:25 -07:00
codeugar 06c86d6130 Update model_prices_and_context_window.json (#11972)
add
--
"deepseek/deepseek-r1": {
        "max_tokens": 8192,
        "max_input_tokens": 65536,
        "max_output_tokens": 8192,
        "input_cost_per_token": 5.5e-07,
        "input_cost_per_token_cache_hit": 1.4e-07,
        "output_cost_per_token": 2.19e-06,
        "litellm_provider": "deepseek",
        "mode": "chat",
        "supports_function_calling": true,
        "supports_assistant_prefill": true,
        "supports_tool_choice": true,
        "supports_reasoning": true,
        "supports_prompt_caching": true
    },
    "deepseek/deepseek-v3": {
        "max_tokens": 8192,
        "max_input_tokens": 65536,
        "max_output_tokens": 8192,
        "input_cost_per_token": 2.7e-07,
        "input_cost_per_token_cache_hit": 7e-08,
        "cache_read_input_token_cost": 7e-08,
        "cache_creation_input_token_cost": 0.0,
        "output_cost_per_token": 1.1e-06,
        "litellm_provider": "deepseek",
        "mode": "chat",
        "supports_function_calling": true,
        "supports_assistant_prefill": true,
        "supports_tool_choice": true,
        "supports_prompt_caching": true
    },
--
tencent custom deploy deepseek named "deepseek-r1" and "deepseek-v3".
Thanks very much !
2025-06-27 21:36:59 -07:00
Daniele Scasciafratte 24816fe470 Remove duplicated entry in logs on key cache update (#12032)
As per title and you can see the code is a duplicate
2025-06-27 21:33:11 -07:00
Cole McIntosh 0b95fb63cc Add Azure OpenAI assistant features cost tracking (#12045)
* Add Azure OpenAI assistant features cost tracking

Implements cost tracking for Azure's new assistant features:
- File Search: $0.1 USD per 1 GB/Day (storage-based pricing)
- Code Interpreter: $0.03 USD per session
- Computer Use: $0.003 input + $0.012 output per 1K tokens

Features:
- Provider-specific pricing (Azure vs OpenAI)
- Model-specific pricing overrides via JSON config
- Environment variable configuration
- Backwards compatible with existing OpenAI pricing

* Add comprehensive tests for Azure assistant features cost tracking

- Unit tests for file search, code interpreter, computer use, vector store
- Integration tests for combined cost calculation
- Provider-specific pricing tests (Azure vs OpenAI)
- Model-specific pricing override tests
- Edge case handling (None inputs, zero values)
- All 17 tests passing

* Fix test and ensure all Azure assistant cost tracking tests pass

- Fixed integration test approach
- All 17 tests now passing
- Comprehensive coverage of Azure assistant features cost tracking

* Enhance cost tracking for Azure assistant features

- Safely convert and extract parameters for file search, computer use, and code interpreter sessions.
- Ensure model_info is consistently converted to a dictionary format.
- Improve error handling for input values to prevent type-related issues.
- Maintain compatibility with existing cost calculation methods.

* Refactor cost tracking for Azure assistant features

- Introduced separate methods for handling costs related to web search, file search, vector store, computer use, and code interpreter.
- Enhanced parameter extraction and conversion for file search and computer use.
- Improved error handling and type safety throughout the cost calculation process.
- Maintained compatibility with existing cost calculation methods while streamlining the overall structure.
2025-06-27 21:33:00 -07:00
Ishaan Jaff 95f1850fac add jest.retryTimes(3); 2025-06-27 21:31:51 -07:00
tanjiro 0ba4dde659 create a set for unique options (#12074) 2025-06-27 21:31:05 -07:00
Bougou Nisou 58dda44fda feat: enhance redaction functionality for EmbeddingResponse (#12088) 2025-06-27 21:30:26 -07:00
Cole McIntosh 6578133bb7 Fix user-team association issues in LiteLLM proxy (#12082)
* Fix user-team association issues in LiteLLM proxy

- Update list_team function to properly filter teams using user's teams array instead of only checking members_with_roles field
- Add Field descriptions and docstring to TeamMemberAddRequest and related models for better Swagger/OpenAPI documentation
- Maintain backward compatibility with fallback to members_with_roles if user lookup fails

This ensures users created with teams parameter appear correctly in team views and improves API documentation.

* Fix duplicate member checking in team_member_add endpoint

- Enhanced team_member_add_duplication_check to check both user_id and user_email
- Added additional duplicate prevention logic after user creation/lookup
- Fixed issue where users added by email could be duplicated in teams
- Added logging for debugging duplicate detection

This addresses the bug where adding the same user by email multiple times would create duplicate entries in the team's members_with_roles array.

* Improve duplicate member prevention in team_member_add

- Enhanced early duplicate check to handle both user_id and user_email
- Added late-stage duplicate prevention after user lookup/creation
- Fixed issue where users could be added multiple times by email
- Cleaned up debug logging

Note: There's still an edge case where the duplicate prevention may not work
correctly in all scenarios. This needs further investigation and testing.

* Refactor team_member_add endpoint for improved member management

- Split team_member_add functionality into smaller, dedicated functions for permission validation, member processing, and team member list updates.
- Enhanced permission checks to ensure only authorized users can add members.
- Streamlined member addition logic to reduce redundancy and improve readability.
- Maintained existing functionality while improving code structure and maintainability.

* Add tests for team_member_add helper functions

- Add test for _validate_team_member_add_permissions with admin user
- Add test for _validate_team_member_add_permissions with non-admin user
- Add test for _process_team_members with single member
- Add test for _process_team_members with multiple members
- Add test for _update_team_members_list with new member
- Add test for _update_team_members_list duplicate prevention

These tests ensure the refactored helper functions work correctly
after fixing the PLR0915 linting error.
2025-06-27 21:29:49 -07:00
Youfu Zhang 1c68c24358 introduce new environment variable NO_REDOC to opt-out Redoc (#12092)
Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
2025-06-27 21:26:37 -07:00
Cole McIntosh e91802da39 feat: add local LLM translation testing with artifact generation (#12120)
- Move from CircleCI dependency to direct pytest execution
- Add Python script to generate beautiful markdown reports
- Update GitHub workflow to run tests directly
- Update Makefile to use the new test runner script
- Generate both JUnit XML and markdown artifacts
- Group test results by provider with detailed statistics
2025-06-27 21:24:19 -07:00
Ishaan Jaff 7465f062c0 add panw guard docs 2025-06-27 21:13:04 -07:00
Ishaan Jaff bb98f68451 docs fix 2025-06-27 21:09:33 -07:00
Ishaan Jaff 1fc590c0d1 fix - anthropic messages exception 2025-06-27 21:06:15 -07:00
Krish Dholakia ee6e76e1f9 Bedrock Passthrough cost tracking (/invoke + /converse routes - streaming + non-streaming) (#12123)
* refactor(passthrough_endpoints-success-handler): refactor llm passthrough logging logic

isolate the llm translation work to enable cost tracking on sdk

* feat: initial implementation of passthrough SDK cost calculation

enables bedrock passthrough cost tracking to work

* feat(cost_calculator.py): working cost calculation for bedrock passthrough

* feat(litellm_logging.py): consider allm_passthrough in cost tracking

allows async calls (e.g. via proxy) to work

* feat(bedrock/passthrough): working event stream decoding for bedrock passthrough calls + logging instrumentation for passthrough sdk calls (log on stream completion)

Enables bedrock streaming cost calculation

* feat(litellm_logging.py): support streaming passthrough cost tracking

* feat(passthrough/main.py): working async streaming cost calculation

Closes https://github.com/BerriAI/litellm/issues/11359

* feat(proxy_server.py): fix passthrough routing when llm router enabled

* feat: further fixes

* feat(bedrock/): working bedrock passthrough cost tracking (non-streaming)

* feat(litellm_logging.py): working usage tracking for bedrock passthrough calls

ensures tokens are logged

* feat(bedrock/passthrough): add converse passthrough cost tracking support

* feat(base_llm/passthrough): remove redundant function

* refactor(litellm_logging.py): refactor function to be below 50 LOC

* test: update test

* test: remove redundant test
2025-06-27 20:01:12 -07:00
tanjiro db2a55a3d2 Add "Get Code" Feature (#11629)
* added get code

* modify template

* fixed code template

* put the codesnippets in a different file

* minor
2025-06-27 18:18:56 -07:00
Alessandro Marrella 0e10ae1cf1 change Message init type annotation to support other roles (#11942) 2025-06-27 18:12:13 -07:00
ohmeow 9ab7d97b85 adds model to metadata to estimated cost is calculated; corrects how to pass metadata in braintrust in the docs (#12022) 2025-06-27 18:11:07 -07:00
Ishaan Jaff 723f24ef17 ci/cd new release 2025-06-27 18:07:44 -07:00
Ishaan Jaff 080372399f test_mock_router_testing_params_str_to_bool_conversion 2025-06-27 18:07:33 -07:00
Ishaan Jaff 0db60009b5 ci/cd new release 2025-06-27 18:06:06 -07:00
Ishaan Jaff d8dc84ee96 test fix - router utils 2025-06-27 18:05:37 -07:00
Ishaan Jaff c76f9be729 ui - new build 2025-06-27 18:00:59 -07:00
Ishaan Jaff 01b9e6efb1 Revert "fix: set logger levels based on LITELLM_LOG environment variable" (#12122) 2025-06-27 17:55:44 -07:00
Ishaan Jaff ebf6395bc1 [Feat] Add Eleven Labs - Speech To Text Support on LiteLLM (#12119)
* add ELEVENLABS as a provider

* add deepgram to main.py

* add ElevenLabsException

* add ElevenLabsAudioTranscriptionConfig

* add transform_audio_transcription_response

* TestElevenLabsAudioTranscription

* add elevenlabs/scribe_v1 to model cost map

* add ElevenLabsAudioTranscriptionConfig

* add AudioTranscriptionRequestData

* add ElevenLabs transform

* use AudioTranscriptionRequestData

* refactoring fixes

* add ProcessedAudioFile util for reading audio files

* test_elevenlabs_diarize_parameter_passthrough

* docs eleven labs

* docs fixes

* fix code qa checks

* fixes - audio transcription

* ui - add ElevenLabs logo

* add elevenlabs logo

* docs - ElevenLabs

* test fix elevenlabs
2025-06-27 17:50:49 -07:00
Ishaan Jaff 041db0268c [Bug fix] Router - handle cooldown_time = 0 for deployments (#12108)
* fix get cooldown time

* fixes for _should_run_cooldown_logic

* test_cooldown_time_zero_uses_zero_not_default

* Update litellm/router_utils/cooldown_cache.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update litellm/router_utils/cooldown_handlers.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-27 17:50:35 -07:00
Cole McIntosh cdb5c6fb6b Merge pull request #12035 from colesmcintosh/add-gemini-md
docs(GEMINI.md): add development guidelines and architecture overview
2025-06-27 17:30:52 -06:00
Ishaan Jaff f04808e293 [Bug Fix] Exception mapping for context window exceeded - should catch anthropic exceptions (#12113)
* fix is is_error_str_context_window_exceeded

* test_is_error_str_context_window_exceeded

* fix is_error_str_context_window_exceeded
2025-06-27 15:49:07 -07:00