Ollama should be configured for model artifact governance, API endpoint protection, and runtime resource control.
# Server binding - default: 127.0.0.1:11434
OLLAMA_HOST=127.0.0.1:11434
# Model storage path - default: ~/.ollama/models
OLLAMA_MODELS=/var/lib/ollama/models
# Model keep-alive duration - default: 5m
OLLAMA_KEEP_ALIVE=5m
# Maximum parallel requests - default: 1
OLLAMA_NUM_PARALLEL=1
# Maximum loaded models per GPU (0=auto) - default: 0
OLLAMA_MAX_LOADED_MODELS=0
# Maximum queued requests - default: 512
OLLAMA_MAX_QUEUE=512
# CORS allowed origins - default: localhost, 0.0.0.0, 127.0.0.1
OLLAMA_ORIGINS=https://webui.example.com
# Enable debug logging - default: false
OLLAMA_DEBUG=1
# Model load timeout - default: 5m
OLLAMA_LOAD_TIMEOUT=5m
# Disable cloud features for full privacy - default: false
OLLAMA_NO_CLOUD=1
# Flash attention for faster inference - default: false
OLLAMA_FLASH_ATTENTION=1
# KV cache quantization (f16, q8_0, q4_0) - default: f16
OLLAMA_KV_CACHE_TYPE=f16
| Variable | Default | Description |
|---|---|---|
OLLAMA_HOST |
127.0.0.1:11434 |
IP address and port for the Ollama server |
OLLAMA_MODELS |
~/.ollama/models |
Path to the models directory |
OLLAMA_KEEP_ALIVE |
5m |
Duration models stay loaded in memory after last request |
OLLAMA_NUM_PARALLEL |
1 |
Maximum number of parallel requests |
OLLAMA_MAX_LOADED_MODELS |
0 (auto) |
Maximum number of loaded models per GPU |
OLLAMA_MAX_QUEUE |
512 |
Maximum number of queued requests |
OLLAMA_ORIGINS |
localhost, 0.0.0.0, 127.0.0.1 |
Comma-separated list of allowed CORS origins |
OLLAMA_DEBUG |
false |
Show additional debug information |
OLLAMA_LOAD_TIMEOUT |
5m |
Model load timeout before giving up |
OLLAMA_NO_CLOUD |
false |
Disable cloud features (remote inference, web search) |
OLLAMA_FLASH_ATTENTION |
false |
Enable flash attention for faster inference |
OLLAMA_KV_CACHE_TYPE |
f16 |
KV cache quantization type (f16, q8_0, q4_0) |
OLLAMA_MULTIUSER_CACHE |
false |
Optimize prompt caching for multi-user scenarios |
OLLAMA_NO_CLOUD=1 for full data privacy in sensitive environments| Platform | Default Path |
|---|---|
| macOS | ~/.ollama/models |
| Linux (service) | /usr/share/ollama/.ollama/models |
| Linux (user) | ~/.ollama/models |
| Windows | C:\Users\%username%\.ollama\models |
Back up metadata stores (DB/vector indexes), model/runtime configuration, and secret metadata. Validate restore with one prompt run and one retrieval/integration call.
Feel free to contact us. Find all contact information on our contact page.