Why Ollama Is the Default Local AI Engine
Ollama wraps llama.cpp inside a zero-configuration daemon exposing both native REST endpoints (/api/generate, /api/chat, /api/embed) and a drop-in OpenAI-compatible /v1/chat/completions API on http://127.0.0.1:11434/v1.
Production Environment Variables for High-Concurrency Agents
When wiring Ollama to n8n, LangGraph, or AutoGen, default single-request settings cause bottlenecks. Set these environment variables before starting ollama serve:
| Variable | Recommended Value | Purpose |
|---|---|---|
OLLAMA_NUM_PARALLEL |
4 |
Allows 4 concurrent agent requests via continuous batching |
OLLAMA_FLASH_ATTENTION |
1 |
Enables Flash Attention 2 (faster prefill, lower KV cache memory) |
OLLAMA_KV_CACHE_TYPE |
q8_0 |
Cuts context window VRAM usage by ~45% with negligible quality loss |
OLLAMA_KEEP_ALIVE |
24h |
Prevents unloading model weights from VRAM between n8n cron runs |
OLLAMA_HOST |
0.0.0.0:11434 |
Exposes Ollama to Docker containers (host.docker.internal:11434) |