mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-13 04:22:35 +00:00
review: collect model ids to include in raise error message
This commit is contained in:
parent
24c6b01d16
commit
0ecfdc6dff
1 changed files with 6 additions and 5 deletions
|
|
@ -82,11 +82,12 @@ class VLLMInferenceAdapter(OpenAIMixin):
|
||||||
Skip the check when running without authentication.
|
Skip the check when running without authentication.
|
||||||
"""
|
"""
|
||||||
if not self.config.api_token:
|
if not self.config.api_token:
|
||||||
try:
|
model_ids = []
|
||||||
return model in [m.id async for m in self.client.models.list()]
|
async for m in self.client.models.list():
|
||||||
except Exception as e:
|
if m.id == model: # Found exact match
|
||||||
log.warning(f"Failed to check model availability: {e}")
|
return True
|
||||||
raise ValueError(f"Failed to check model availability: {e}") from e
|
model_ids.append(m.id)
|
||||||
|
raise ValueError(f"Model '{model}' not found. Available models: {model_ids}")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
async def openai_chat_completion(
|
async def openai_chat_completion(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue