|$ curl https://forge-ai.dev/api/markdown?path=docs/ai/local-llm
$cat docs/local-llm-guide.md
updated November 2026·24 min read·published

Local LLM Guide

◆Local LLM◆Ollama◆Open Source◆Self-Hosted◆Intermediate🎯Free Tools
Why Run LLMs Locally?

Running a large language model on your own hardware went from a hobbyist experiment to a mainstream practice in 2026 — searches for "local LLM" grew over 50x in a year. Open-weight models like Llama, Qwen, and Mistral are now good enough for real work, and the reasons to run them locally are compelling: privacy (your code and data never leave your machine), cost (no per-token fees at high volume), latency (no network round-trip), and offline use.

This guide covers the practical path: which tools to use (Ollama, LM Studio, vLLM), which models to download, what hardware you actually need, and when a local model is good enough versus when you should still call a cloud API.

ℹ

info

Short version: install Ollama, run ollama run qwen2.5-coder:14b for coding help or ollama run llama3.1:8bfor general chat. That's it — you have a private AI assistant running locally in under five minutes.
Local LLM Tools Compared
ToolTypeBest ForDifficulty
OllamaCLI + local API serverMost users — easiest path to running models, OpenAI-compatible APIEasiest
LM StudioDesktop GUI appNon-technical users, browsing and chatting with models visuallyEasiest
vLLMPython inference serverProduction serving, high throughput, teamsAdvanced
llama.cppC++ inference engineMaximum control, embedded, CPU-only setupsAdvanced
JanDesktop GUI appOpen-source alternative to LM StudioEasy
Getting Started with Ollama

Ollama is the standard way to run local models. It handles downloading, quantization, and serving, and exposes an OpenAI-compatible API on localhost:11434 — so most tools that work with the OpenAI API work with Ollama by changing one URL.

terminal
Bash
1# Install (macOS / Linux)
2curl -fsSL https://ollama.com/install.sh | sh
3
4# Pull and run a model (one command)
5ollama run qwen2.5-coder:14b
6
7# Chat with it, or use the API
8curl http://localhost:11434/api/generate -d '{
9 "model": "qwen2.5-coder:14b",
10 "prompt": "Write a Python function to merge two sorted lists"
11}'
12
13# Use it with the OpenAI SDK — just change the base URL
14# base_url="http://localhost:11434/v1", api_key="ollama"
🔥

pro tip

Point your coding agent at Ollama instead of a cloud API. Claude Code, Cursor, and most MCP-compatible tools let you configure a custom OpenAI-compatible endpoint — you get agentic coding with zero API costs and full privacy.
Hardware Requirements

The rule of thumb: you need roughly as much VRAM (or unified memory on Apple Silicon) as the model size after quantization. A 4-bit quantized 8B model needs ~5GB; a 70B model needs ~40GB.

Model SizeQuantized (4-bit)Works OnQuality Tier
3–4B~2–3 GBAny modern laptop, even CPUBasic tasks, simple chat
7–9B~5–6 GB16GB MacBook, RTX 3060+Solid general assistant
14B~9 GB24GB+ Mac, RTX 4090Strong coding, reasoning
32B~20 GB32GB+ Mac, RTX 4090Near-cloud quality
70B+~40+ GB64GB+ Mac, multi-GPU, DGX SparkFrontier-adjacent
📝

note

Apple Silicon Macs are unexpectedly excellent local LLM machines because of unified memory — a 36GB M3/M4 MacBook Pro runs 14B–32B quantized models comfortably. Dedicated AI desktops like NVIDIA's DGX Spark (90K+ monthly searches in 2026) target the 70B+ range.
Best Open Models to Run

Qwen 2.5 Coder (7B / 14B / 32B)

Best local coding model — rivals cloud models for code generation, completion, and debugging.

Llama 3.1 / 3.3 (8B / 70B)

Best general-purpose open weights — strong reasoning, chat, and instruction following.

Mistral / Mixtral (7B / 8x7B)

Fast and efficient — great quality-per-GB, good for lower-end hardware.

DeepSeek Coder V2

Excellent at code understanding and repo-level tasks.

Phi-4 (14B)

Microsoft's small model — surprisingly strong reasoning for its size.

Gemma 3

Google's open weights — good multimodal options, runs well on modest hardware.

Local vs Cloud: Honest Trade-offs

Use local when…

Privacy is required (client code, medical, legal), you're offline, volume is high enough that API costs hurt, or you're experimenting and learning.

Use cloud APIs when…

You need frontier-level quality (complex agents, hard reasoning), long context (128K+), structured output reliability, or multimodal (vision, audio) at production scale.

The hybrid pattern most teams use

Local models for autocomplete, drafting, and high-frequency calls; cloud APIs for final review, complex agents, and anything customer-facing.

✓

best practice

Be realistic about quality. A 14B local model in 2026 is genuinely useful — but it is not GPT-4o or Claude Opus. The winning pattern is routing: cheap local calls by default, frontier API calls for the 10–20% of tasks that need the best reasoning. See our Cost Optimization guide.
Best Practices
◆Start with Ollama + a 7B–14B model — it's the fastest way to learn what local models can and can't do
◆Use 4-bit (Q4) quantization by default — the quality loss is small and it halves memory requirements
◆Prefer code-specialized models (Qwen Coder, DeepSeek Coder) for development work over general chat models
◆Serve via the OpenAI-compatible endpoint so your existing tools work unchanged
◆Monitor memory pressure — an 8B model plus your IDE and browser can exhaust 16GB fast
◆Keep a cloud API key configured as a fallback for tasks where the local model struggles
$Blueprint — Engineering Documentation·Section ID: AI-LOCAL-LLM·Revision: 1.0

Community

Get help on Slack, Discord or VIP

Stuck on a guide? Join the community and ask.