---
title: "Run LLM Locally: Hardware, Tools and Setup Guide"
description: "How to run an LLM on your own laptop or server: how much memory a model needs, which tool to pick (Ollama, LM Studio, llama.cpp, vLLM) and the setup steps."
url: https://aismith.dev/insights/run-llm-locally-hardware-tools
publisher: AIsmith (aismith.dev)
---

[Back](https://aismith.dev/insights)Blog

# Run LLM Locally: Hardware, Tools and Setup Guide

How to run an LLM on your own laptop or server: how much memory a model needs, which tool to pick (Ollama, LM Studio, llama.cpp, vLLM) and the setup steps.

AISmith Team

December 3, 2026

11 min read

To run LLM locally, you need three things: an open model, a runtime such as Ollama or LM Studio to load it, and enough memory to hold a quantized (usually 4 bit) copy of the model. A laptop with 16 GB of memory runs 7 to 12 billion parameter models well; 30 billion parameter models need a machine with about 32 GB.

If you want ideas like these working inside your own business, see our [AI development and automation](https://aismith.dev/services/ai) service.

## What does it mean to run an LLM locally?

Running an [LLM](https://aismith.dev/insights/transformers-chatgpt-aismith) locally means the model file sits on your own laptop, desktop or server, and every prompt is processed on that hardware instead of being sent to a provider such as OpenAI or Anthropic. The model weights are downloaded once. After that, nothing about your prompts needs to leave the machine.

Ollama states this plainly in its [FAQ](https://docs.ollama.com/faq): "Ollama runs locally. We don't see your prompts or data when you run locally." LM Studio says the same in practical terms: once you have the model files, the app can operate entirely offline.

You get privacy and no per token bill or rate limits. You give up the very largest frontier models, and you take on the job of keeping the hardware and software running.

## Why would a business run an LLM locally?

A business runs an LLM locally for three main reasons: private data that should not leave the building, predictable cost on steady high volume work, and offline or low latency use.

- **Private data.** Contracts, patient notes, source code and internal financials are the usual cases. If a legal or client agreement says data stays on your systems, a local model is the cleanest answer.
- **Predictable cost.** A hosted API charges for every token. A local model costs the hardware plus electricity, whether it processes ten documents a day or ten thousand. For heavy batch work (classifying tickets, tagging documents, extracting fields), that flat cost can win. Our guide to [measuring AI ROI before you build](https://aismith.dev/insights/ai-roi-how-to-measure-it) lists the costs to put on each side of that comparison.
- **Offline and edge use.** Field laptops, factory floors and air gapped networks cannot depend on a cloud call.

If none of these apply, a hosted API is usually faster to ship and better at hard reasoning. The wider question of building your own versus buying a product is covered in [build vs buy for custom AI](https://aismith.dev/insights/build-vs-buy-custom-ai-solutions).

## How much RAM do you need to run an LLM locally?

The memory you need to run an LLM locally is roughly the model's parameter count multiplied by the bits stored per parameter, divided by eight, plus a few gigabytes for the context and the runtime. Parameters are the numbers the model learned; at full 16 bit precision each one takes two bytes.

Quantization is what makes local models practical. It stores each parameter with fewer bits. The [Hugging Face GGUF documentation](https://huggingface.co/docs/hub/gguf) lists the common types: Q4_K works out to 4.5 bits per weight, Q5_K to 5.5, Q6_K to about 6.56, and full F16 to 16. Lower bits mean a smaller file at some cost in quality; many people start at 4 bit.

Here is the arithmetic for model weights alone (our own calculation from those bit counts):

- 8 billion parameters at F16: 8 × 16 ÷ 8 = 16 GB
- 8 billion parameters at Q4_K: 8 × 4.5 ÷ 8 = 4.5 GB
- 31 billion parameters at Q4_K: about 17.4 GB
- 70 billion parameters at Q4_K: about 39.4 GB

Real downloads line up with this. On the [Ollama library page for Gemma 4](https://ollama.com/library/gemma4), as of December 2026, the 12b variant is listed at 7.7 to 8.0 GB, the 26b at 16 to 19 GB and the 31b at 19 to 20 GB. Add headroom for your operating system and other apps, and you get a working rule:

- **8 GB of memory:** small models only (1 to 4 billion parameters) with short context
- **16 GB:** 7 to 12 billion parameter models at 4 bit, comfortably
- **32 GB:** models up to about 30 billion parameters
- **64 GB or more, or a large GPU:** 70 billion parameter models

If you want to compare one family across sizes, our [Gemma 4 model sizes guide](https://aismith.dev/insights/google-gemma-4-release) walks through which variant suits which machine.

## Does context length change the memory you need?

Context length changes memory a lot, because the runtime keeps a cache of every token in the conversation, and that cache grows with the window size. A model that fits with a short prompt can run out of memory when you paste in a 100 page contract.

Ollama's FAQ gives the defaults: it uses a context window of 4,096 tokens unless you raise it with the `OLLAMA_CONTEXT_LENGTH` setting. It also notes that parallel requests multiply the context, so "a 2K context with 4 parallel requests will result in an 8K context and additional memory allocation." One fix is cache quantization: setting `OLLAMA_KV_CACHE_TYPE` to `q8_0` uses about half the memory of the default with what Ollama describes as a very small loss in precision. It needs Flash Attention, which Ollama turns on automatically when your hardware supports it, and it applies to every model.

Rule of thumb: size your hardware for the longest document you plan to feed in, not for a chat demo.

## What is the best laptop to run an LLM locally?

The best laptop to run an LLM locally has at least 16 GB, ideally 32 GB, of memory the model can use, because memory decides which models load at all.

LM Studio's [system requirements](https://lmstudio.ai/docs/app/system-requirements) are a useful floor, as of December 2026:

- **Mac:** Apple Silicon (M series) on macOS 14 or newer, with 16 GB or more recommended. 8 GB Macs work only with smaller models and modest context. Intel Macs are not supported.
- **Windows:** x64 with AVX2 or ARM (Snapdragon X Elite), with 16 GB of RAM and 4 GB of dedicated graphics memory recommended.
- **Linux:** x64 or ARM64, distributed as an AppImage, Ubuntu 20.04 or newer.

Our buying advice: treat 16 GB as the minimum for useful work and 32 GB as the sweet spot for a developer or analyst who wants to try 20 to 30 billion parameter models. On a Windows or Linux machine with a discrete GPU, graphics memory (VRAM) is the number to watch, since a model that spills out of VRAM into system memory slows down sharply.

## Which tool should you use: Ollama, LM Studio, llama.cpp or vLLM?

Ollama suits developers and small teams, LM Studio suits people who want a desktop app, llama.cpp suits engineers who want full control, and vLLM suits serving many users from a GPU server.

- **Ollama** is a command line tool and background server. One command downloads and runs a model, and it exposes a local API on port 11434. It also speaks a subset of the OpenAI API (see the [OpenAI compatibility docs](https://docs.ollama.com/api/openai-compatibility)), so code written for a hosted model can point at `http://localhost:11434/v1/` instead.
- **LM Studio** is a desktop app with a chat window, a model browser and document chat. It is the easiest start for someone who does not live in a terminal.
- **llama.cpp** is the C/C++ inference engine behind the GGUF file format; Hugging Face notes that GGUF was created by the developer of llama.cpp.
- **vLLM** is built for serving. Its [documentation](https://docs.vllm.ai/en/latest/) describes it as a library for fast LLM inference and serving, originally from UC Berkeley's Sky Computing Lab, with continuous batching of incoming requests and PagedAttention for memory management. Pick it when dozens of people or processes will hit the same model at once.

## How to run LLM locally in five steps

To run LLM locally with Ollama, install it, type `ollama run gemma4`, and call the local API at `http://localhost:11434`.

1. **Check your memory.** Use the sizing rule above. For a 16 GB machine, start with a model around 4 to 12 billion parameters.
2. **Install Ollama.** Download it for macOS, Windows or Linux from ollama.com and run the installer.
3. **Run a model.** In a terminal, type `ollama run gemma4`. The first run downloads the model; after that it loads from disk. To pick a size, add a tag such as `gemma4:12b`.
4. **Call it from code.** Ollama listens only on your own machine (127.0.0.1, port 11434) by default. Send a request to `http://localhost:11434/api/chat`, or use any OpenAI client library with the base URL set to `http://localhost:11434/v1/`. The client needs an API key value, but Ollama ignores it.
5. **Tune for your workload.** Raise the context window if you feed in long documents, and use `keep_alive` (or `OLLAMA_KEEP_ALIVE`) to keep the model loaded in memory between requests so the first answer is not slow.

One caution on step 4: if you change `OLLAMA_HOST` so other machines can reach the server, put it behind your own [authentication](https://aismith.dev/insights/user-authentication-aismith). Opening it to a network exposes the model to anyone who can reach that port.

## What can a local model do well, and what can it not?

A local model does well on narrow, repeatable tasks such as summarizing documents, extracting fields from invoices, classifying support tickets and answering questions over your own files, and is weaker at long reasoning and hard coding problems. Paired with retrieval over company documents (see our [plain English guide to RAG](https://aismith.dev/insights/rag-aismith)), a mid sized local model can answer policy and product questions with sources.

A local model is weaker at long chains of reasoning, hard coding problems and broad world knowledge, where the largest hosted models still lead. It is also only as current as the day it was trained.

A hypothetical example: a 40 person accounting firm wants to extract client names, amounts and dates from 3,000 scanned invoices a month. A 12 billion parameter model on one 32 GB desktop, fed by an OCR step, handles that kind of structured extraction, and no client document leaves the office. The same firm drafting tax opinions would get better results from a frontier model under a data agreement.

## What are the hidden costs of running an LLM locally?

The biggest hidden cost of running an LLM locally is people time. Someone has to pick and update models, test quality after every change, watch memory and uptime, and secure the server. A hosted API bundles all of that into the per token price.

Other costs to plan for:

- **Evaluation.** Build a small test set of real tasks and score each model on it before switching. Public benchmarks rarely match your documents.
- **Scaling.** One laptop serves one person. Ten concurrent users need a GPU server and a serving tool such as vLLM.
- **Licenses.** Open models ship under different licenses. Read the license on the model page before you put one in a commercial product.

If you want help choosing between local and hosted models, or a hybrid of both, our [AI development team](https://aismith.dev/services/ai) builds and runs these setups, and [IT consulting](https://aismith.dev/services/it-consulting) covers the servers, deployment and security side.

## Key takeaways

- Memory needed is roughly parameters × bits per weight ÷ 8, plus room for context. At 4 bit, an 8 billion parameter model is about 4.5 GB of weights.
- 16 GB of memory runs 7 to 12 billion parameter models well; 32 GB reaches about 30 billion.
- Context length and parallel users raise memory use; size for your longest document.
- Ollama is the fastest start and speaks a subset of the OpenAI API; vLLM is for serving many users.
- Run locally for private data, steady high volume and offline use. Use hosted models for the hardest reasoning.

## Frequently asked questions

### Can I run an LLM locally without a GPU?

Yes. Ollama, LM Studio and llama.cpp all run models on a CPU, using system memory. Expect slower answers than on a GPU, so stick to smaller models (around 4 to 8 billion parameters at 4 bit) for interactive use.

### Is it free to run an LLM locally?

The software and many open models are free to download, and there is no per token fee. You still pay for the hardware, the electricity and the time to maintain it. Check each model's license before commercial use.

### What is the best small language model to run locally?

The best small language model depends on your task and memory, so test two or three on your own examples. Families such as Gemma 4 come in several sizes; its smallest variants download at 4.6 to 9.5 GB in Ollama, which suits a 16 GB laptop.

### Ollama vs LM Studio: which should I use?

Use Ollama if you will call the model from code or run it as a background service, since it starts a local API by default. Use LM Studio if you want a desktop chat app with a built in model browser. Both run the same kind of quantized open models.

## Related reading

- [AI Receptionist for Small Business: Costs, Setup and LimitsWhat an AI receptionist for a small business does, what it costs per call or per minute, how to set one up, and the rules on disclosure and consent.](https://aismith.dev/insights/ai-receptionist-for-small-business)
- [Google Gemma 4: Model Sizes, Specs and Which One to RunWhat Gemma 4 is, when each model was released, how the five sizes compare on hardware, context and benchmarks, and how to run it locally or in the cloud.](https://aismith.dev/insights/google-gemma-4-release)
- [Best AI for Small Businesses: Costs and Where to StartThe best AI for small businesses, job by job: assistants, automation and support tools, what each costs per month, and which task to hand to AI first.](https://aismith.dev/insights/ai-for-small-businesses-aismith)

Author

Published on December 3, 2026

Keep exploring

## Build this with AISmith

One team for AI, web, mobile, and infrastructure.

- [AI Workflows](https://aismith.dev/services/ai-workflows): AI inside one business process, coached every week against a growing test set.

- [AI Development & Automation](https://aismith.dev/services/ai): AI agents, RAG assistants, and workflow automation.

- [AI Consulting & Strategy](https://aismith.dev/services/ai-consulting): Use cases, build versus buy, ROI and a costed AI roadmap.

- [Web Development](https://aismith.dev/services/web-development): Fast, scalable web apps on React and Next.js.

- [App Development](https://aismith.dev/services/app-development): High-performance iOS, Android, and cross-platform apps.

- [Voice AI & Call Automation](https://aismith.dev/services/voice-ai): AI voice agents that answer, book, and log every call.

- [UI/UX & Product Design](https://aismith.dev/services/design): Design systems, prototypes, and conversion-focused interfaces.

- [Cloud and IT Consulting](https://aismith.dev/services/it-consulting): Cloud migration, DevOps, and security strategy.

---

## About AIsmith

AIsmith builds AI agents, workflow automations, voice AI and production web and mobile apps for startups and enterprises, from spec to production in weeks.

- Contact: grow@aismith.dev
- Full site map for AI agents: https://aismith.dev/llms.txt
- Tools for AI agents (MCP, streamable HTTP): https://aismith.dev/mcp
- Any page as markdown: add .md to its URL, for example https://aismith.dev/services/ai.md
