Home / Docs / Local Models & Containers

Developer toolchain

Local-First AI Execution: Ollama, Docker Compose & Budgets

Running open-weights models locally eliminates per-token cloud bills, keeps sensitive data inside your machine, and forces healthy discipline around memory, latency, and container isolation.

1. Rule-of-thumb VRAM & quantization budgeting

Before pulling a 70B model onto an 8 GB laptop, estimate memory honestly: weights_GB ≈ params_B × (bits / 8) plus KV-cache overhead for long context windows.

Model Size (Q4 Quantized) Approx. Memory Footprint Typical Hardware
3B–4B parameters ~2.5–3.5 GB Standard laptop CPU / 8 GB unified memory
7B–9B parameters ~5–7 GB 16 GB laptop or 8–12 GB consumer GPU
14B–32B parameters ~10–22 GB 24 GB workstation GPU or 32–64 GB unified memory

2. Use the OpenAI-compatible local endpoint

Keep your application code portable across local Ollama and hosted providers by targeting Ollama's OpenAI-compatible endpoint at http://127.0.0.1:11434/v1 and configuring the base URL via environment variables:

ollama pull llama3.2
curl http://127.0.0.1:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"llama3.2","messages":[{"role":"user","content":"Summarize SHACL in one sentence."}]}'

3. Package multi-service stacks with Docker Compose

  • Bind internal services (triplestores, model servers, databases) to 127.0.0.1 rather than 0.0.0.0 unless explicitly fronted by TLS and authentication.
  • Pin exact image digests or minor version tags instead of floating :latest.
  • Separate read-only mounted config/ontologies from writable volume paths.

Related docs