curl --request POST \
--url http://localhost:3000/api/v1/ollama/pull-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2"
}'
curl --request POST \
--url http://localhost:3000/api/v1/ollama/pull-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2:7b",
"baseUrl": "http://192.168.1.100:11434"
}'
const response = await fetch('http://localhost:3000/api/v1/ollama/pull-model', {
method: 'POST',
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/pull-model"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"modelName": "llama2"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Started pulling model: llama2"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Ollama is not running. Please start Ollama and try again."
}
{
"success": false,
"error": "Failed to pull model"
}
Ollama
Pull Model
Initiates download of an Ollama model to the local Ollama instance
POST
/
api
/
v1
/
ollama
/
pull-model
curl --request POST \
--url http://localhost:3000/api/v1/ollama/pull-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2"
}'
curl --request POST \
--url http://localhost:3000/api/v1/ollama/pull-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2:7b",
"baseUrl": "http://192.168.1.100:11434"
}'
const response = await fetch('http://localhost:3000/api/v1/ollama/pull-model', {
method: 'POST',
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/pull-model"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"modelName": "llama2"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Started pulling model: llama2"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Ollama is not running. Please start Ollama and try again."
}
{
"success": false,
"error": "Failed to pull model"
}
Body Parameters
string
required
Name of the model to pull (e.g., “llama2”, “mistral:7b”)
string
Optional Ollama server URL (defaults to http://localhost:11434)
Response
boolean
Indicates if the pull was initiated successfully
string
Status message about the pull operation
curl --request POST \
--url http://localhost:3000/api/v1/ollama/pull-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2"
}'
curl --request POST \
--url http://localhost:3000/api/v1/ollama/pull-model \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"modelName": "llama2:7b",
"baseUrl": "http://192.168.1.100:11434"
}'
const response = await fetch('http://localhost:3000/api/v1/ollama/pull-model', {
method: 'POST',
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/pull-model"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"modelName": "llama2"
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Started pulling model: llama2"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Ollama is not running. Please start Ollama and try again."
}
{
"success": false,
"error": "Failed to pull model"
}
Notes
Ensure Ollama is running before attempting to pull a model. Start it with
ollama serve or by running the Ollama app.- Model pulls run asynchronously in the background
- Use the Get Pull Status endpoint to monitor download progress
- Large models can take significant time to download
- Specify a tag (e.g., “llama2:7b”) to pull a specific variant, or use just the name to pull the latest version
Model Name Format
modelName: Just the name (pulls latest) - e.g., “llama2”modelName:tag: Specific version - e.g., “llama2:7b”, “mistral:latest”

