mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-03 21:02:38 +00:00
fix review around /models api call
This commit is contained in:
parent
6a96b6c264
commit
9c42598aee
1 changed files with 1 additions and 5 deletions
|
@ -312,12 +312,8 @@ class VLLMInferenceAdapter(Inference, ModelsProtocolPrivate):
|
||||||
HealthResponse: A dictionary containing the health status.
|
HealthResponse: A dictionary containing the health status.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
headers = {}
|
|
||||||
client = self._create_client() if self.client is None else self.client
|
client = self._create_client() if self.client is None else self.client
|
||||||
if client.api_key:
|
client.models.list() # Ensure the client is initialized
|
||||||
headers["Authorization"] = f"Bearer {client.api_key}"
|
|
||||||
models_url = f"{client.base_url}models"
|
|
||||||
requests.get(models_url, headers=headers, timeout=10)
|
|
||||||
return HealthResponse(
|
return HealthResponse(
|
||||||
status=HealthStatus.OK
|
status=HealthStatus.OK
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue