Skip to content

Commit 126f1db

Browse files
committed
Use the llamastack identifier for the model id, not the provider's model id
1 parent c8175a8 commit 126f1db

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/app/endpoints/query.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,14 @@ def select_model_and_provider_id(
171171
},
172172
) from e
173173

174-
llama_stack_model_id = f"{provider_id}/{model_id}"
175174
# Validate that the model_id and provider_id are in the available models
176175
logger.debug("Searching for model: %s, provider: %s", model_id, provider_id)
177-
if not any(
178-
m.identifier == llama_stack_model_id and m.provider_id == provider_id
179-
for m in models
180-
):
176+
177+
def check_model(m):
178+
logger.debug("Available model - model_identifier: %s, provider_model_id: %s, provider_id: %s", m.identifier, m.provider_resource_id, m.provider_id)
179+
return m.identifier == model_id and m.provider_id == provider_id
180+
181+
if not any(check_model(m) for m in models):
181182
message = f"Model {model_id} from provider {provider_id} not found in available models"
182183
logger.error(message)
183184
raise HTTPException(
@@ -188,7 +189,7 @@ def select_model_and_provider_id(
188189
},
189190
)
190191

191-
return llama_stack_model_id, provider_id
192+
return model_id, provider_id
192193

193194

194195
def _is_inout_shield(shield: Shield) -> bool:

0 commit comments

Comments
 (0)