Base URL: http://localhost:11434
GET /api/tags
curl http://localhost:11434/api/tagsPOST /api/pull
curl -X POST http://localhost:11434/api/pull \
-d '{"name": "llama3:8b"}'Aggiungere "stream": false per risposta sincrona.
DELETE /api/delete
curl -X DELETE http://localhost:11434/api/delete \
-d '{"name": "llama3:8b"}'POST /api/copy
curl -X POST http://localhost:11434/api/copy \
-d '{"source": "hf.co/unsloth/medgemma-4b-it-GGUF:Q4_K_M", "destination": "mio-modello"}'POST /api/show
curl -X POST http://localhost:11434/api/show \
-d '{"name": "hf.co/unsloth/medgemma-4b-it-GGUF:Q4_K_M"}'GET /api/ps
curl http://localhost:11434/api/psPOST /api/chat
curl -X POST http://localhost:11434/api/chat \
-d '{
"model": "hf.co/unsloth/medgemma-4b-it-GGUF:Q4_K_M",
"messages": [
{"role": "user", "content": "Quali sono i sintomi del diabete di tipo 2?"}
],
"stream": false
}'curl -X POST http://localhost:11434/api/chat -H "Content-Type: application/json" -d "{\"model\":\"hf.co/unsloth/medgemma-4b-it-GGUF:Q4_K_M\",\"messages\":[{\"role\":\"user\",\"content\":\"Quali sono i sintomi del diabete di tipo 2?\"}],\"stream\":false}"
POST /api/generate
curl -X POST http://localhost:11434/api/generate \
-d '{
"model": "hf.co/unsloth/medgemma-4b-it-GGUF:Q4_K_M",
"prompt": "Spiega brevemente l'\''ipertensione.",
"stream": false
}'POST /api/embeddings
curl -X POST http://localhost:11434/api/embeddings \
-d '{"model": "hf.co/unsloth/medgemma-4b-it-GGUF:Q4_K_M", "prompt": "testo da embeddare"}'GET /api/tags → 200 OK se il server è up
Per caricare un modello diverso in memoria senza riavviare il container:
# Scarica il nuovo modello
curl -X POST http://localhost:11434/api/pull -d '{"name": "llama3:8b"}'
# Scaricalo dalla memoria (keep_alive=0) e carica il nuovo
curl -X POST http://localhost:11434/api/generate \
-d '{"model": "hf.co/unsloth/medgemma-4b-it-GGUF:Q4_K_M", "prompt": "", "keep_alive": 0}'
curl -X POST http://localhost:11434/api/generate \
-d '{"model": "llama3:8b", "prompt": "", "keep_alive": -1}'