litellm/tests/litellm_utils_tests
Chris Gibbons 2bef7c3662
fix: Preserve Bedrock inference profile IDs in health checks (#15947)
* fix: Preserve Bedrock inference profile IDs in health checks

- Fixes issue where health checks were stripping inference profile IDs
- Preserves cross-region inference profile prefixes (us., eu., apac., jp., au., us-gov., global.)
- Strips only AWS region routing while preserving routes and handlers
- Resolves both issue #15807 and inference profile requirement errors
- Adds comprehensive tests for all Bedrock model format combinations

Issue #15807 attempted to fix regional Bedrock model health checks but was too
aggressive, stripping cross-region inference profile prefixes that AWS requires.
This caused errors: "Invocation of model ID X with on-demand throughput isn't
supported. Retry your request with the ID or ARN of an inference profile."

The fix now correctly:
- Strips AWS regions (us-west-2, eu-central-1, etc.) from routing
- Preserves CRIS prefixes (us., eu., etc.) required by AWS
- Preserves routes (converse/, invoke/)
- Preserves handlers (llama/, deepseek_r1/)
- Only affects Bedrock models (checked via startswith)

Test coverage includes 20+ scenarios for all Bedrock model format combinations.

* Remove unused traceback import
2025-10-27 19:44:45 -07:00
..
conftest.py (Feat) Add x-litellm-overhead-duration-ms and "x-litellm-response-duration-ms" in response from LiteLLM (#7899) 2025-01-21 20:27:55 -08:00
log.txt Allow passing thinking param to litellm proxy via client sdk + Code QA Refactor on get_optional_params (get correct values) (#9386) 2025-04-07 21:04:11 -07:00
test_aiohttp_handler.py [Feat] Use aiohttp transport by default - 97% lower median latency (#11097) 2025-05-23 22:55:35 -07:00
test_aws_secret_manager.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_get_secret.py (Feat) Add x-litellm-overhead-duration-ms and "x-litellm-response-duration-ms" in response from LiteLLM (#7899) 2025-01-21 20:27:55 -08:00
test_hashicorp.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_health_check.py fix: Preserve Bedrock inference profile IDs in health checks (#15947) 2025-10-27 19:44:45 -07:00
test_litellm_overhead.py [Feat] LiteLLM Overhead metric tracking - Add support for tracking litellm overhead on cache hits (#15045) 2025-09-29 17:33:27 -07:00
test_logging_callback_manager.py fix slack alerts (#12464) 2025-07-10 08:58:47 -07:00
test_proxy_budget_reset.py Prevent writing default user setting updates to yaml (error in non-root env) + Use central team member budget when max_budget_in_team set on UI (#12533) 2025-07-12 10:13:07 -07:00
test_secret_manager.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_utils.py test_models_by_provider 2025-10-23 09:10:41 -07:00
test_validate_tool_choice.py fix: support Cursor IDE tool_choice format {"type": "auto"} (#12168) 2025-06-30 12:39:58 -07:00
vertex_key.json (Feat) Add x-litellm-overhead-duration-ms and "x-litellm-response-duration-ms" in response from LiteLLM (#7899) 2025-01-21 20:27:55 -08:00