Back to Writing

Local AI

Local LLM Setup: Three Reference Builds by Budget

Pick a local LLM setup by budget: exact hardware for sub-$500, $1,500-2,500 and coding builds, the Ollama stack, VRAM math and when local beats hosted.

10 min read

Key takeaways

  • VRAM is the first decision in any local LLM setup because model weights must fit in memory, with 7B models at 4-bit needing roughly 4-5 GB and 70B models needing 40+ GB.
  • A used RTX 3060 12GB or a base Mac mini covers a sub-$500 setup that runs quantized 7B-8B models through Ollama for single-user workloads.
  • The $1,500-2,500 sweet spot pairs a 24GB GPU (used RTX 3090 or new RTX 4090) with 64GB RAM to run 32B models at 4-bit for real product work.
  • Install Ollama first, then Open WebUI, and serve models behind an OpenAI-compatible API so existing client code only needs a base-URL change.
  • Local inference makes sense for prototyping, data-privacy constraints, and steady predictable traffic, but loses to hosted inference for spiky production load.

A local llm setup needs three decisions made in order: your hardware budget, the software stack, and the model size your VRAM can hold. This guide gives you exact components and stacks for three tiers (cheap, budget, and coding-focused), with the tradeoffs of each, so you can pick a build and start running inference today.

What do you actually need for a working local LLM setup?

Five components: a GPU with VRAM, system RAM, fast storage, an inference runtime, and a model file. Everything else is optimization.

The four decisions that determine everything else

First, VRAM. The model weights must fit in memory, so VRAM sets your ceiling on model size. A 7B model at 4-bit quantization needs roughly 4-5 GB; a 70B model needs 40+ GB. Consumer cards like the RTX 4090 ship with 24 GB of VRAM per NVIDIA's GPU spec pages, which is why that number keeps coming up in build guides.

Second, model size, which follows directly from VRAM. Third, the inference runtime, usually llama.cpp or vLLM, which determines tokens-per-second and how you serve the model. Fourth, storage, mostly an afterthought since model files run 4-80 GB.

RAM and CPU matter for offloading when VRAM runs short, at a steep speed penalty. Get VRAM right first; everything else is a workaround. For teams weighing local inference against API costs on real traffic, Federico's work covers that tradeoff in production terms.

What is the cheapest local LLM setup that still works?

For under $500, you have two viable paths: a used GPU build or a base Apple Silicon Mac mini. Both run quantized 7B–8B models (Llama-class, Mistral-class) through llama.cpp or Ollama at usable speeds for single-user workloads.

Reference build: cheapest tier

ComponentOption A: used GPUOption B: Mac mini
ComputeUsed RTX 3060 12GB (~$250)Base M-series, 16GB unified memory
Everything elseExisting desktop, ~$150 PSU/SSD if neededThe machine itself
Model size7B–8B at Q4 quantization7B–8B at Q4 quantization
StackOllama + Open WebUIOllama + Open WebUI

The 12GB VRAM on the used GPU is the reason it wins at this tier: it fits an 8B model with context to spare. The Mac mini trades raw tokens/sec for silence, low power draw, and a box that doubles as your daily driver.

Tradeoffs you accept at this tier

You get single-user experimentation, not production traffic. Expect prompt-only interactions, short context windows under load, and no headroom for retrieval pipelines or agent loops that hammer the model back-to-back. Quantization costs you some reasoning quality on hard tasks. If your goal is validating whether local inference cuts your token bill before you invest more, this tier answers that. If you need architecture decisions for real users, that is the work I do at Federico Molina.

What is the best budget local LLM setup for most users?

The sweet spot is $1,500-2,500: one 24GB VRAM GPU (RTX 3090 used or RTX 4090 new), 64GB RAM, and a 1-2TB NVMe drive. That 24GB ceiling is the whole point. It runs quantized 13B models fast, 32B models comfortably at 4-bit, and it fits the largest open models you can actually use for real product work without multi-GPU complexity.

Why this tier and not the cheap one: at 7-8B, models start hallucinating on structured output and multi-step agent tasks, and you feel it the moment real traffic hits. A 32B quantized model handles JSON-constrained outputs, retrieval-grounded answers, and tool calls with far fewer failures. The tradeoff is cost and power draw: expect roughly 350-450W under load and a case with real airflow. Everything installs in an afternoon with Ollama or llama.cpp, both of which expose an OpenAI-compatible API so your existing client code points at localhost instead of a paid endpoint with zero refactoring.

Reference build: budget tier

  • GPU: RTX 3090 24GB (used, $700-900) or RTX 4090 ($1,600)
  • CPU: Ryzen 7 or i7, 8+ cores
  • RAM: 64GB DDR4/DDR5
  • Storage: 2TB NVMe
  • Stack: Ollama serving a 4-bit 32B model, OpenAI-compatible endpoint, your app unchanged

When to skip this tier

Skip it if you only need embeddings and a 7B model for classification; the cheap tier covers that. Also skip it if your production workload needs 70B-class reasoning on every request. That is a signal your architecture needs a senior review, not just bigger hardware. If your token bill is the real problem and you are deciding between this build and hiring, Federico's background is the short version: he takes AI products from demo to production, including the orchestration and inference-cost decisions that determine whether local hardware pays for itself.

What is the best local LLM coding setup?

Coding is the most demanding local workload because agents need long context, tool calling, and low latency per token. A 7B-class model tuned for code and tool use is the sweet spot: it responds fast enough for autocomplete-style loops and handles structured function calls reliably. Anything larger and your iteration speed drops enough to hurt agent workflows.

Reference build: coding tier

One used RTX 3090 (24GB VRAM) plus 64GB system RAM covers this tier. Run a 7B-14B code model quantized to 4-bit, served through a local inference server. The 24GB card is the key part: it leaves headroom for a 14B model and KV cache, so you are not forced down to 7B the moment context grows. Budget around $800-1,200 for the used GPU, illustrative depending on market.

Context length is the hidden VRAM cost

Context is what kills coding builds. An 8B model at 4-bit might use ~5GB for weights but several GB more for KV cache at 32k tokens, and cache grows with both context length and batch size. If you plan 64k+ context for whole-repo reasoning, either size down the model or pick hardware with more VRAM than the weights alone suggest. Test tool-calling on your actual agent loop before committing: some small models degrade sharply when asked to emit multiple structured calls in sequence.

Which software stack should you install first?

Install order that avoids rework

Start with Ollama. It handles model download, quantization, and serving in one binary, so you get a working model in minutes instead of an afternoon of build errors. Install it first because every other tool in the stack talks to it.

Second, add Open WebUI. It gives you a chat interface for testing prompts and comparing models before you write any code. Skip it and you will debug prompts through curl commands, which slows you down.

Serving local models behind an OpenAI-compatible endpoint

Ollama exposes an OpenAI-compatible API, so wiring it into an existing app is usually a base-URL change plus an API key stub. Keep your client code pointing at an abstraction, and you can swap between a local endpoint and a hosted one without touching call sites.

Before you pick a model, check its quantized VRAM footprint against your hardware. The Hugging Face quantization docs explain how quantization levels trade memory for quality, which is the decision that determines whether your setup runs at all.

How do you choose the right model size for your hardware?

The VRAM math in one paragraph

Model size in VRAM is roughly parameters × bytes per weight. A 7B model at 4-bit quantization needs about 3.5 GB for weights, at 8-bit about 7 GB, at 16-bit about 14 GB. Add 20-40% headroom for the KV cache, which grows with context length and batch size, plus a few GB for activations and the OS. The practical rule: a model fits comfortably when its quantized weight size is under 60% of your VRAM. A 24 GB GPU runs a 32B model at 4-bit; a 16 GB GPU tops out around 14B; an 8 GB GPU handles 7-8B.

Quantization: what you lose at 4-bit vs 8-bit

4-bit (Q4_K_M is the common default) cuts memory roughly 4x versus full precision with modest quality loss on general tasks. You will notice degradation in code generation, long-context reasoning, and non-English output. 8-bit is nearly lossless but doubles memory, which usually means dropping one model-size tier. The tradeoff: a larger model at 4-bit usually beats a smaller model at 8-bit, so prefer 4-bit and take the biggest model your VRAM allows.

What do Reddit users recommend for local LLM setups?

Three recommendations recur across r/LocalLLaMA threads: buy a used RTX 3090 for the 24GB VRAM-to-price ratio, prefer a Mac with high unified memory if you want larger models without a discrete GPU, and start with Ollama before adding anything more complex. The reasoning is consistent: 24GB lets you run 30B-class quantized models locally, and Ollama gets you a working inference endpoint in minutes, so you can test whether local generation actually fits your latency and quality bar before spending on orchestration or retrieval infrastructure.

Treat all of it as anecdotal. Posters optimize for hobby budgets and single-user workloads, not multi-tenant production traffic, so verify any claim against your own evals before it shapes an architecture decision.

When does a local llm setup make sense for a production product, and when it does not

A local llm setup makes sense in three cases: prototyping without a meter running, workloads where data cannot leave your machines, and putting a cost floor under predictable, steady traffic. If your token bill is high because usage is constant, owning hardware can beat per-token pricing.

It usually loses for spiky production traffic. Real users arrive in bursts, and hosted inference scales with them while your GPUs sit idle between peaks. Buying hardware to cover peak load means paying for capacity you use a fraction of the time.

The honest test: run the same evals against a local model and a hosted one before committing either way. If local quality matches on your retrieval and agent tasks, you have a real cost lever. If it does not, you just learned that cheaply.

This is the same demo-to-production gap in miniature. A model that works on your laptop with five test prompts tells you nothing about latency, throughput, or cost under real traffic. Measure both paths before you spend on either.

FAQ

Can I run a local LLM without a GPU?

Yes, but slowly. A Mac with enough unified memory (16GB minimum for 7-8B models at 4-bit) runs them well through Ollama. On a CPU-only PC, llama.cpp can offload model layers to system RAM, which works but at a steep speed penalty. Fine for experimentation, painful for anything interactive.

How much VRAM do I need to run a 70B model locally?

Roughly 40+ GB at 4-bit quantization, plus 20-40% headroom for KV cache and activations. That means a 48GB card or multi-GPU setups, since consumer cards top out at 24GB. Alternatively, a Mac with 64GB+ unified memory handles it, which is why Reddit recommendations often point there for 70B-class models.

Is a used GPU a good idea for a local LLM build?

Usually yes, and it is the standard advice. A used RTX 3090 with 24GB VRAM runs roughly $700-900 and is the backbone of the budget tier, while a used RTX 3060 12GB anchors the sub-$500 build. VRAM-to-price on used cards beats anything new. Budget for a solid PSU and case airflow.

Can I use a local LLM for a commercial product?

Yes. Open-weight models can be run commercially under their licenses, though terms vary by model, so check each one. The harder question is whether local inference fits your traffic pattern: it works for steady, predictable load or data that cannot leave your machines, and loses for spiky production traffic. Run evals against a hosted model before committing.

Ollama vs llama.cpp: which should I start with?

Start with Ollama. It handles model download, quantization, and serving in one binary, so you get a working model in minutes instead of an afternoon of build errors. It exposes an OpenAI-compatible API, so your client code points at localhost with a base-URL change. Move to llama.cpp directly later if you need finer control over serving.

Got an AI system that works in the demo but not in production?

Book a call