File size: 246 Bytes
caba5f3
 
 
 
ccf3a62
caba5f3
 
 
77d9d41
1
2
3
4
5
6
7
8
9
10
#!/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