Skip to content
MintFlow Articles

How to run an LLM locally: Ollama, LM Studio and the hardware you need

Why you'd run a model on your own computer, how much memory each model size needs, which open-weight models fit which machine, and step-by-step setup in Ollama and LM Studio

On this page
  1. Why run an LLM locally?
  2. What hardware do you need to run an LLM locally?
  3. How do model size and quantization map to memory?
  4. Which open-weight models should you run?
  5. Gemma 4 (Google)
  6. Qwen3.8-27B (Alibaba)
  7. gpt-oss (OpenAI)
  8. The giant open models
  9. The main tools for running models locally
  10. How to run an LLM locally with Ollama
  11. How to run an LLM locally with LM Studio
  12. Local vs cloud models: what are the limits?
  13. Frequently asked questions

To run an LLM locally, install a free app such as Ollama or LM Studio, download an open-weight model small enough for your computer's memory, and chat with it offline. A machine with 16 GB of memory handles models such as gpt-oss-20b or Gemma 4 12B, while 24 to 32 GB of graphics memory, or a Mac with 32 GB, runs 27B to 31B models such as Qwen3.8-27B and Gemma 4 31B.

Memory is the number that decides everything. This guide explains why you'd run a model yourself, how model size and quantization translate into gigabytes, which current models fit which machine, how to set up Ollama and LM Studio step by step, and where local models still fall short of ChatGPT, Claude and Gemini.

Why run an LLM locally?

  • Privacy. When the model runs on your machine, your prompts stay there. Ollama's FAQ says it doesn't see your prompts or data when you run models locally, and LM Studio's docs say nothing you type into a chat with a downloaded model leaves your device.
  • Offline use. LM Studio lists chatting with downloaded models, chatting with your own documents and running a local server as things that work with no internet connection. You only need to be online to find and download models and updates.
  • Cost. There's no subscription and no per-token bill. You pay once for the hardware (and for the electricity), which makes local models attractive for heavy, repetitive jobs.
  • Control. You pick the exact model and version, nobody changes it under you, and there are no usage caps beyond what your hardware can do.

The trade-off is quality and speed, which this guide gets to at the end.

What hardware do you need to run an LLM locally?

The model has to fit in fast memory. That means one of three things:

  • VRAM, the memory on a graphics card. This is the fastest place to run a model, and it's the number to check on a Windows or Linux PC.
  • Unified memory on an Apple silicon Mac, where the CPU and GPU share one pool. Ollama's quickstart counts a Mac's unified memory the way it counts VRAM, but macOS and your other apps need their share too, so a 16 GB Mac has less than 16 GB free for a model.
  • System RAM. If a model doesn't fit in VRAM, Ollama spills part of it into regular RAM and runs it on the CPU. It works, but Ollama warns that responses get slower.

LM Studio's published requirements are a good floor. On a Mac it needs Apple silicon (M1 or later) and macOS 14 or newer, and it recommends 16 GB of memory or more; on 8 GB Macs it suggests sticking to small models and short contexts. On Windows it runs on x64 and ARM, needs a processor with AVX2 on x64, and recommends 16 GB of RAM and at least 4 GB of dedicated VRAM. On Linux it ships as an AppImage for x64 and ARM64.

For GPUs, Ollama supports Nvidia cards with compute capability 5.0 or higher on recent drivers (up to the RTX 50 series), a long list of AMD Radeon and Ryzen AI chips through ROCm 7, Apple GPUs through Metal, and others through Vulkan on Windows and Linux.

How do model size and quantization map to memory?

A model's size is its parameter count: the "27B" in Qwen3.8-27B means 27 billion parameters. Each parameter takes a set amount of memory, and quantization shrinks that by storing parameters with fewer bits, at a small cost in quality.

A quick rule of thumb:

  • 16-bit (full precision): about 2 GB per billion parameters.
  • 8-bit: about 1 GB per billion.
  • 4-bit: about 0.5 to 0.6 GB per billion, which is where most people run local models.

Google's own numbers for Gemma 4 show the effect. They cover the weights only, with about 20% loading overhead included, and leave out the context:

Gemma 4 model 16-bit 8-bit 4-bit
E2B 11.4 GB 5.7 GB 2.9 GB
E4B 17.9 GB 8.9 GB 4.5 GB
12B 26.7 GB 13.4 GB 6.7 GB
26B A4B 57.7 GB 28.8 GB 14.4 GB
31B 69.9 GB 34.9 GB 17.5 GB

Three things add to those figures:

  1. Context. The longer the conversation or document, the more memory the model's working cache needs. Leave a few gigabytes of headroom. Ollama's context-length page says it picks a default by how much VRAM you have: 4k tokens under 24 GiB, 32k from 24 to 48 GiB and 256k at 48 GiB or more. (Ollama's FAQ still gives a flat 4,096-token default; the context-length page is newer and more detailed.) For coding tools and agents, Ollama recommends at least 64,000 tokens.
  2. The quantization format. Files you download from Hugging Face or LM Studio often use the GGUF format, and their names tell you the bits. Q8_0 is 8-bit, Q6_K works out to about 6.6 bits per parameter, Q5_K about 5.5 and Q4_K about 4.5, according to Hugging Face's GGUF docs. Q4_K_M is a common default.
  3. Mixture-of-experts (MoE) models. Models such as Gemma 4 26B A4B only use about 4 billion parameters for each token they generate, which makes them fast, but all 26 billion still have to be loaded. Plan memory around the total, not the active count.

Which open-weight models should you run?

Match the model to your memory. This table uses Ollama's download sizes, which include the parts beyond the core weights:

Memory available for the model Good fits Download size in Ollama
8 GB Gemma 4 E2B or E4B 4.6 GB or 6.6 GB at Q4_K_M (Mac MLX versions are bigger)
12 to 16 GB Gemma 4 12B; gpt-oss-20b on 16 GB 7.7 to 8 GB; 14 GB
24 to 32 GB Qwen3.8-27B, Gemma 4 26B A4B, Gemma 4 31B 18 GB; 16 to 19 GB; 19 to 20 GB
80 GB and up gpt-oss-120b 65 GB
Data-center hardware Kimi K3, DeepSeek V4 Pro Far beyond home machines

Gemma 4 (Google)

The widest range of sizes, from E2B and E4B (small enough for phones and 8 GB laptops) through 12B to a 26B mixture-of-experts model and a dense 31B. All take text and images, Google says E2B, E4B and 12B also take audio, and the 12B and larger models have 256,000-token context windows (the two small ones get 128,000). Google releases them under an Apache 2.0 license, so commercial use is allowed. Ollama's quickstart uses Gemma 4 E2B as its local example and recommends 8 GB of available VRAM, or unified memory on a Mac, to run it.

Qwen3.8-27B (Alibaba)

The model several late-2026 local guides suggest first for a 24 GB graphics card or a 32 GB Mac. It's a dense 27-billion-parameter model that reads images as well as text, with a native context window of 262,144 tokens, under Apache 2.0. Ollama lists it at 18 GB with support for tools and step-by-step "thinking" mode.

gpt-oss (OpenAI)

OpenAI's open-weight models come in two sizes, both text-only with 128,000-token context and adjustable reasoning effort. gpt-oss-20b is a 14 GB download that Ollama says runs with as little as 16 GB of memory. gpt-oss-120b is a 65 GB download that fits on a single 80 GB GPU. Both use the Apache 2.0 license.

The giant open models

The strongest open-weight models are nowhere near laptop size. Moonshot AI's Kimi K3 has 2.8 trillion parameters (104 billion active), and DeepSeek V4 Pro has 1.6 trillion (49 billion active) with a 1-million-token context window. Kimi K3's Hugging Face page recommends server engines such as vLLM and SGLang to run it. You can use these models through cloud services, including the cloud options in LM Studio's Bionic app, but not on a home computer.

The main tools for running models locally

Tool What it is Platforms Best for
Ollama Free, open-source (MIT) runtime with a desktop app, command line and local API macOS, Windows, Linux Developers, and apps or agents that need a local API
LM Studio Free desktop app with model search, chat and a local server Apple silicon Macs, Windows (x64 and ARM), Linux Beginners who want a point-and-click app
llama.cpp Open-source (MIT) C/C++ engine with a command line, server and web chat A wide range of hardware Tinkerers who want full control
Jan Free, open-source chat app Desktop An open-source alternative to LM Studio
vLLM Open-source serving library for high throughput Nvidia and AMD GPUs, plus plug-ins Serving a model to many users from a server

Ollama is the usual starting point if you want to script things or connect other apps. It downloads and manages models, runs them on your GPU, and exposes an API on your machine at port 11434 that other apps can use, including an OpenAI-compatible version. It uses llama.cpp under the hood, also has an MLX engine for Apple silicon, and offers optional cloud models if you sign in.

LM Studio is the friendliest option. You search for models inside the app, download the version that fits, and chat in a ChatGPT-style window. It runs both llama.cpp and Apple's MLX under the hood, and it has been free for use at work as well as at home since July 2025. Its makers now also offer Bionic, an agent app for open models that can run them on your machine or, for heavier jobs, use big open models such as Kimi K3 through LM Studio's cloud.

llama.cpp is the engine much of this is built on. Its README now gives a one-line installer, a llama cli command to chat with a model straight from Hugging Face, and llama serve to start an OpenAI-compatible server with a built-in chat page.

How to run an LLM locally with Ollama

  1. Install Ollama. Download it from ollama.com/download (a .dmg for macOS, an installer for Windows), or use the install script. On macOS or Linux:

    curl -fsSL https://ollama.com/install.sh | sh
    

    On Windows, in PowerShell:

    irm https://ollama.com/install.ps1 | iex
    
  2. Download and start a model. This pulls Gemma 4 12B if you don't have it yet, then opens a chat in your terminal:

    ollama run gemma4:12b
    

    Swap in qwen3.8:27b or gpt-oss:20b if your machine has the memory. Type /bye to leave the chat.

  3. Check it's on the GPU. Run ollama ps. The PROCESSOR column should read 100% GPU. A split such as 48%/52% CPU/GPU means the model didn't fit and will be slower.

  4. Give it more context if you need it. Use the context length slider in the Ollama app's settings, or start the server with OLLAMA_CONTEXT_LENGTH=64000 ollama serve. Check you still have the memory with ollama ps.

  5. Connect other apps. Ollama listens at http://localhost:11434, with an OpenAI-compatible endpoint at http://localhost:11434/v1, so chat front ends, editors and coding agents can use your local model.

  6. Keep it local-only if you want. Setting OLLAMA_NO_CLOUD=1 turns off cloud models and web search, so your prompts can't be sent to Ollama's servers by mistake.

By default Ollama only accepts connections from your own computer. Setting OLLAMA_HOST=0.0.0.0 opens it to your whole network, so don't do that on a network you don't trust. Models are stored in ~/.ollama/models on macOS and C:\Users\<you>\.ollama\models on Windows; set OLLAMA_MODELS to move them to a bigger drive. Models stay loaded for five minutes after use unless you change OLLAMA_KEEP_ALIVE or run ollama stop with the model's name.

How to run an LLM locally with LM Studio

  1. Install LM Studio from lmstudio.ai, after checking the system requirements above.
  2. Find a model. Open the Discover tab (a full Model Search page in recent versions) and search by name, for example "Gemma 4" or "Qwen3.8". Pick a quantization that fits your memory; Q4_K_M is a sensible first choice.
  3. Load it. Go to the Chat tab, open the model loader at the top, choose the model and, if you like, set its context length and other load options.
  4. Chat. Type as you would in ChatGPT. You can also drag in documents and chat with them, and LM Studio processes them on your machine.
  5. Serve it to other apps (optional). In the Developer tab, switch on Start server, or run lms server start in a terminal. LM Studio's OpenAI-compatible API lives at http://localhost:1234/v1, and it can also serve other devices on your local network.

If you want a coding agent to use your local model, the setup is similar in most tools: point the agent at Ollama's or LM Studio's local address and give the model a large context window. Our guide to running local models in FireMoon Harness walks through one example.

Local vs cloud models: what are the limits?

  • Quality. The models that fit on a home computer are a small fraction of the size of the best open models, and the headline results in METR's November 2026 agent measurements are for closed cloud models from OpenAI and Anthropic. For hard reasoning, long coding jobs and anything where mistakes are costly, a cloud model is usually the safer choice.
  • Speed. A model that spills out of VRAM into system RAM slows down sharply. Long contexts slow things down and eat memory too.
  • Agents. Agents run long, tool-heavy loops and need big context windows. A small local model can drive an agent, but it makes more mistakes than a frontier one; our explainer on what an AI agent is covers why that matters.
  • Features. Web search, voice and image generation aren't built in. Ollama's web search, for example, is part of its cloud features.
  • Upfront cost and upkeep. You pay for the hardware, and big model files take up disk space: gpt-oss-120b alone is 65 GB.
  • Privacy has edges. Local means local only while you use a local model. Ollama's cloud models and the cloud options in LM Studio's Bionic send prompts to a server, so check which one you've selected.

If the limits outweigh the benefits for you, a $20 cloud plan may be the better deal; ChatGPT vs Claude vs Gemini compares them.

Frequently asked questions

Can you run an LLM locally without a GPU?

Yes, but slowly. Ollama can run a model from system RAM on the CPU when it doesn't fit in graphics memory. Stick to small models such as Gemma 4 E2B or E4B.

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

16 GB is a practical starting point, and it's what LM Studio recommends. 8 GB handles only the smallest models, while 24 to 32 GB of graphics or unified memory runs 27B to 31B models such as Qwen3.8-27B at 4-bit.

Is Ollama or LM Studio better?

LM Studio is easier if you want a point-and-click app with built-in model search. Ollama suits you if you prefer a command line and a local API for other apps and agents. Both are free and both run GGUF models.

Is running an LLM locally private?

Yes, while the model runs on your machine. Ollama says it doesn't see your prompts when you run locally, and LM Studio says chats with downloaded models stay on your device. Cloud models offered inside these apps are a different matter.

What is the best LLM to run locally?

For a 24 GB graphics card or a 32 GB Mac, Qwen3.8-27B and Gemma 4 31B are the usual picks in late 2026. On 16 GB, try gpt-oss-20b or Gemma 4 12B, and on 8 GB, Gemma 4 E4B.

Is a local LLM as good as ChatGPT or Claude?

Not for the hardest work. Top open models such as Kimi K3 (2.8 trillion parameters) and DeepSeek V4 Pro (1.6 trillion) need data-center hardware, so the models that fit at home are much smaller and make more mistakes.

Sources

Was this helpful?

Keep reading

Colorful JavaScript code on a dark screen, for choosing the best code editor
AI Coding Tools
AI & Dev Tools

The best code editor in 2026: VS Code, Cursor, Zed, JetBrains and more compared

The best code editors of late 2026 compared: VS Code, Cursor, Zed, JetBrains IDEs, Neovim, Sublime Text, Devin Desktop and Antigravity on price, AI, platforms and fit.

15 min read

A video editing timeline on a dark screen, for picking the best AI video generator
Best AI Tools
AI & Dev Tools

Best AI video generator in 2026: Gemini Omni, Kling, Seedance, Runway and more

The best AI video generators in November 2026, from Google's Gemini Omni to Kling 4.0, Seedance 2.5 and Runway, compared on clip length, audio, price and commercial rights.

16 min read

A hand holding a phone showing the Google search page, for the best AI search engine comparison
Best AI Tools
AI & Dev Tools

The best AI search engine in 2026: Perplexity, Google AI Mode, ChatGPT and five more compared

The best AI search engines of late 2026 compared: Perplexity, Google AI Mode, ChatGPT search, Gemini, Claude, Copilot, Brave and Kagi on price, citation accuracy, ads and privacy.

16 min read