Commit graph

22898 commits

Author SHA1 Message Date
Cole McIntosh
575d25ab16
Merge pull request #12111 from colesmcintosh/fix/logger-level-initialization
fix: set logger levels based on LITELLM_LOG environment variable
2025-06-27 11:58:05 -06:00
Cole McIntosh
cce2656376
Merge pull request #12112 from colesmcintosh/fix/cost-calculation-log-level
fix: change cost calculation logs from INFO to DEBUG level
2025-06-27 11:57:55 -06:00
Cole McIntosh
bc41cee0a1 fix: change cost calculation logs from INFO to DEBUG level
- Change verbose_logger.info() to verbose_logger.debug() for cost calculation messages
- Ensures cost calculation details are only shown when DEBUG logging is enabled
- Reduces log noise in production environments

Part 2/2 of fix for #9815
2025-06-27 11:36:58 -06:00
Cole McIntosh
9d58d872ac fix: set logger levels based on LITELLM_LOG environment variable
- Initialize verbose_logger, verbose_proxy_logger, and verbose_router_logger with the correct log level
- Ensures loggers respect the LITELLM_LOG environment variable setting
- Fixes part of issue #9815 where logs were shown regardless of log level setting

Part 1/2 of fix for #9815
2025-06-27 11:34:38 -06:00
Kishan
fc17da0aef
[Bug Fix] Anthropic - Token Usage Null Handling in calculate_usage (#12068)
* [Bug Fix] Anthropic - Token Usage Null Handling in calculate_usage (BerriAI/litellm#11920)

* [Fix] Missed a null check and used a cast instead by error
2025-06-27 10:00:23 -07:00
Krish Dholakia
8bd1f8f6ab
Add o3 and o4-mini deep research models (#12109)
* build(model_prices_and_context_window.json): add o3-deep-research models

* build(model_prices_and_context_window.json): add o4-deep-research model

* build(model_prices_and_context_window.json): add o4-mini-deep-research versioned model
2025-06-27 09:58:53 -07:00
Cole McIntosh
a56c28ab2f
fix: handle provider_config type error in passthrough error handler (#12101)
- Fix type error where _handle_error was called with provider_config=None
- Add proper provider config retrieval logic similar to llm_passthrough_route
- Handle cases where provider config may not be available
- Ensure type safety while maintaining backward compatibility
2025-06-27 09:11:28 -07:00
Ishaan Jaff
e3c9318bd4
[Fix] MCP - Ensure internal users can access /mcp and /mcp/ routes (#12106)
* fixes for MCP route checks

* test is is_llm_api_route for MCP
2025-06-27 09:05:38 -07:00
Cole McIntosh
60bf3c36bf
fix(docs): Remove unused dotenv dependency from docusaurus config (#12102)
* fix(docs): Remove unused dotenv dependency from docusaurus config

The dotenv package was being required in docusaurus.config.js but was listed as
a devDependency, causing build failures. Since no environment variables are
actually used in the config, removed the unnecessary import.

* fix(docs): Remove reference to non-existent spending_monitoring doc

The sidebars.js file was referencing proxy/spending_monitoring which was deleted
in commit ba7463b9c. This was causing the documentation build to fail with missing
document errors.
2025-06-27 08:20:44 -07:00
Ishaan Jaff
c994c22c13
[Bug Fix] Bedrock Guardrails - Ensure PII Masking is applied on response streaming or non streaming content when using post call (#12086)
* test_bedrock_guardrail_response_pii_masking_streaming

* fix - apply masking for response on bedrock
2025-06-27 07:41:32 -07:00
Davis Featherstone
51074ffcae
Fix Azure-OpenAI Vision API Compliance (#12075)
* Fix Azure-OpenAI Vision API Compliance

* Linting Fix
2025-06-26 22:54:15 -07:00
Krish Dholakia
dd92b1a0ac
Refactor: bedrock passthrough fixes - migrate to Passthrough SDK (#12089)
* feat: initial commit adding bedrock support via the new sdk passthrough logic

ensures correct sequencing of tasks (pre call checks etc. can run before signing request)

* fix(route_llm_requests.py): passthrough to allm_passthrough_route if no model found

* feat(bedrock/passthrough): working bedrock passthrough via sdk support

* fix(passthrough/main.py): re-add data and json

* feat(passthrough/main): support async passthrough calls to bedrock

* feat(passthrough/main.py): async streaming + completion support

* feat(llm_passthrough_endpoints.py): migrate bedrock passthrough calls to to new bedrock passthrough sdk

Enables calls to work correctly

* fix: fix linting errors

* test: update test
2025-06-26 22:51:35 -07:00
Krish Dholakia
e8d7537b57
Raise clearer error on Anthropic Unified route + allow setting new_key on /key/regenerate
* fix(llm_http_handler.py): raise clearer error on anthropic unified route

Fixes https://github.com/BerriAI/litellm/issues/12063

* fix(key_management_endpoints.py): add new param `new_key` for setting the regenerated key value

user request

* test: add unit tests

* fix(pass_through_endpoints.py): use data instead of json for passthrough requests

fixes bedrock latency issue

* Revert "fix(pass_through_endpoints.py): use data instead of json for passthrough requests"

This reverts commit 021dfd9165.
2025-06-26 21:56:03 -07:00
Ishaan Jaff
ba7463b9c6 docs - spend monitoring 2025-06-26 17:39:13 -07:00
Ishaan Jaff
edf416c24f docs - Use LiteLLM with Gemini CLI 2025-06-26 17:31:19 -07:00
Ishaan Jaff
72ecac8962 docs - user agent 2025-06-26 16:23:59 -07:00
Ishaan Jaff
16126f0d6b docs Gemini Text-to-Speech 2025-06-26 15:59:48 -07:00
Ishaan Jaff
80acf6bc97 docs */speech to /chat/completions Bridge** 2025-06-26 15:53:25 -07:00
Ishaan Jaff
fc39343599 docs update 2025-06-26 15:32:33 -07:00
Ryan Castner
ac11bfabcb
Responses API - Add reasoning content support for non-OpenAI providers (#12055)
Add reasoning content support when Responses API falls
back to completions API, enabling reasoning content for
all LLM providers (Anthropic, Vertex AI, etc.) since
OpenAI is currently the only native Responses API
provider.

* Add ReasoningSummaryTextDeltaEvent for streaming
  reasoning deltas
* Update streaming iterator to detect and transform
  reasoning content
* Extract reasoning content as separate output items in
  transformations
* Support reasoning content alongside regular message
  content

Closes https://github.com/BerriAI/litellm/issues/11302
2025-06-26 14:21:49 -07:00
Cole McIntosh
98ba5c8ffe
Merge pull request #12042 from colesmcintosh/fix-today-selector-date-mutation-bug
Fix today selector date mutation bug in dashboard components
2025-06-26 14:43:02 -06:00
Ishaan Jaff
e556071544 docs - Use LiteLLM with Gemini CLI 2025-06-26 13:35:33 -07:00
Cole McIntosh
8f376a60fa fix(ui): fix Today filter not showing usage data in dashboard
- Fix date formatting in API calls from ISO format to YYYY-MM-DD
- Update userDailyActivityCall, teamDailyActivityCall, and tagDailyActivityCall
- Prevent date mutation by creating new Date objects before API calls
- Set proper time boundaries (00:00:00 to 23:59:59) for same-day selections

The API expects dates in YYYY-MM-DD format but the UI was sending
full ISO timestamps, causing the Today filter to return empty results.
2025-06-26 13:59:40 -06:00
Cole McIntosh
92948b33b1
Merge branch 'BerriAI:main' into fix-today-selector-date-mutation-bug 2025-06-26 12:29:44 -06:00
Krrish Dholakia
1de2e4ce28 fix(anthropic_endpoints.py): publicly expose anthropic v1/messages endpoint 2025-06-26 10:47:37 -07:00
Krrish Dholakia
0e96f412a1 build(model_prices_and_context_window.json): mark azure o3-pro as responses api model
Fixes https://github.com/BerriAI/litellm/issues/12059
2025-06-26 10:41:03 -07:00
Ishaan Jaff
3c43b0f8ad
add _pretty_print_redis_config (#12073) 2025-06-26 10:26:57 -07:00
tanjiro
bd0a5f7387
Inkeep searchbar and chat added to the Docs (#12030)
* inkeep chat added

* add prod key
2025-06-26 10:13:42 -07:00
Cole McIntosh
7efb2c0f3c
Merge pull request #12041 from colesmcintosh/ci-artifact
Enhance CircleCI integration in LLM translation testing workflow
2025-06-26 11:12:04 -06:00
Cole McIntosh
bd77321c6d
Merge branch 'BerriAI:main' into ci-artifact 2025-06-26 10:59:17 -06:00
Cole McIntosh
7b7472d1f1
Merge pull request #12072 from colesmcintosh/fix/test-mock-create-audio-file
fix(proxy): Fix test_mock_create_audio_file by adding managed_files hook
2025-06-26 10:58:58 -06:00
Cole McIntosh
e4bc213bfe fix(proxy): Add managed_files hook to test_mock_create_audio_file
The test was failing because the managed_files hook was not configured.
This fix adds a DummyManagedFiles class and mocks the create_file
function as an AsyncMock to ensure proper test execution.
2025-06-26 10:42:25 -06:00
Cole McIntosh
c4f3cc6de2 Enhance CircleCI integration in LLM translation testing workflow. Updated commit SHA retrieval method, improved pipeline search logic, and refined artifact downloading process. Added checks for test workflows and job statuses, with placeholder results creation if no artifacts are found. Updated artifact upload step for clarity. 2025-06-26 10:06:30 -06:00
Cole McIntosh
d5d0dfc26f Add GitHub Actions workflow for LLM translation testing artifacts 2025-06-26 10:05:33 -06:00
Ishaan Jaff
22ff3da3cf
[Fix] Allow using HTTP_ Proxy settings with trust_env (#12066)
* allow using trust_env

* add docs on how to use HTTP_PROXY

* docs AIOHTTP_TRUST_ENV

* test_aiohttp_transport_trust_env_setting

* docs fix
2025-06-26 08:37:22 -07:00
Cole McIntosh
327405ffae
Merge pull request #12050 from colesmcintosh/docs/elasticsearch-logging-tutorial
Fix Elasticsearch tutorial image rendering
2025-06-26 09:00:00 -06:00
Krrish Dholakia
23018bd0a2 build(pyproject.toml): bump version 2025-06-26 07:58:29 -07:00
Ishaan Jaff
f8f9e2299b docs latency headers 2025-06-26 07:58:23 -07:00
Ishaan Jaff
bb86619605 Revert "Revert "add google generate content to call types""
This reverts commit b2d4462ab5.
2025-06-25 22:43:07 -07:00
Krrish Dholakia
c3857e60f2 Store batch output file id in DB + Store batch file status in DB + (experimental) BATCH API COST TRACKING 2025-06-25 22:41:22 -07:00
Ishaan Jaff
329f8ec7a6 docs gemini cli 2025-06-25 22:39:50 -07:00
Ishaan Jaff
bca94535da docs gemini cli 2025-06-25 22:31:47 -07:00
Ishaan Jaff
5ebdb58115 bump: version 1.73.2 → 1.73.3 2025-06-25 22:26:59 -07:00
Ishaan Jaff
b2d4462ab5 Revert "add google generate content to call types"
This reverts commit 6f57dde293.
2025-06-25 22:26:34 -07:00
Ishaan Jaff
5b8e300150
[Feat] gemini-cli integration - Add Logging + Cost tracking for stream + non-stream Vertex / Google AI Studio routes (#12058)
* add google generate content to call types

* Revert "add google generate content to call types"

This reverts commit 6f57dde293.

* add CallTypesLiteral for gemini

* allow passing model to vertexpass through logging handler

* update logging handler

* fix checking if stream

* add async streaming logging for vtx

* refactor _transform_google_generate_content_to_openai_model_response

* fix logging_obj

* fixes _handle_non_streaming_google_genai_generate_content_response_logging

* logging callback tests

* ruff check fixes

* test _is_streaming_request

* test_ensure_initialize_azure_sdk_client_always_used

* fix BaseGoogleGenAIGenerateContentStreamingIterator

* fix - linting errors

* req - add google-genai
2025-06-25 22:26:20 -07:00
Krish Dholakia
1a7fd1d1c7
Litellm dev 06 25 2025 p2 (#12049)
* test(test_router.py): initial unit test confirming router.afile_content uses dynamic api key / api base

* fix(managed_files.py): filter deployments for only those within file id mapping

ensure call works - only route to models where the file was written

* fix(proxy_server.py): fix loading in model ids from config, if config id is int

* fix(router.py): return all model file id mappings on create_file

if multiple deployments - this ensures all the file id mappings are bubbled up

Fixes issue when trying to use loadbalanced deployments - only 1 file id mapping was being stored

* feat(router_utils/common_utils.py): filter models by team id when selecting for routing

Prevents team only models from being used by other teams

* fix(common_utils.py): additional fixes around filtering team-based models

* fix(batches_endpoints/endpoints): support list batches with target model names specified

* fix(common_utils.py): more testing for team deployment filters
2025-06-25 21:54:13 -07:00
Krish Dholakia
e2f6fb2d7c
Managed Files + Batches - filter deployments to only those where file was written + save all model file id mappings in DB (prev just 1st one) (#12048)
* test(test_router.py): initial unit test confirming router.afile_content uses dynamic api key / api base

* fix(managed_files.py): filter deployments for only those within file id mapping

ensure call works - only route to models where the file was written

* fix(proxy_server.py): fix loading in model ids from config, if config id is int

* fix(router.py): return all model file id mappings on create_file

if multiple deployments - this ensures all the file id mappings are bubbled up

Fixes issue when trying to use loadbalanced deployments - only 1 file id mapping was being stored
2025-06-25 21:27:06 -07:00
Ishaan Jaff
de86246e14 test fixes 2025-06-25 18:42:06 -07:00
Ishaan Jaff
14d05fe422
[Feat] Add gemini-cli support - call VertexAI models through LiteLLM Native gemini routes (#12053)
* init litellm google gen ai methods

* feat init structure of functions for generate content

* add init

* add BaseGoogleGenAIGenerateContentConfig

* add generate_content_handler

* add get_provider_google_genai_generate_content_config

* fixes for generate content

* add get_vertex_ai_project etc to base

* use VertexBase

* fixes for BaseGoogleGenAIGenerateContentConfig

* working validate env for google gemini

* feat - add transform google response

* fixes for transform_generate_content_request

* fix get_supported_generate_content_optional_params

* add BaseGoogleGenAITest

* working e2e test

* fixes init config

* use correct types

* fix test for google gen ai

* fix types

* add sync_get_auth_token_and_url

* fixes for transform

* add llm http handler for google

* working non-streaming google endpoints

* add BaseGoogleGenAIGenerateContentStreamingIterator

* add GoogleGenAIGenerateContentStreamingIterator

* fix working sync stream

* fixes for litellm logging obj

* working async streaming

* add google gen ai types

* fix - required imports

* fix readme

* fix deps

* fix deps

* fix ruff code QA checks

* fix linting

* fixes TYPE_CHECKING

* fixes for typing

* add google gemini methods to litellm router

* [Feat] Add initial endpoints for using Gemini SDK (gemini-cli) with LiteLLM (#12040)

* init with google endpoints

* add Depends

* feat - add gemini endpoints

* google_generate_content

* fix init

* fixes import

* fixes for streaming

* fixes for sync/async

* working streaming with google gemini cli

* add google endpoints to llm api routes

* add VertexAIGoogleGenAIConfig

* use aiter_bytes

* use common request for streaming data

* re-use logic for anthropic streaming

* add GoogleAIStudioDataGenerator
2025-06-25 18:39:25 -07:00
Ishaan Jaff
35e46784d3
[Feat] Add Support for calling Gemini/Vertex models in their native format (#12046)
* init litellm google gen ai methods

* feat init structure of functions for generate content

* add init

* add BaseGoogleGenAIGenerateContentConfig

* add generate_content_handler

* add get_provider_google_genai_generate_content_config

* fixes for generate content

* add get_vertex_ai_project etc to base

* use VertexBase

* fixes for BaseGoogleGenAIGenerateContentConfig

* working validate env for google gemini

* feat - add transform google response

* fixes for transform_generate_content_request

* fix get_supported_generate_content_optional_params

* add BaseGoogleGenAITest

* working e2e test

* fixes init config

* use correct types

* fix test for google gen ai

* fix types

* add sync_get_auth_token_and_url

* fixes for transform

* add llm http handler for google

* working non-streaming google endpoints

* add BaseGoogleGenAIGenerateContentStreamingIterator

* add GoogleGenAIGenerateContentStreamingIterator

* fix working sync stream

* fixes for litellm logging obj

* working async streaming

* add google gen ai types

* fix - required imports

* fix readme

* fix deps

* fix deps

* fix ruff code QA checks

* fix linting

* fixes TYPE_CHECKING

* fixes for typing
2025-06-25 18:37:03 -07:00