curl --request DELETE \
--url http://localhost:3000/api/v1/ollama/delete-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2"
}'
const response = await fetch('http://localhost:3000/api/v1/ollama/delete-model', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
modelName: "llama2"
})
});
const data = await response.json();
import requests
url = "http://localhost:3000/api/v1/ollama/delete-model"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"modelName": "llama2"
}
response = requests.delete(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Successfully deleted model: llama2"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Model not found"
}
{
"success": false,
"error": "Failed to delete model"
}
Ollama
Delete Model
Removes a model from the local Ollama instance
DELETE
/
api
/
v1
/
ollama
/
delete-model
curl --request DELETE \
--url http://localhost:3000/api/v1/ollama/delete-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2"
}'
const response = await fetch('http://localhost:3000/api/v1/ollama/delete-model', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
modelName: "llama2"
})
});
const data = await response.json();
import requests
url = "http://localhost:3000/api/v1/ollama/delete-model"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"modelName": "llama2"
}
response = requests.delete(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Successfully deleted model: llama2"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Model not found"
}
{
"success": false,
"error": "Failed to delete model"
}
Body Parameters
string
required
Name of the model to delete (e.g., “llama2”, “mistral:7b”)
string
Optional Ollama server URL (defaults to http://localhost:11434)
Response
boolean
Indicates if the model was deleted successfully
string
Success or error message
curl --request DELETE \
--url http://localhost:3000/api/v1/ollama/delete-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2"
}'
const response = await fetch('http://localhost:3000/api/v1/ollama/delete-model', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
modelName: "llama2"
})
});
const data = await response.json();
import requests
url = "http://localhost:3000/api/v1/ollama/delete-model"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"modelName": "llama2"
}
response = requests.delete(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Successfully deleted model: llama2"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Model not found"
}
{
"success": false,
"error": "Failed to delete model"
}
Notes
This action is irreversible. Once deleted, you’ll need to pull the model again to use it.
- Deleting a model frees up disk space
- The model name must match exactly (including tag)
- You can delete specific variants by including the tag (e.g., “llama2:7b”)
- To delete all variants, you must delete each one individually

