mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
fix: resolve bedrock base model to cost map key in test_get_model_info_bedrock_models
get_base_model() returns model id without 'bedrock/' prefix; cost map keys use 'bedrock/<model>'. Resolve base_model to actual key (try base_model then bedrock/base_model) and skip when not in map to fix KeyError for moonshotai.kimi-k2-thinking.
This commit is contained in:
parent
ebd4f3d947
commit
7df89930b4
1 changed files with 9 additions and 1 deletions
|
|
@ -311,7 +311,15 @@ def test_get_model_info_bedrock_models():
|
|||
for commitment in potential_commitments:
|
||||
k = k.replace(f"{commitment}/", "")
|
||||
base_model = BedrockModelInfo.get_base_model(k)
|
||||
base_model_info = litellm.model_cost[base_model]
|
||||
# get_base_model() returns model id without "bedrock/" prefix; cost map keys use "bedrock/<model>"
|
||||
base_model_key = (
|
||||
base_model
|
||||
if base_model in litellm.model_cost
|
||||
else f"bedrock/{base_model}"
|
||||
)
|
||||
if base_model_key not in litellm.model_cost:
|
||||
continue
|
||||
base_model_info = litellm.model_cost[base_model_key]
|
||||
for base_model_key, base_model_value in base_model_info.items():
|
||||
if "invoke/" in k:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue