How to Run an LLM Locally: Private AI on Your Own Computer
What hardware you need, how to choose a model and quantisation that fit, how to get started with LM Studio or Ollama, how to customise a local model, and which prompts get the best out of smaller models.

Every prompt you type into ChatGPT, Claude or Gemini travels to someone else's servers. If you work with client files, medical notes, unreleased code or anything you'd rather not upload, there is another option: run a language model on your own computer. It's free once set up, it works offline, and nothing you type leaves the machine. This guide covers how to run an LLM locally: the hardware you need, how to pick a model that fits, the two easiest tools (LM Studio and Ollama), how to customise a model, prompts that suit smaller models, and the limits worth knowing.
What running an LLM locally actually means
A large language model is, in the end, a big file of numbers (the weights) plus software that uses them to predict the next token. The big chatbots keep their weights private, but many companies publish theirs for anyone to download: Google's Gemma, Meta's Llama, Alibaba's Qwen, Mistral's models and OpenAI's gpt-oss are well-known families. These are called open-weight models.
Running one locally means downloading those weights once and letting a program on your computer do the work that normally happens in the cloud. Why bother:
- Privacy: prompts and documents stay on your machine. No account and no logs on someone else's server.
- Offline use: it works on a plane or behind a strict company firewall.
- Cost: no subscription or per-token bill. You pay in hardware and electricity instead.
- Control: you choose the model and version, and it never changes under you.
What you give up is capability. A model that fits on a laptop is far smaller than the frontier models behind the big chat apps, and it shows on hard reasoning, niche knowledge and long documents. Think of it as a capable assistant for everyday text work, not a replacement for the best cloud models.
What hardware you need
Memory decides everything. For usable speed, the whole model has to fit in fast memory: the video memory (VRAM) of a graphics card, or the unified memory of an Apple Silicon Mac. A model that doesn't fit spills into slower system RAM, and speed drops sharply.
A rough rule for working out the size: number of parameters × bits per weight ÷ 8 = gigabytes. An 8-billion-parameter model stored at 16 bits needs about 16 GB. Compressed to about 4.5 bits per weight, the most common setting, it needs about 4.5 GB. Then add room for the context (the text the model is working with) and for your operating system.
In practice, as a starting point:
- 8 GB of memory: small models of 1 to 4 billion parameters, fine for rewriting and short summaries.
- 16 GB: models of roughly 7 to 14 billion parameters, the sweet spot for most laptops. OpenAI says its gpt-oss-20b model can run on systems with as little as 16 GB.
- 24 to 32 GB: models of 20 to 32 billion parameters, noticeably better at reasoning and long instructions.
- 64 GB or more: the largest open models, usually on a high-end Mac or a workstation with one or more powerful GPUs.
Tools have their own minimums. LM Studio, for example, needs an Apple Silicon Mac on macOS 14 or newer (Intel Macs aren't supported) and recommends 16 GB of RAM. On Windows it also recommends 16 GB of RAM and at least 4 GB of dedicated VRAM.
How to choose a model: size, quantisation and GGUF
Model names look cryptic, but they carry three useful pieces of information.
Size is the number of parameters: 4B, 12B, 31B. More parameters usually means better answers and more memory, but a newer small model often beats an older bigger one, so prefer recent releases.
Quantisation is the compression. Weights are usually stored at 16 bits, then rounded to fewer bits so the model fits in less memory. Labels such as Q4_K_M, Q5_K_M and Q8_0 tell you the level. According to Hugging Face's documentation, Q4_K works out at about 4.5 bits per weight, Q5_K at 5.5 and Q6_K at about 6.6. Q4_K_M is the usual default and loses surprisingly little quality; Q8_0 is close to the original but twice the size; below 4 bits, quality drops faster.
Format: you'll mostly meet GGUF, a file format created by Georgi Gerganov, the developer of llama.cpp, the engine underneath many local tools. It packs the weights and the information needed to run them into a single file.
Check two more things before you download. The licence: some open models use permissive licences such as Apache 2.0 (gpt-oss does), others restrict commercial use. And the task: there are general chat models, coding models, vision models and embedding models for search. For a first try, a recent general model of 4 to 12 billion parameters from a well-known family is the safe choice.
The easiest route: LM Studio
If you'd rather not touch a terminal, start with LM Studio, a free desktop app for macOS, Windows and Linux that handles downloading and chatting in one window.
- Download it from lmstudio.ai and install it like any other app.
- Open the Discover tab and search for a model family, such as Gemma or Qwen. LM Studio shows the available sizes and quantisations, and warns you when a file is likely too big for your machine.
- Download one. A 4 to 8 GB file is a good first choice on a 16 GB machine.
- Load the model in the Chat tab and start typing. You can add a system prompt and attach documents.
LM Studio's documentation states that nothing you type into a chat leaves your device and that documents are processed locally. It needs the internet only to find and download models, runtimes and updates.
It can also act as a local server. Turn on the server in the Developer tab (or run lms server start) and other programs can talk to your model at http://localhost:1234/v1, using the same request format as OpenAI's API.
The developer route: Ollama
Ollama is the developers' favourite: a small program that runs models from the command line and serves them to other apps.
Install it from ollama.com/download, or with one command: curl -fsSL https://ollama.com/install.sh | sh on macOS and Linux, or irm https://ollama.com/install.ps1 | iex in Windows PowerShell. Then download and start a model in one step:
ollama run gemma4downloads Google's Gemma 4 the first time and opens a chat. Type/byeto leave.ollama pull gemma4:e2bdownloads a specific size without starting a chat. The part after the colon, the tag, picks the variant.ollama lslists your models;ollama rm gemma4deletes one.ollama psshows what's loaded and where. "100% GPU" means the model fits entirely in video memory; a CPU/GPU split means it doesn't, and it will be slower.ollama stop gemma4unloads a model at once; otherwise it stays in memory for five minutes after your last request.
Model names change with every release, so check the library on ollama.com before copying a command from an old tutorial. One trap: tags ending in cloud run on Ollama's servers, not your computer. Ollama's FAQ says it doesn't see your prompts or data when you run locally; cloud models are a different matter.
Ollama listens on your own machine at port 11434, with an OpenAI-compatible endpoint at http://localhost:11434/v1/. Most code written for OpenAI's API works if you change the base URL and pass any text as the API key. That's how editors, note-taking apps and scripts plug into local models.
One default catches many people out: on machines with less than 24 GB of VRAM, Ollama gives models a context window of only about 4,000 tokens, whatever the model supports. Paste a long report and the start silently falls out of view. Raise it in the app's settings or with the OLLAMA_CONTEXT_LENGTH environment variable; a bigger context uses more memory. Our token counter gives you a rough idea of how long your documents are.
How to customise a local model
A local model is yours to configure. In LM Studio, the system prompt and settings sit in the chat sidebar. In Ollama, you write a short text file called a Modelfile and create your own named version of a model:
Save it as Modelfile, run ollama create work-assistant -f Modelfile, then start it with ollama run work-assistant. Every chat now begins with your rules, an 8,192-token context and a low temperature.
That temperature line matters: the newest cloud models no longer let you change it, but local tools do, and Ollama's default of 0.8 is lively for extraction or factual work. Our guide to LLM temperature explains which values suit which tasks. For the system prompt itself, our system prompt generator gives you a structured starting point.
Teaching a model a style or specialist task is a different job, covered in our guide to fine-tuning. Try a good system prompt first.
Prompts that work better with small local models
An 8-billion-parameter model can't fill gaps the way a frontier model can. It follows simple, explicit instructions well and loses the thread on vague or crowded ones. Four habits help:
- One task per prompt. Ask for a summary, then the action points, rather than both plus a translation in one go.
- Give the material and say to use only that. Small models know less, so they invent more when asked from memory.
- Show the format. A short example of the output beats a paragraph describing it.
- Keep inputs short. Even with a large context window, models tend to pay less attention to the middle of long documents. Split long texts into sections.
A summary of a private document, the most common reason to go local:
Pulling details out of text, where a fixed format keeps a small model on track:
Before you trust a model with a job, test it on real examples, ideally on two or three models:
The second half is the useful part: a small model that tells you where it guessed is showing you which instructions to tighten.
Limits worth knowing
Before you depend on a local model, keep these in mind:
- Less capable than the best cloud models. Local models are weaker at complex reasoning, maths, niche facts and long documents. If you need the best possible answer, our roundup of ChatGPT alternatives covers the cloud options.
- They still make things up. Smaller models know less, so they invent more often, and they sound just as confident. Check anything that matters.
- No live knowledge. A local model knows only its training data, unless you paste in the source.
- Speed depends on your hardware. Without a decent GPU or enough memory, replies crawl. Expect fans, heat and battery drain on a laptop.
- Local isn't automatically safe. Download models only from known publishers and well-used sources, keep your tools updated, and don't expose Ollama or LM Studio's server to your network or the internet unless you know how to secure it: by default they only accept requests from your own machine.
- Licences still apply. "Open" doesn't always mean free for any use. Read the licence before you build a product on a model.
Running an LLM locally comes down to three steps: check your memory, pick a recent model whose quantised file fits comfortably, and start it with LM Studio or Ollama. A system prompt turns it into an assistant for your own work, and short, explicit prompts get the best out of it. It won't match the strongest cloud models, but for private documents, offline work and routine text tasks, it's now a practical tool rather than a hobby.



