mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
Merge 8bca92b644 into 4cdfaaa334
This commit is contained in:
commit
63798a76c1
1 changed files with 10 additions and 0 deletions
|
|
@ -2346,6 +2346,16 @@ def get_model_from_request(
|
|||
if vertex_match:
|
||||
model = vertex_match.group(1)
|
||||
|
||||
# Watsonx routes carry the deployment name under "model_id" (the native
|
||||
# Watsonx ML API shape). The generic "model" body key can also be set by
|
||||
# the caller, but Watsonx executes model_id; both must be authorized,
|
||||
# so model_id is checked whenever present on a /watsonx route,
|
||||
# regardless of whether "model" already resolved.
|
||||
if route.lower().startswith("/watsonx"):
|
||||
watsonx_model: Final = request_data.get("model_id")
|
||||
if isinstance(watsonx_model, str) and watsonx_model:
|
||||
return watsonx_model
|
||||
|
||||
if route.lower().startswith("/bedrock"):
|
||||
bedrock_model: Final = _model_from_bedrock_route(route)
|
||||
return model if bedrock_model is None else bedrock_model
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue