How to Run AI Locally in 2026: Windows, Mac and Linux Guide

Run an AI model on your own computer in about 10 minutes. Which model fits your GPU or Mac, install steps for Windows, macOS and Linux, real tokens-per-second numbers, and fixes for the common errors.

By · Updated
The short answer

To run AI locally, install Ollama (or LM Studio if you prefer no terminal), pull a model that fits your memory, and add Open WebUI for a ChatGPT-style chat. An 8 GB GPU runs an 8B model at about 30-70 tokens per second; a 24 GB GPU runs 30B-class models. Without a GPU it still works, only slower. Everything stays on your machine, with no account or API key.

How to Run AI Locally in 2026Link to this section

Short answer: install Ollama (or LM Studio if you want no terminal), run ollama run qwen3:8b, and you are chatting with an AI model on your own computer. Add Open WebUI for a ChatGPT-style interface. Nothing leaves your machine and there is no account or API key.

The rest of this page covers which model fits your hardware, the exact steps for Windows, macOS and Linux, how fast it will be, and what to do when it is slow or runs out of memory.

What you needLink to this section

Three pieces, and you can swap each one independently:

  1. A model: the weights, for example Qwen3, Gemma 3, gpt-oss or Llama 3.3. You download these as GGUF files (Ollama does it for you).
  2. A runner: the program that loads the model and generates text. Ollama, LM Studio, llama.cpp, or vLLM for serving a team.
  3. An interface: where you type. The runner's own chat window, Open WebUI, AnythingLLM for documents, or your own code through the local API.

The hardware decides which model you can use. The rule that matters: the model has to fit in your GPU memory (VRAM), or unified memory on a Mac. If it does not fit, it still runs but spills onto the CPU and gets several times slower.

Step 1: pick a model that fits your hardwareLink to this section

A 4-bit (Q4_K_M) model needs roughly 0.6 GB per billion parameters, plus 1-3 GB for the conversation context. Start here, then check your exact setup in the VRAM calculator or What can I run?.

Your hardwareGood first modelOllama command
No GPU, 16 GB RAMQwen3 4Bollama run qwen3:4b
8 GB GPU (RTX 4060, 3070) or Mac with 16 GBQwen3 8Bollama run qwen3:8b
12 GB GPU (RTX 3060 12GB, Arc B580)Qwen3 14Bollama run qwen3:14b
16 GB GPU (RTX 5060 Ti, RX 9070 XT) or Mac with 24 GBgpt-oss 20Bollama run gpt-oss:20b
24 GB GPU (RTX 3090, 4090, RX 7900 XTX)Qwen3 30B-A3Bollama run qwen3:30b
32 GB GPU (RTX 5090) or Mac with 48-64 GBQwen3 32B at higher quality, or two models at onceollama run qwen3:32b
Mac with 96 GB+ or two 24 GB GPUsLlama 3.3 70Bollama run llama3.3:70b

New models arrive every week. The leaderboard and the best-of pages track what currently performs best for coding, chat and documents at each size.

Step 2: install a runnerLink to this section

WindowsLink to this section

  1. Download the Ollama installer from ollama.com/download and run it. It installs as a background service with a tray icon.
  2. Open PowerShell or Terminal and run ollama run qwen3:8b (or the command from the table). The first run downloads the model.
  3. Type a question. Type /bye to exit.

NVIDIA cards work with the normal Game Ready or Studio driver; no separate CUDA install is needed. Recent AMD Radeon cards are supported on Windows too; check the hardware page for your card.

macOS (Apple Silicon)Link to this section

  1. Download Ollama for macOS from ollama.com/download, or run brew install ollama.
  2. Open Terminal and run ollama run qwen3:8b.

Macs use unified memory, so a 24 GB Mac can hold models a 12 GB GPU cannot, but generation is slower than on a fast GPU with the same memory. Leave about a quarter of the RAM for macOS and your apps. LM Studio can also run MLX builds of models, which are often faster on Apple Silicon.

LinuxLink to this section

curl -fsSL https://ollama.com/install.sh | sh
ollama run qwen3:8b

The script sets Ollama up as a systemd service. NVIDIA needs the proprietary driver; AMD needs a ROCm-supported card. nvidia-smi or rocm-smi should list your GPU before you start.

No terminal at all: LM StudioLink to this section

Install LM Studio, open the Discover tab, search for a model (it marks which builds fit your memory), download, and chat. It can also start a local OpenAI-compatible server so other apps can use the model.

Step 3: add a chat interfaceLink to this section

For daily use you want a proper interface with history and file uploads:

  • Open WebUI: looks like ChatGPT, supports multiple users and document chat, finds Ollama automatically.
  • AnythingLLM: desktop app built around chatting with your PDFs and folders.

Open WebUI with Docker:

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data --name open-webui \
  ghcr.io/open-webui/open-webui:main

Open http://localhost:3000 and create the first account (it becomes the admin). Your Ollama models appear in the model picker.

How fast will it be?Link to this section

Generation speed is set mostly by memory bandwidth divided by model size. A rough ceiling: tokens per second ≈ bandwidth (GB/s) ÷ model file size (GB). Real numbers land below that ceiling.

Llama 3 8B at Q4_K_M, text generation:

HardwareMemoryTokens/secSource
RTX 409024 GB127.7measured, public llama.cpp benchmark
RTX 309024 GB111.7measured, public llama.cpp benchmark
RTX 3080 10GB10 GB106.4measured, public llama.cpp benchmark
RTX 30708 GB70.9measured, public llama.cpp benchmark
RTX 509032 GBabout 210estimated from 1,792 GB/s bandwidth
RTX 3060 12GB12 GBabout 42estimated from 360 GB/s
RTX 40608 GBabout 32estimated from 272 GB/s
Mac mini M4 Pro24 GBabout 32estimated from 273 GB/s
Mac mini M416 GBabout 14estimated from 120 GB/s

Measured rows come from the open GPU-Benchmarks-on-LLM-Inference results; estimated rows use our bandwidth model and are labelled as estimates on each hardware page. Reading speed is about 5-10 tokens per second, so anything above 20 feels instant in chat. Larger models scale down roughly with size: a 30B model on the same card runs at about a quarter of the 8B speed (mixture-of-experts models like Qwen3 30B-A3B run much faster than their size suggests).

When it is slow or runs out of memoryLink to this section

  • Check where it runs: ollama ps shows the PROCESSOR column. "100% GPU" is what you want. A CPU/GPU split means the model or its context did not fit.
  • Pick a smaller quantization or model: Q4_K_M is the usual sweet spot. Going from a 14B to an 8B model, or Q8 to Q4, frees a lot of memory.
  • Shorten the context: long chats and big documents grow the KV cache. A model that loads fine can still fail on a long prompt. Weights, KV cache and context explains why, with a worked example.
  • Close other GPU users: browsers, games and image generators hold VRAM too.

What to do nextLink to this section

Where to go nextLink to this section

Frequently asked

Can I run AI locally without a GPU?

Yes. Ollama, LM Studio and llama.cpp all run on the CPU. Speed is set mostly by memory bandwidth, so a laptop with dual-channel DDR5 runs a 4-bit 8B model at single-digit to low-teens tokens per second. Small models (Qwen3 4B, Gemma 3 4B, Phi-4 mini) feel usable on CPU; 30B models do not.

How much RAM or VRAM do I need to run AI locally?

A 4-bit (Q4_K_M) model needs roughly 0.6 GB per billion parameters for the weights, plus 1-3 GB for context and runtime. So 8B models want about 6-8 GB, 14B about 10-12 GB, and 30B-class models about 20-24 GB. Use the VRAM calculator for an exact estimate for your model and context length.

Is running AI locally free?

The software (Ollama, LM Studio, Open WebUI, llama.cpp) and open-weight models are free to download. Your costs are the hardware you already own and electricity.

Is my data private when I run AI locally?

Yes, if the model and the chat interface both run on your machine. You can check by disconnecting from the internet and confirming the model still answers.

Which is better for beginners, Ollama or LM Studio?

LM Studio if you want a desktop app with a model browser and no terminal. Ollama if you want a background service that other apps (Open WebUI, VS Code extensions, n8n) can call. Both use llama.cpp underneath and run the same GGUF models.

Why is my local model so slow?

Usually part of the model did not fit in VRAM and spilled to the CPU. Run `ollama ps` and check the PROCESSOR column; anything other than 100% GPU means a smaller model, a smaller quantization or a shorter context will be much faster.

Will a local model replace ChatGPT?

For chat, drafting, summarising, coding help and questions over your own documents, current open-weight 20B-30B models are good enough for many people. Frontier cloud models still lead on the hardest reasoning and long agentic tasks.