feat(bedrock): add OpenAI-compatible service_tier parameter translation #18091
+109
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relevant issues
Related to #17911 and #17810
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitType
🆕 New Feature
Changes
Summary
Adds OpenAI-compatible
service_tierparameter support for Bedrock Converse API, translating it to Bedrock's nativeserviceTierformat.Currently, using the OpenAI-style
service_tierparameter with Bedrock models throwsUnsupportedParamsError:Solution
service_tiertosupported_paramsinget_supported_openai_params()map_openai_params()that converts:service_tier="priority"→serviceTier={"type": "priority"}service_tier="default"→serviceTier={"type": "default"}service_tier="flex"→serviceTier={"type": "flex"}service_tier="auto"→serviceTier={"type": "default"}(Bedrock doesn't support "auto")Usage
Tests
Added 5 new tests in
tests/test_litellm/llms/bedrock/chat/test_service_tier.py:test_service_tier_in_supported_openai_paramstest_map_openai_service_tier_prioritytest_map_openai_service_tier_defaulttest_map_openai_service_tier_flextest_map_openai_service_tier_auto_maps_to_default12 tests passing: