back to blog
guide
2026-08-27 9 min read

Self-Hosted LLM: Complete Setup Guide for 2026 (Ollama + Best Models)

Running a self-hosted LLM gives you full data control, zero API costs, and sub-100ms response times. Here is how to do it right, which models to pick, and where it fits inside automation workflows.

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 is, which hardware you need, the best models available in 2026, how to run local LLM inference with Ollama, and how it connects to real 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

hardware requirements

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.

Model SizeQuantizationMin VRAMGood For
3B to 7BQ44 to 6 GBFast tasks, classification, extraction
8B to 14BQ48 to 10 GBReasoning, summarization, chat, agents
30B to 34BQ420 to 24 GBComplex reasoning, coding, long-context
70BQ440 to 48 GBNear-frontier quality for critical tasks

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.

best self-hosted llms in 2026

how to run local llm inference with ollama

Ollama is the standard tool for running self-hosted LLM inference. It handles model downloads, quantization, serving an OpenAI-compatible HTTP API, and GPU acceleration automatically.

step 1: install ollama

# Linux / WSL2 curl -fsSL https://ollama.com/install.sh | sh # macOS (Homebrew) brew install ollama # Windows: download installer from ollama.com

step 2: pull and run a model

# Pull the model (downloads weights) ollama pull qwen2.5:14b # Run interactively ollama run qwen2.5:14b # Or start the API server (runs on port 11434) ollama serve

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.

curl http://localhost:11434/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "qwen2.5:14b", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Summarize this invoice in 3 bullet points."} ] }'
what you get from ollama

connecting 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.

Base URL: http://your-server-ip:11434/v1 API Key: ollama Model: qwen2.5:14b

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. Invoice extraction, HR document parsing, customer support triage, and internal knowledge base queries run entirely within your network.

self-hosted vs cloud api: when to use which

vps options for self-hosted ai

common pitfalls

ready to build?

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.