Models API
Search the Ollama library
Section titled “Search the Ollama library”Fuzzy search over the public catalog (typo-tolerant, topical):
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.
Pull a model into the organization
Section titled “Pull a model into the organization”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.
Organization catalog
Section titled “Organization catalog”curl -b cookies.txt $BASE/models # list with benchmark statscurl -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).
Personal model list (“My Models”)
Section titled “Personal model list (“My Models”)”Each user curates their own subset of the org catalog for use in chat:
# 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 minecurl -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.
