The case for a self-hosted LLM has never been stronger. API costs are climbing. Data privacy regulations are tightening. And latency matters when an LLM sits inside a live customer-facing workflow. Hosting your own model resolves all three problems at once.
This guide covers everything: what a self-hosted LLM actually is, which hardware you need, the best models available in 2026, how to run local LLM instances with Ollama, and how it connects to real business automation pipelines.
What Is a Self-Hosted LLM?
A self-hosted LLM is a large language model that runs on infrastructure you control rather than on a third-party provider's servers. Instead of sending prompts to OpenAI or Anthropic, your requests go to a process running on your own machine, a VPS, or a private cloud instance. The model weights live on your hardware. The data never leaves your environment.
This is different from paying for a managed model API, where the provider holds the weights and you pay per token. With self-hosting, you pay for compute once (or monthly for a VPS), and run as many tokens as you like.
Why Run a Self-Hosted LLM in 2026
There are four reasons most agencies and operators make the switch:
- Data privacy. Client data, internal documents, and PII stay on your own servers. No third-party logs. No training on your data. GDPR and HIPAA compliance becomes significantly simpler.
- Cost at scale. Once your workflows hit a few million tokens per month, OpenAI or Claude API costs become a serious line item. Self-hosting cuts that to near zero beyond electricity and hosting.
- Latency. A self-hosted model on a local network or nearby VPS delivers responses in 50 to 300ms. Cloud APIs regularly add 800ms to 2 seconds of latency, which compounds badly inside multi-step agent workflows.
- Full control. You choose the model, fine-tune it on your data, set system prompts permanently, and update on your own schedule. No breaking changes pushed by a vendor overnight.
Hardware Requirements for Self-Hosted LLMs
The compute requirement depends almost entirely on model size. A rule of thumb: you need roughly 1 GB of VRAM per billion parameters for 4-bit quantized models. For float16, double that.
| Model Size | Quantization | Min VRAM | Good For |
|---|---|---|---|
| 3B to 7B | Q4 | 4 to 6 GB | Fast tasks, classification, simple extraction |
| 8B to 14B | Q4 | 8 to 10 GB | Reasoning, summarization, chat, agents |
| 30B to 34B | Q4 | 20 to 24 GB | Complex reasoning, coding, long-context tasks |
| 70B | Q4 | 40 to 48 GB | Near-GPT-4 quality for critical workflows |
For most automation agency use cases, a 14B model at Q4 quantization hits the right balance. A single RTX 4090 (24 GB VRAM) or a Mac with 32 GB unified memory runs it comfortably. For a VPS setup, look at providers offering A100 or H100 instances with hourly billing.
If you want to run local LLM inference on CPU only, it is possible but slow. A modern Apple Silicon Mac (M3 Pro or better) with unified memory is the best CPU-based option available today, leveraging Metal for GPU acceleration without discrete VRAM.
Best Self-Hosted LLMs in 2026
The open-weight model landscape has matured considerably. These are the models worth running:
- Llama 3.3 70B. Meta's flagship open-weight model. Best all-around performance for instruction following, coding, and complex reasoning. Requires significant VRAM but worth it for production workloads.
- Qwen2.5 14B / 32B. Alibaba's Qwen series punches well above its weight class. The 14B version fits on a single consumer GPU and handles multilingual workloads, structured output, and tool use reliably.
- Mistral Small 3.1. Mistral's efficient architecture delivers strong results at smaller sizes. The 22B variant is an excellent default for agencies that need good quality without heavy hardware.
- Gemma 3 27B. Google's open model, well-optimized for instruction tasks and retrieval-augmented generation. Long context window support makes it practical for document-heavy workflows.
- DeepSeek R2 Lite. Strong reasoning and coding model from DeepSeek. Particularly good for agent tasks where multi-step planning matters.
For most self-hosted AI workflows, Qwen2.5 14B or Mistral Small 3.1 is the starting point. They run on affordable hardware, respond quickly, and handle tool-use schemas well enough for n8n agent nodes.
How to Run a Self-Hosted LLM with Ollama
Ollama is the standard tool for running local LLM inference. It handles model downloads, quantization, serving an OpenAI-compatible HTTP API, and GPU acceleration automatically. Setup takes under five minutes.
Step 1: Install Ollama
Step 2: Pull and Run a Model
Step 3: Call the API
Ollama exposes an OpenAI-compatible endpoint. Any tool that supports the OpenAI API format works out of the box, including n8n's AI nodes.
- OpenAI-compatible JSON response format
- Streaming support via
stream: true - Model loaded into memory after first call, stays warm
- No API keys, no usage tracking, no rate limits
Connecting a Self-Hosted LLM to n8n
Once Ollama is running, connecting it to n8n is straightforward. In n8n's credential manager, add a new "OpenAI API" credential with the base URL set to your Ollama instance and a dummy API key (Ollama does not require one).
From there, every n8n AI Agent node, Basic LLM Chain node, and Summarization node works with your self-hosted LLM exactly as it would with OpenAI. The same structured output, tool use, and memory patterns all apply.
This is particularly powerful for automation workflows that process sensitive data. Invoice extraction, HR document parsing, customer support triage, and internal knowledge base queries can all run entirely within your network. No data leaves the building.
Self-Hosted LLM vs Cloud API: When to Use Which
Self-hosting is not always the right call. Here is a clear breakdown:
- Use self-hosted when: you process sensitive client data, your token volume exceeds 5M per month, latency inside agent loops matters, or you want fine-tuning control.
- Use cloud API when: you need the absolute frontier model (GPT-4.5, Claude Opus), you have irregular/burst workloads that do not justify always-on compute, or you are prototyping and do not want to manage infrastructure.
- Use both: route sensitive tasks to self-hosted, complex reasoning to cloud. n8n's Router node makes this trivial to implement.
Running a Self-Hosted LLM on a VPS
If local hardware is not an option, a GPU-enabled VPS delivers the same privacy and cost benefits. Providers worth knowing:
- RunPod. Hourly GPU rentals from $0.20/hr for consumer GPUs to $2/hr for A100s. Good for burst workloads and experimentation.
- Lambda Labs. Reserved GPU instances, predictable pricing, strong for steady-state production workloads.
- Hetzner. European data centers for GDPR-conscious deployments. Their dedicated GPU server plans are cost-effective for 24/7 inference.
- Vast.ai. Marketplace model for renting community GPUs. Cheapest option but with variable reliability.
For a production self-hosted AI setup, pair Ollama with a reverse proxy (nginx or Caddy), add basic auth on the endpoint, and point your n8n instance at the secure URL. The entire stack costs under $200/month for a solid A10G instance capable of running 30B models at full speed.
Common Self-Hosted LLM Pitfalls
- Model too large for available VRAM. The model falls back to CPU offloading, which drops tokens-per-second by 10x. Size down or quantize further.
- Context window exceeded. Most 7B to 14B models support 8K to 32K token contexts. Chunk large documents before sending, or use a RAG pipeline.
- Cold start latency. Ollama unloads idle models to free memory. Set
OLLAMA_KEEP_ALIVE=-1to keep your model warm permanently. - Structured output failures. Smaller models sometimes break JSON schemas. Use grammar-constrained generation or add retry logic in your n8n workflow.
Ready to Add a Self-Hosted LLM to Your Stack?
Setting up the model is the easy part. Integrating it properly into existing workflows, handling failures gracefully, routing tasks to the right model, and keeping everything observable takes more thought. That is what we build for clients at GetMicroservices.
If you want a production-grade self-hosted AI setup built into your existing automation stack, reach out and we will scope it out. Most setups go live within a week.