
If you watched Hacker News this month, you saw the same thing we did: people running 70-billion-parameter models on a single 4 GB GPU, an 80B Qwen squeezed into 4.3 GB of RAM on a Mac, and open-weight models that now match the frontier models of two years ago. Self-hosting LLMs has stopped being a hobbyist flex and become a legitimate infrastructure decision.
For SMB DevOps and SRE teams, the pitch is simple: your monitoring alerts, log volumes, and internal documentation are full of sensitive data you should not be shipping to a third-party API, and the per-token bill adds up fast when agents start calling the model thousands of times a day. A self-hosted model turns that variable cost into a fixed one, keeps your data inside your VPC, and runs 24/7 without rate limits. Here is how to actually do it in 2026, with real commands, not slideware.
Why Self-Hosting LLMs Went Mainstream in 2026
Three things changed in the last 18 months. First, open-weight models (Qwen, Llama, Mistral, Gemma, and the new Kimi/GLM family) closed the quality gap to the point where a quantized 7–14B model handles most operational text tasks convincingly. Second, quantization became boring-reliable: a Q4_K_M 8B model runs comfortably in ~6 GB of VRAM, which means a used RTX 3090 or a $0.50/hr cloud GPU instance is enough. Third, agentic workloads changed the economics — an AI agent that triages every alert or drafts every PR description generates thousands of requests per day, and at API prices that is real money.
Run the numbers for a typical 10-person team: $200–$400/month on API inference is normal once you add log summarization, code review, and an internal chatbot. A dedicated GPU node at $0.50/hr costs ~$360/month flat, and you can run it 24/7 with no per-token metering, no concurrency limits, and no data leaving your account. If privacy or compliance matters at all (GDPR, HIPAA, customer data in logs), self-hosting is not a cost play — it is the only defensible option.
Right-Sizing Your Hardware: A Model-to-VRAM Cheat Sheet
Do not start with the biggest model you can find. Start with the smallest model that does the job, then move up only if quality actually suffers. A practical reference for Q4-quantized models (the default in Ollama and llama.cpp):
| Model size | Q4 VRAM needed | Good for |
|---|---|---|
| 3–4B | ~3 GB | Log filtering, classification, metadata extraction |
| 7–8B | ~6 GB | Summaries, runbook Q&A, commit messages — the sweet spot |
| 14B | ~10 GB | Code review, YAML/HCL generation, complex reasoning |
| 32B | ~20 GB | Near-frontier quality on a single 4090/A10 |
| 70B+ | ~40 GB (or CPU+RAM) | Batch jobs overnight; slow but usable on CPU via llama.cpp |
Rule of thumb: an 8B Q4 model on a single GPU handles 80% of DevOps text workloads. For batch processing (e.g., summarizing yesterday’s error logs at 3 AM), CPU inference with llama.cpp is slower but perfectly fine — nobody cares if a nightly job takes 20 minutes.
Standing Up Ollama in Five Minutes
Ollama remains the fastest path from zero to a working local model, and it exposes an OpenAI-compatible API so every existing tool can point at it. Install and pull a model:
# Install Ollama (Linux)
curl -fsSL https://ollama.com/install.sh | sh
# Pull an 8B model quantized for consumer GPUs
ollama pull qwen2.5:7b
# Smoke test
ollama run qwen2.5:7b "Summarize this error in one sentence: connection refused to postgres:5432"
# Check it is serving
curl -s http://localhost:11434/api/tags | jq .
To expose it to your team (and enforce a little governance), run it as a container with a persistent volume and GPU reservation:
services:
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
open-webui:
image: ghcr.io/open-webui/open-webui:main
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
depends_on:
- ollama
volumes:
ollama_data:
Your team now has a private ChatGPT at http://ollama:11434/v1 — the OpenAI-compatible endpoint means LangChain scripts, IDE plugins, and your existing agent tooling just need a base_url change. No keys to rotate, no spend to track.
Three DevOps Workloads That Pay for Themselves
1. Log and alert triage. The highest-ROI use case. Instead of paging a human for every ERROR line, let the model classify severity first. A cron job every 15 minutes is enough:
#!/usr/bin/env bash
# /usr/local/bin/triage-logs.sh
set -euo pipefail
journalctl --since "15 min ago" -p err --no-pager \
| head -200 \
| curl -s http://localhost:11434/api/generate \
-d @- <<'JSON' | jq -r .response
{"model":"qwen2.5:7b",
"prompt":"Classify each log line as CRITICAL, WARN, or INFO.
Only output CRITICAL lines with a one-line fix suggestion.\\n",
"stream":false}
JSON
# Pipe CRITICAL output into your alerting tool of choice
You get the idea: the model becomes a first-pass filter, and humans only see what actually needs them — which directly reduces the on-call fatigue every SMB feels.
2. Commit messages and PR descriptions. A pre-commit hook that diffs your staged changes and drafts a conventional commit message takes 30 seconds to write and saves your team hours a week. The model is local, so no code ever leaves your laptop.
3. Internal runbook Q&A. Embed your markdown runbooks with nomic-embed-text, store chunks in a vector store, and answer “how do we rotate the database password?” with your own procedures — the documentation you already wrote, finally findable. Open WebUI even ships a built-in RAG pipeline, so this is configuration, not development.
When to Keep the API (and Use a Gateway)
Self-hosting is not a religion. Frontier API models still win at complex code generation, and you should not buy a second GPU to cover a once-a-month spike. The winning pattern in 2026 is hybrid: a self-hosted model as the always-on default for high-volume, privacy-sensitive work, with an LLM gateway routing the hard, bursty requests to a frontier model and failing over when your local node is down. Our guide to AI agents for infrastructure covers wiring agents to that fallback pattern.
One caution: adding Ollama, Open WebUI, a vector DB, and embedding models to your stack is exactly how tool sprawl starts. Start with one workload, prove the ROI, and only then expand.
Not sure whether self-hosting or API routing is the right call for your team’s budget and data constraints? Book a free 30-minute session with us and we will model both options against your actual workloads: reserve your slot here.