try-this-model / cache-working-models.sh
wxgeorge's picture
:wrench: ensure model-cache is in sorted order for easier git inspection.
ccf3a62
raw
history blame
246 Bytes
#!/bin/bash
my_jq_query=$(cat << JQ
[.data[] | select(.status | test("idle|live"))]
| [group_by(.model_class)[] | { key: .[0].model_class, value: ([.[].id] | sort) }] | from_entries
JQ
)
capi /v1/models | jq "$my_jq_query" > model-cache.json