try-this-model / readme-generator /cache-working-models.sh
wxgeorge's picture
:sparkles: script to auto-generate model annotations.
caba5f3
raw
history blame
270 Bytes
#!/bin/bash
capi /v1/models > cmodels.json
my_jq_query=$(cat << JQ
[.data[] | select(.status | test("idle|live"))]
| [group_by(.model_class)[] | { key: .[0].model_class, value: [.[].id] }] | from_entries
JQ
)
cat cmodels.json | jq "$my_jq_query" > model-cache.json