Skip to content

Commit d3ff740

Browse files
committed
fix: update CLI to use new OpenAI-format Model type
The Stainless-regenerated Model type no longer has model_type, identifier, provider_resource_id, metadata, or provider_id as direct attributes. These are now in custom_metadata dict. Signed-off-by: Charlie Doern <cdoern@redhat.com>
1 parent 9d4c603 commit d3ff740

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/llama_stack_client/lib/cli/inference/inference.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def chat_completion(ctx, message: str, stream: bool, session: bool, model_id: Op
4040
console = Console()
4141

4242
if not model_id:
43-
available_models = [model.identifier for model in client.models.list() if model.model_type == "llm"]
43+
available_models = [
44+
model.id
45+
for model in client.models.list()
46+
if (model.custom_metadata or {}).get("model_type") == "llm"
47+
]
4448
model_id = available_models[0]
4549

4650
messages = []

src/llama_stack_client/lib/cli/models/models.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ def list_models(ctx):
5151
table.add_column("provider_id", style="green", max_width=20)
5252

5353
for item in response:
54+
cm = item.custom_metadata or {}
5455
table.add_row(
55-
item.model_type,
56-
item.identifier,
57-
item.provider_resource_id,
58-
str(item.metadata or ""),
59-
item.provider_id,
56+
str(cm.get("model_type", "")),
57+
item.id,
58+
str(cm.get("provider_resource_id", "")),
59+
str(cm.get("metadata", "")),
60+
str(cm.get("provider_id", "")),
6061
)
6162

6263
# Create a title for the table

0 commit comments

Comments
 (0)