Commit graph

14665 commits

Author SHA1 Message Date
Krish Dholakia
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
Krrish Dholakia
92e841e311 fix: fix test 2025-09-18 23:37:38 -07:00
Tim Elfrink
f5e6246143 Add test for gemini-2.5-flash-image-preview fix
- Test validates correct endpoint routing to :generateContent
- Mock HTTP responses to avoid API limits
- Verify request format uses Gemini contents structure
- Ensure image generation functionality works correctly
2025-09-19 08:06:01 +02:00
Ishaan Jaff
80bd8e007f
fix contributor PR linting failing (#14710)
* validate fix

* fix linting error
2025-09-18 20:03:27 -07:00
Krish Dholakia
9a6b1651d2
Merge pull request #14707 from ARajan1084/bedrock-guardrail-silent-failure-correction
fix: Bedrock guardrail silent failure correction
2025-09-18 20:03:17 -07:00
Krish Dholakia
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
Ishaan Jaffer
725cf3627d fix: license check.ini 2025-09-18 19:28:07 -07:00
Krrish Dholakia
4d87199266 fix(prometheus.py): fix spend metrics 2025-09-18 19:12:07 -07:00
Krrish Dholakia
aa7839e4cb fix: fix test 2025-09-18 19:02:52 -07:00
Krish Dholakia
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
Alexsander Hamir
60800698f2
feature: generic object pool (#14702)
* add: generic object pool & tests

Introduced a reusable object pool that can be applied across the codebase.
Note: memory growth is managed via eviction settings—using a hard cap could
reduce performance, so eviction is the preferred safeguard.

* fix: simpler tests
2025-09-18 18:32:45 -07:00
Krish Dholakia
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
Alexsander Hamir
59409429d4
fix: reduced __inits__ overhead in 7% (#14689)
* fix: avoid redundant __init__ calls on hot path

Previously, imports on the request hot path caused __init__ to run
excessively for every request. This change ensures initialization
happens once, reducing cpu overhead.

* fix: remove redundant __init__ import

The current implementation no longer requires an import at the top of the function.

* fix: placed on core utils for future reuse

* test: add coverage & remove inline import

A general import-checking tool across all endpoints would be a large PR.
This commit focuses on a smaller, targeted fix for the discussed case.

* added import check to CI
2025-09-18 17:18:05 -07:00
Ishaan Jaff
4c983f985a
[Feat] Add Bedrock Twelve Labs embedding provider support (#14697)
* fix: add 12 labs to bedrock embedding

* fix: get_bedrock_embedding_provider

* test: test_text_embedding

* fix: 12 labs embedding transform

* fix: refactor 12 labs transform logic

* fix: test_e2e_bedrock_embedding

* fix: test_e2e_bedrock_embedding

* feat: add bedrock twelvelabs pricing

* DOCS: docs bedrock embedding

* DOCS: 12 labs bedrock overview

* fix: bedrock embeddings 12 labs
2025-09-18 17:16:45 -07:00
katsuhiro muto
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
Mubashir Osmani
a7a6381926
fix: flaky passthrough tests (#14692)
* fix: flaky passthrough tests

* Revert "fix: flaky passthrough tests"

This reverts commit ffe692e017.

* fix: serialize prisma objects
2025-09-18 15:35:14 -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
Fabrício Ceschin
56f7111a57
Merge branch 'BerriAI:main' into LangfuseUsageDetails 2025-09-18 15:21:11 -04: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
Ishaan Jaffer
e733b619db fix: test_user_email_in_all_required_metrics 2025-09-18 11:23:13 -07:00
Sameer Kankute
36bedc69ff
Add TwelveLabs marengo model (#14674) 2025-09-18 11:21:35 -07:00
Sameer Kankute
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
Ishaan Jaffer
e0bbc3f46b fix: test_cohere_request_body_with_allowed_params 2025-09-18 10:56:45 -07:00
Ishaan Jaffer
8296bfb866 fix: test metrics 2025-09-18 10:25:22 -07:00
Ishaan Jaffer
c6afa904bb fix: test_completion_with_no_model 2025-09-18 10:17:09 -07:00
Ishaan Jaffer
1e1d174733 fix: test_completion_with_no_model 2025-09-18 10:13:32 -07:00
Ishaan Jaffer
706b9214c0 fix: test_init_kwargs_for_pass_through_endpoint_basic 2025-09-18 07:59:05 -07:00
Ishaan Jaffer
3018c66867 fix: test_awesome_otel_with_message_logging_off 2025-09-18 07:49:39 -07:00
Fabrício Ceschin
cb3bed1d96
Merge branch 'BerriAI:main' into LangfuseUsageDetails 2025-09-18 09:38:52 -04: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
Tim Elfrink
27a37ce57e Use requestMetadata parameter name for consistency with other Bedrock params
- Change parameter from request_metadata to requestMetadata to match camelCase convention
- Consistent with guardrailConfig and performanceConfig naming pattern
- Update all references in transformation code and error messages
- Update tests and documentation to use correct parameter name
- Fix type checking for parameter validation
2025-09-18 09:21:45 +02:00
Tim Elfrink
1d85623b66 Add comprehensive tests for Bedrock Converse requestMetadata support
- Test requestMetadata parameter support in get_supported_openai_params
- Test transformation to top-level field in Bedrock API request
- Test validation of AWS constraints: max 16 items, key/value length limits
- Test character set validation for keys and values
- Cover edge cases including empty values and special characters
- Ensure compatibility with existing test patterns
2025-09-18 09:21:45 +02:00
Krish Dholakia
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 Dholakia
ff36dfdc76
Merge pull request #14637 from akraines/feature/middle-truncate-spend-logs
feat: implement middle-truncation for spend log payloads
2025-09-17 23:47:04 -07:00
Krish Dholakia
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 Hamir
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