How to Run an LLM Locally: A Beginner's Guide to Ollama, LM Studio and Open Models
Run an LLM on your own computer: the RAM and VRAM you need, quantization explained, step-by-step Ollama and LM Studio setup, and how to pick a model.
The Short Answer
To run a large language model (LLM) on your own computer, install a free runner such as Ollama or LM Studio, download an open-weight model that fits in your memory, and chat with it locally. A typical modern laptop with 16 GB of RAM can comfortably run small and mid-sized models (roughly 4 to 14 billion parameters in compressed, "quantized" form). Larger models need more RAM, a GPU with plenty of video memory (VRAM), or an Apple Silicon Mac with lots of unified memory.
Once a model is downloaded, it runs on your own machine. Your prompts do not need to leave your computer, there is no per-message fee, and it works offline. The trade-off is that local models are usually less capable than the largest cloud models, and speed depends entirely on your hardware.
Why Run an LLM Locally?
| Reason | What it means in practice |
|---|---|
| Privacy | Prompts and documents are processed on your own computer, which matters for confidential notes, client files or code |
| No usage fees | After the download, generating text costs nothing beyond electricity |
| Works offline | Useful when travelling or on restricted networks |
| Control | You choose the exact model and version, and it does not change unless you change it |
| Learning | Running models yourself is one of the best ways to understand how LLMs actually work |
| Building apps | Both Ollama and LM Studio expose a local API, so you can prototype AI features without a cloud account |
And the reasons it may not be for you:
- The most capable frontier models (the ones behind the top tiers of ChatGPT, Claude and Gemini) are not available as downloadable weights.
- Large models need expensive hardware.
- You are responsible for updates, storage and choosing a model whose license fits your use.
If you are new to how these models work under the hood, our machine learning for beginners guide covers the basic concepts first.
Hardware Basics: Parameters, Memory and Quantization
Parameters decide size
A model's size is described by its number of parameters, the learned numbers inside it. You will see names like 4B, 8B, 20B or 70B, meaning 4, 8, 20 or 70 billion parameters. More parameters generally means better answers and more memory needed.
Quantization makes models fit
In their original form, many models store each parameter as a 16-bit number (2 bytes). Quantization compresses those numbers to fewer bits, commonly 8-bit or 4-bit, which shrinks the model dramatically with a modest loss in quality. Most models you download for local use are already quantized.
You can estimate the size of the weights with simple arithmetic:
memory for weights (GB) ≈ parameters (billions) × bits per parameter ÷ 8
| Model size | 16-bit (unquantized) | 8-bit | 4-bit |
|---|---|---|---|
| 4B | about 8 GB | about 4 GB | about 2 GB |
| 8B | about 16 GB | about 8 GB | about 4 GB |
| 14B | about 28 GB | about 14 GB | about 7 GB |
| 32B | about 64 GB | about 32 GB | about 16 GB |
| 70B | about 140 GB | about 70 GB | about 35 GB |
These figures cover the weights only. You also need room for the context (the conversation and documents the model is reading, often called the KV cache), the runner itself, your operating system and your other apps. A sensible rule is to leave several gigabytes of headroom beyond the weights, more if you use long documents.
Real downloads line up with this arithmetic. On Ollama's model library, for example, the default 8B Qwen3 tag is a 5.2 GB download and the 14B tag is 9.3 GB. OpenAI's gpt-oss page says its 20B model is quantized to about 4.25 bits per parameter so it can run on machines with about 16 GB of memory.
RAM, VRAM and unified memory
- System RAM: a model can run entirely on the CPU from normal RAM. This works, but it is noticeably slower.
- GPU VRAM: a graphics card with enough video memory to hold the model gives much faster responses. If the model does not fit, runners can split it between GPU and CPU, which is slower than fitting entirely on the GPU.
- Apple Silicon unified memory: M-series Macs share one pool of memory between CPU and GPU, so a Mac with 32 GB or more of memory can run fairly large models without a separate graphics card.
A rough guide to what fits
| Your machine | Comfortable model sizes (4-bit) | Good for |
|---|---|---|
| 8 GB RAM, no GPU | Roughly 1B to 4B | Simple chat, summaries, trying things out |
| 16 GB RAM, or a GPU with 8 GB VRAM | Up to about 8B to 14B | Everyday writing, Q&A, light coding help |
| 32 GB RAM or Mac with 32 GB, or a 16 GB GPU | Up to about 20B to 32B | Stronger reasoning and coding |
| 64 GB or more, or a 24 GB+ GPU | 32B and some larger models | Demanding reasoning, coding and long documents |
Treat this as a starting point, not a guarantee. Context length, quantization level and other running apps all change the numbers.
Disk space
Models are big files. Ollama's Windows documentation notes the install needs at least 4 GB and models "can be tens to hundreds of GB in size." Plan for 5 to 20 GB per mid-sized model.
Option 1: Ollama (Command Line, Very Lightweight)
Ollama is a free, open-source tool for downloading and running models from the command line, with a local API for developers.
Step 1: Install
Follow the official instructions on the Ollama download page. According to the project's GitHub README:
Windows (PowerShell):
irm https://ollama.com/install.ps1 | iex
Or download and run OllamaSetup.exe. Ollama's docs list Windows 10 22H2 or later as the minimum, and it installs into your user folder without needing administrator rights.
macOS: download the app from the website, open the disk image and drag Ollama into Applications, or run:
curl -fsSL https://ollama.com/install.sh | sh
Ollama's macOS docs require macOS 14 Sonoma or later. Apple Silicon Macs get GPU acceleration; Intel Macs run on the CPU only.
Linux:
curl -fsSL https://ollama.com/install.sh | sh
Step 2: Run your first model
Open a terminal and run a model. The run command downloads the model the first time and then opens a chat:
ollama run gemma4
Type a question and press Enter. To leave the chat, type /bye.
To pick a specific size, add a tag after a colon. Each model's page on the Ollama library lists the available tags and download sizes, for example:
ollama run qwen3:8b
ollama run gpt-oss:20b
Step 3: Learn the essential commands
From Ollama's CLI reference:
| Command | What it does |
|---|---|
ollama run MODEL | Download if needed, then chat with a model |
ollama pull MODEL | Download a model without starting a chat |
ollama ls | List the models you have installed |
ollama ps | Show which models are loaded right now |
ollama stop MODEL | Unload a running model and free memory |
ollama rm MODEL | Delete a model from disk |
Step 4 (optional): Use the local API
Ollama serves an API on your own machine at port 11434, so other apps and scripts can use your local model:
curl http://localhost:11434/api/chat -d '{
"model": "gemma4",
"messages": [{ "role": "user", "content": "Why is the sky blue?" }],
"stream": false
}'
Moving models to another drive
On Windows, models are stored in .ollama inside your user folder by default. To use a bigger drive, Ollama's docs explain how to set a user environment variable named OLLAMA_MODELS to a new folder and then restart Ollama.
Option 2: LM Studio (Desktop App, No Terminal Needed)
LM Studio is a desktop app with a graphical interface for finding, downloading and chatting with local models. It is not open source, but it has been free for both personal and work use since July 2025.
System requirements
From LM Studio's system requirements page:
- Mac: Apple Silicon (M-series) with macOS 14 or later; Intel Macs are not supported. 16 GB of memory or more is recommended.
- Windows: x64 with AVX2 support, or ARM (Snapdragon X Elite). At least 16 GB of RAM and 4 GB or more of dedicated VRAM are recommended.
- Linux: x64 or ARM64, distributed as an AppImage, Ubuntu 20.04 or newer.
Step by step
Following LM Studio's getting started guide:
- Download and install the latest version from lmstudio.ai/download.
- Open the Discover tab and either choose a curated model or search by name (for example "Gemma" or "Qwen").
- Pick a file that fits your memory. Models come in several quantized versions; the app shows file sizes so you can choose one that fits.
- Go to the Chat tab, open the model loader at the top and select the model you downloaded.
- Start chatting. Optional load settings, such as context length, let you trade memory use for how much text the model can consider at once.
Running LM Studio as a local server
LM Studio can also act as a local API server. Turn on Start server in the Developer tab, or run lms server start from a terminal. Its server documentation lists OpenAI-compatible endpoints, so many existing tools and scripts can point at your local model with minimal changes.
Ollama or LM Studio?
| Ollama | LM Studio | |
|---|---|---|
| Interface | Command line (plus a desktop app) | Graphical desktop app |
| Source | Open source | Closed source, free for personal and work use |
| Best for | Developers, scripting, servers | Beginners, browsing and comparing models visually |
| Local API | Yes, port 11434 | Yes, including OpenAI-compatible endpoints |
| Platforms | Windows, macOS, Linux, Docker | Windows, macOS (Apple Silicon), Linux |
Many people install both: LM Studio for exploring models, Ollama for anything automated.
How to Pick an Open-Weight Model
"Open-weight" means the trained model files are published for download. That is not always the same as fully open source: licenses vary, and some restrict certain commercial uses. Always read the license on the model's page before using it in a product.
Popular families you will find in both Ollama's library and LM Studio's Discover tab include:
| Family | Publisher | Notes |
|---|---|---|
| Gemma | Google DeepMind | Several sizes from small to around 31B on Ollama; current tags accept text and images |
| Qwen | Alibaba's Qwen team | A wide spread of sizes, from under 1B to very large |
| gpt-oss | OpenAI | 20B and 120B versions under the Apache 2.0 license |
| Llama | Meta | Widely supported; check the Llama license terms |
| Mistral | Mistral AI | Several sizes; licenses differ by model |
A simple process for choosing:
- Start with your memory budget. Use the tables above to find the largest size that fits with headroom.
- Match the model to the job. General chat, coding and reasoning models differ. Model pages usually say what each variant is tuned for.
- Start small and step up. Try a 4B to 8B model first. If answers are too weak, move up a size and see whether the speed is still acceptable.
- Compare on your own tasks. Run the same five real prompts on two or three models and pick the one that does best on your work, not on a leaderboard.
- Check the license if you plan to use it commercially.
Good prompts matter even more with smaller local models, so the techniques in our prompt engineering guide for beginners are worth applying here.
Limits of Running Models Locally
- Quality gap: small local models are usually weaker than the largest cloud models at complex reasoning, long documents and up-to-date knowledge.
- No live knowledge by default: a local model only knows what was in its training data unless you give it documents or connect it to a search tool.
- Speed depends on hardware: a model that barely fits in memory, or that spills from GPU to CPU, can be slow.
- They still make things up: local models hallucinate just like cloud models. Check facts that matter.
- Maintenance is yours: updating runners, managing disk space and choosing new models is up to you.
- Security still matters: only download models and runners from official sources, and be careful before exposing a local API to your network.
Local models are an excellent fit for private drafting, summarizing your own documents, experimenting and prototyping. For the hardest tasks, many people use a local model day to day and a cloud assistant when they need the extra capability. Our ChatGPT vs Claude vs Gemini comparison covers the cloud side, and if you want to build something with your local model, how to build an AI chatbot for your website is a practical next project.
FAQ
Can I run an LLM locally without a GPU?
Yes. Both Ollama and LM Studio can run models on the CPU using normal RAM. Responses are slower than on a GPU, so start with a small model (around 1B to 4B parameters) and work up.
How much RAM do I need to run an LLM locally?
It depends on model size and quantization. As a rough guide, a 4-bit 8B model needs about 4 to 5 GB for its weights plus headroom, so 16 GB of RAM is a comfortable starting point. OpenAI's gpt-oss 20B model is designed to run in about 16 GB of memory, according to its Ollama model page.
Is running an LLM locally completely private?
Prompts are processed on your own computer, which is far more private than sending them to a cloud service. Privacy still depends on the rest of your setup: the apps you connect, any cloud features you enable, and the security of your machine.
Is Ollama free?
Yes, Ollama is free and open source. LM Studio is also free for personal and work use, although it is not open source.
Which local model should a beginner start with?
Pick a small, recent general-purpose model from a well-known family, such as a smaller Gemma or Qwen variant, run it with ollama run or download it in LM Studio, and test it on your real tasks before moving to anything larger.
Want More AI Insights?
Join 10,000+ professionals getting weekly AI news, tool reviews, and tutorials.
Explore More Articles