Skip to content

Models API

Fuzzy search over the public catalog (typo-tolerant, topical):

Terminal window
curl -b cookies.txt "$BASE/models/library/search?q=llama&top_k=5"

Returns name, description, capabilities, available sizes, and popularity for each match — useful for building a model picker.

Terminal window
curl -N -b cookies.txt -X POST $BASE/models \
-H 'Content-Type: application/json' \
-d '{"model_name": "llama3.2"}'

This endpoint streams Server-Sent Events (note -N): download progress per layer, then a benchmark phase, then a final completed event with the new model record:

data: {"status": "pulling 2af3b81862c6", "completed": 176579840, "total": 637699456, …}
data: {"status": "benchmarking", "message": "Running benchmark test..."}
data: {"status": "completed", "model": {"id": "…", "model_name": "llama3.2",
"total_tokens_processed": 741, "tokens_per_second": 65.77, …}}

Failed downloads retry automatically (twice); if the stream ends without a completed event, simply call it again — partial downloads resume. Concurrent pulls of the same model are locked to a single download.

Terminal window
curl -b cookies.txt $BASE/models # list with benchmark stats
curl -b cookies.txt -X DELETE $BASE/models/<model_id>

Deleting removes the model for everyone — from all users’ personal lists and from the model server (freeing disk).

Each user curates their own subset of the org catalog for use in chat:

Terminal window
# add (model must already exist in the org catalog, by name)
curl -b cookies.txt -X POST $BASE/models/my \
-H 'Content-Type: application/json' \
-d '{"model_name": "llama3.2", "hardware_notes": "Runs well on the A4000 box"}'
curl -b cookies.txt $BASE/models/my # list mine
curl -b cookies.txt -X PUT $BASE/models/my \
-H 'Content-Type: application/json' \
-d '{"model_name": "llama3.2", "hardware_notes": "…"}'
curl -b cookies.txt -X DELETE $BASE/models/my/<record_id>

GET /users/my/models returns the same personal list from the user’s side.