Skip to content

[cli] llama-stack-client models register passed to server as a string (needs to be dict) #216

@mattf

Description

@mattf

System Info

llama stack 0.1.9
incidental: ollama provider w/ ollama 0.6.3

Information

  • The official example scripts
  • My own modified scripts

🐛 Describe the bug

$ uv run llama-stack-client models register all-MiniLM-L6-v2 --provider-model-id all-minilm:latest --metadata '{"field": "value"}'

╭────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Failed to register model                                                                       │
│                                                                                                │
│ Error Type: BadRequestError                                                                    │
│ Details: Error code: 400 - {'error': {'detail': {'errors': [{'loc': ['body', 'metadata'],      │
│ 'msg': 'Input should be a valid dictionary', 'type': 'dict_type'}]}}}                          │
╰────────────────────────────────────────────────────────────────────────────────────────────────╯

the --metadata param is a string, see https://github.com/meta-llama/llama-stack-client-python/blob/7e00b784ee859aa04aa11955e3888e5167331dfe/src/llama_stack_client/lib/cli/models/models.py#L109

the server expects a dict, see https://github.com/meta-llama/llama-stack/blob/19f504e9e267759c489af287049d479176730d27/docs/_static/llama-stack-spec.yaml#L4855

Error logs

15:03:23.223 [START] /v1/models
Traceback (most recent call last):
  File ".../lib64/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File ".../lib64/python3.10/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
  File ".../lib64/python3.10/site-packages/fastapi/routing.py", line 346, in app
    raise validation_error
fastapi.exceptions.RequestValidationError: [{'type': 'dict_type', 'loc': ('body', 'metadata'), 'msg': 'Input should be a valid dictionary', 'input': '{"field": "value"}'}]
INFO:     ::1:60438 - "POST /v1/models HTTP/1.1" 400 Bad Request

Expected behavior

cli to convert metadata to type expected by server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions