Commit f3f4515
authored
fix: model register missing model-type and not accepting metadata (#11)
# What does this PR do?
Added the ability to specify the model type when registering models.
Also fixed a bug with passing metadata which would result in the
following error:
```
Error Type: BadRequestError │
│ Details: Error code: 400 - {'error': {'detail': {'errors': [{'loc': ['body', 'metadata'], 'msg': 'Input should be a valid dictionary', 'type': 'dict_type'}]}}}
```
Closes: #215
## Test Plan
Run the following commands
```
# Note a Llama Stack Server must be running
# Create a venv
uv sync --python 3.12
# Install the LSC with the new code changes
uv pip install -e .
# List the available models
llama-stack-client models list
# Register the granite-embedding-30m embedding model NOTE must have sentence-transformers as an inference provider
llama-stack-client models register granite-embedding-30m --provider-id "sentence-transformers" --provider-model-id ibm-granite/granite-embedding-30m-english --metadata '{"embedding_dimension": 384}' --model-type embedding
# Verify the embedding model added are present
llama-stack-client models list
```1 parent 745a94e commit f3f4515
1 file changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
101 | | - | |
| 112 | + | |
| 113 | + | |
102 | 114 | | |
103 | 115 | | |
104 | 116 | | |
| |||
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
| 122 | + | |
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| |||
117 | 130 | | |
118 | 131 | | |
119 | 132 | | |
| 133 | + | |
120 | 134 | | |
121 | 135 | | |
122 | 136 | | |
| |||
0 commit comments