Commit Graph
891 Commits
Author SHA1 Message Date
Ishaan Jaffer ed5c9f1c69 test fixes for mapped tests 2025-09-19 18:01:36 -07:00
Krish DholakiaandGitHub 6142c3ac3d Merge pull request #14738 from BerriAI/litellm_dev_09_19_2025_p1
UI SSO - consider token info endpoint on generic SSO route for access control groups
2025-09-19 17:58:37 -07:00
Ishaan Jaffer c3f150b13d mcp test fix 2025-09-19 17:41:15 -07:00
Krrish Dholakia 7694e9f6a9 test: refactoring + testing 2025-09-19 17:20:15 -07:00
Ishaan JaffGitHubCopilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
90ee9e4587 [Feat] Dynamic Rate Limiter v3 - fixes to ensure priority routing works as expected (#14734)
* fix: dynamic limiter v3

* fix: dynamic limiter v3

* feat: add dynamic limiter v3

* feat: add dynamic limiter v3

* feat: add dynamic limiter v3 in init litellm_logging

* feat: add dynamic limiter v3 in init litellm_logging

* fix: priority rate limiting

* Potential fix for code scanning alert no. 3397: Clear-text logging of sensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix: priority rate limiting

* fix: ruff

* fix: mypy lint

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-09-19 16:04:45 -07:00
Felipe GaréandGitHub a696ffe4a6 Litellm gemini batch (#14733)
* feat: add Vertex AI support for file content retrieval

- Extended `custom_llm_provider` to include "vertex_ai" in `afile_content` function.
- Implemented file content retrieval logic for Vertex AI in `VertexAIFilesHandler`.
- Added helper method to extract bucket and object from URL-encoded file_id.
- Created comprehensive unit and integration tests for Vertex AI file handling.
- Updated transformation logic to ensure compatibility with Vertex AI file responses.

* fix: update Vertex AI file transformation logic

- Modified the transformation logic in `VertexAIFilesConfig` to return a newline-separated JSON string for batch JSONL files instead of a array if JSON strings.

* fix: enhance Vertex AI output handling in transformation logic

- Updated the transformation logic in `VertexAIBatchTransformation` to utilize the new `OutputInfo` TypedDict for retrieving the GCS output directory.
- Added `OutputInfo` class to type definitions for better structure and clarity in Vertex AI responses.
2025-09-19 15:22:52 -07:00
Max FalkandGitHub 12da4039b9 fix: Prevent AttributeError for _get_tags_from_request_kwargs (#14735)
* fix: avoid NoneType AttributeError when extracting tags

I've been running into this error:
```
21:47:08 - LiteLLM:ERROR: litellm_logging.py:2396 - LiteLLM.LoggingError: [Non-Blocking] Exception occurred while success logging Traceback (most recent call last):

  File "/usr/lib/python3.13/site-packages/litellm/litellm_core_utils/litellm_logging.py", line 2312, in async_success_handler

    await callback.async_log_success_event(

    ...<6 lines>...

    )

  File "/usr/lib/python3.13/site-packages/litellm/router_strategy/budget_limiter.py", line 396, in async_log_success_event

    request_tags = _get_tags_from_request_kwargs(kwargs)

  File "/usr/lib/python3.13/site-packages/litellm/router_strategy/tag_based_routing.py", line 144, in _get_tags_from_request_kwargs

    return _metadata.get("tags", [])

           ^^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'get' 
```

This makes the function more resilient without resorting to try catch.

* add tests

Signed-off-by: Max Falk <gmdfalk@gmail.com>

---------

Signed-off-by: Max Falk <gmdfalk@gmail.com>
2025-09-19 15:21:02 -07:00
Krish DholakiaandGitHub aa54994994 Merge pull request #14666 from michaeltansg/feat/add-bangkok-timezone
Added Indochina Time timezone support for budget resets
2025-09-18 23:41:27 -07:00
Krish DholakiaandGitHub f5838594e0 Merge pull request #14675 from tcx4c70/fix/response-price
fix: cost calculation for responses
2025-09-18 23:41:08 -07:00
Krish DholakiaandGitHub ad6ba8f5c5 Merge pull request #14695 from uc4w6c/fix/mcp-gateway-tools-list
Fix/mcp gateway tools list
2025-09-18 23:40:14 -07:00
Krish DholakiaandGitHub d5a839d971 Merge pull request #14700 from BerriAI/litellm_contributor_prs_09_18_2025_p2
Update Bedrock documentation for Titan V2 encoding_format support + Anthropic - account for 1h vs. 5m cache creation token cost difference + UI - add langsmith_sampling_rate as a dynamic param
2025-09-18 23:38:29 -07:00
Krish DholakiaandGitHub 664c83cfb5 Merge branch 'litellm_contributor_prs_09_18_2025_p2' into litellm_dev_09_17_2025_p2_v2 2025-09-18 19:50:55 -07:00
= 14b3cc2f95 Update test_bedrock_guardrails.py 2025-09-18 19:48:16 -07:00
= ed4bd504ea Revert "removed unnecessary test"
This reverts commit ad663e5240.
2025-09-18 19:45:13 -07:00
= ad663e5240 removed unnecessary test 2025-09-18 19:37:15 -07:00
Krish DholakiaandGitHub f387803655 Merge pull request #14658 from ARajan1084/bedrock-custom-guardrail-fix
fix: check for AWS exceptions despite a 200 response
2025-09-18 18:34:32 -07:00
Krish DholakiaandGitHub 63c26d7a4f Merge branch 'litellm_contributor_prs_09_18_2025_p2' into fix/issue-14685-bedrock-titan-v2-encoding-format 2025-09-18 17:54:33 -07:00
katsuhiro mutoandGitHub ec61a7152a Support for is_streamed_request widh datadog (#14673) 2025-09-18 15:55:16 -07:00
= a3f0a3c05f Update test_bedrock_guardrails.py 2025-09-18 15:51:42 -07:00
= 911918474a removed duplicate code 2025-09-18 15:49:16 -07:00
Yuta Saito 7f8b1d0708 test: fix failing tests after conflict resolution 2025-09-19 07:48:37 +09:00
= 917c8bb43c Update test_bedrock_guardrails.py 2025-09-18 15:42:41 -07:00
= a86b9a1808 check for AWS exceptions despite a 200 response 2025-09-18 15:42:36 -07:00
Yuta Saito 654f1d3290 fix: stop including spec_version in MCP server registration inserts 2025-09-19 07:06:15 +09:00
Yuta Saito 6c291093e9 fix: remove adding Mcp-Protocol-Version header (#14069)
The Mcp-Protocol-Version header is already handled in the MCP Python SDK, so the explicit addition on LiteLLM Proxy was redundant.
2025-09-19 07:05:20 +09:00
Tim Elfrink b100328435 Add test coverage for Bedrock Titan V2 encoding_format parameter
- Test encoding_format='float' parameter mapping and response handling
- Test encoding_format='base64' parameter mapping to binary format
- Verify parameter transformation and response processing
- Mock AWS API responses for both float and binary formats
- Ensure OpenAI compatibility with new encoding_format support
2025-09-18 20:24:41 +02:00
Sameer KankuteandGitHub 36bedc69ff Add TwelveLabs marengo model (#14674) 2025-09-18 11:21:35 -07:00
Sameer KankuteandGitHub d213a2e066 correct the gaurdcontent name (#14684)
* correct the gaurdcontent name

* correct the gaurdcontent name

* fix model required error in test

* Add correct model
2025-09-18 11:00:19 -07:00
Adam Tao 9b0eaf0989 test: add a testcase for cached_tokens
Signed-off-by: Adam Tao <tcx4c70@gmail.com>
2025-09-18 18:40:11 +08:00
Michael Tan 6721189b7c feat: add Asia/Bangkok timezone support for budget resets
- Add Asia/Bangkok (UTC+7) to timezone_map in duration_parser.py
- Update documentation to include Bangkok in common timezone values
- Add test case to verify Bangkok timezone functionality
2025-09-18 14:56:12 +07:00
Krish DholakiaandGitHub bfaab8ad7e Merge pull request #14557 from timelfrink/fix/issue-14478-bedrock-count-tokens-endpoint
Implement AWS Bedrock CountTokens API support
2025-09-17 23:51:06 -07:00
Krish DholakiaandGitHub e7bc700b20 Merge pull request #14640 from Sameerlite/litellm_gardrail_default_latest_message
[Feat]Add last message as default in gaurdrail
2025-09-17 23:42:40 -07:00
Tim Elfrink c234b13275 Apply code formatting and linting fixes
- Apply Black formatting to all Bedrock CountTokens files
- Clean up imports and remove unused variables in tests
- Fix indentation and simplify test structure
- Fix pyright type error with type ignore annotation
- All tests continue to pass after cleanup
2025-09-18 08:28:17 +02:00
Tim Elfrink e74ac35b5d Add comprehensive tests for Bedrock CountTokens functionality
- Add endpoint integration test in test_proxy_token_counter.py
- Add unit tests for transformation logic in bedrock/count_tokens/
- Test model extraction from request body vs endpoint path
- Test input format detection (converse vs invokeModel)
- Test request transformation from Anthropic to Bedrock format
- All tests follow existing codebase patterns and pass successfully
2025-09-18 08:16:56 +02:00
Sameerlite edf95966c9 Handle consecutive user messages 2025-09-18 10:35:25 +05:30
Alexsander HamirandGitHub 8d96626044 fix: iscoroutine removed from hot path +50 RPS (#14649)
* fix: iscoroutine removed from hot path

* fix: replace all instances & separate concerns

1. Replaced all instances of iscoroutine with is_async_callable
2. Place the coroutine checker in its own file

* fix: PR comment changes

* fix: missing config setting declaration

* fix: revert non-performance related changes

* fix: revert to initial implementation

* fix: remove dead const
2025-09-17 19:01:43 -07:00
Krrish Dholakia 7a1f723751 test: update test 2025-09-17 18:00:59 -07:00
=andKrrish Dholakia 40fa415c89 added test for updating in memory guardrails 2025-09-17 18:00:59 -07:00
Krrish Dholakia fc18f4decf test: add unit testing 2025-09-17 18:00:59 -07:00
Krrish Dholakia 4276d78169 test: fix test on ci/cd 2025-09-17 18:00:58 -07:00
Krrish Dholakia 00d8dedd16 test: update test 2025-09-17 17:44:14 -07:00
Krish DholakiaandGitHub 44e0c730b9 Merge pull request #14653 from ARajan1084/in-memory-guardrail-fix
fix: In Memory Guardrail fails to update
2025-09-17 17:42:23 -07:00
Krrish Dholakia adc71ad2e7 fix(langsmith.py): add langsmith_sampling_rate as a dynamic param
Closes LIT-879
2025-09-17 17:32:26 -07:00
= 268b984cb6 added test for updating in memory guardrails 2025-09-17 17:16:49 -07:00
Krish DholakiaandGitHub f51003538a Merge pull request #14650 from BerriAI/litellm_dev_09_17_2025_p1
Bedrock Guardrails - support setting bedrock runtime endpoint + Protect `/health/test_connect` to prevent users without model creation permissions from calling it
2025-09-17 16:55:53 -07:00
Krrish Dholakia 1954bbffc0 test: fix test on ci/cd 2025-09-17 16:53:07 -07:00
Krrish Dholakia 2f45c7ffd3 feat(anthropic/chat/transformation.py): account for 1h vs. 5m cache creation token cost difference
Closes LIT-907
2025-09-17 16:16:20 -07:00
Krish DholakiaandGitHub 895c41efa3 Merge pull request #14619 from BerriAI/litellm_dev_09_16_2025_p1
UI - allow team member to view service account keys they create + Anthropic - include cache creation tokens in prompt token total (separate out during cost tracking)
2025-09-17 15:43:04 -07:00
Krrish Dholakia 530662d735 test: add unit testing 2025-09-17 14:54:44 -07:00
Sameer KankuteandGitHub 69c01488bd remove not needed names (#14641) 2025-09-17 14:26:48 -07:00