Running AI Models Locally: A Beginner’s Guide
Table of Contents
For people who understand computers and programming but are new to AI. Numbers below are rules of thumb, not benchmarks; model names and versions change fast, so check each model’s page on Hugging Face before downloading.
1. The big picture #
A model is a large file of numbers plus a small program that uses those numbers to turn input into output. Running locally means your own computer does that work, instead of sending your text to a cloud service such as ChatGPT or Claude.
- Why: privacy, offline use, no per-use fees, full control.
- Trade-offs: you need capable hardware, and models that fit on consumer hardware are usually weaker than the biggest cloud models.
ELI5: A model is a giant recipe book written in numbers. A cloud service is a restaurant. Running locally is cooking at home: you need your own kitchen (hardware), but nobody sees what you order.
2. Core vocabulary #
- AI (Artificial Intelligence) / LLM (Large Language Model): an LLM is a neural network trained on huge amounts of text to predict the next piece of text. Chat assistants are built on this [1].
- Parameters: the learned numbers inside the model. “7B” means 7 billion parameters.
- Weights: the parameters as stored in the model file. People use “weights” and “parameters” almost interchangeably. File size ≈ parameters × bytes per parameter.
- Training vs inference: Training is the expensive learning phase (done by labs, costs millions). Inference means running an already-trained model to get answers. Local use is almost always inference. Fine-tuning is a small extra round of training on your own data.
- Open weights vs open source: Open weights means you can download and run the weights, but the training data and training code may stay private, and the license may have limits. Open source AI in the strict sense also requires enough information about data and code to rebuild the model [2]. Licenses differ: DeepSeek-R1 uses MIT [4]; many Qwen models use Apache 2.0 [5]; Llama uses a custom license.
- Token: a chunk of text, roughly 4 English characters or about 3/4 of a word. Models read and write tokens, not words.
- Input tokens: everything you send: your question, system instructions, chat history, pasted documents.
- Output tokens: what the model generates.
- Cloud services bill per token. Locally, tokens cost time and memory instead of money.
- Prefill vs decode: Prefill processes your input all at once (limited by compute). Decode produces the answer one token at a time (limited by memory bandwidth). Speed is measured in tokens per second (t/s).
- Context window: the maximum number of tokens (input plus output) the model can consider at once, e.g. 8K, 32K, 128K.
- KV cache (Key-Value cache): memory where the model keeps notes about every earlier token. It grows with context length and can take several GB.
ELI5 (tokens): Tokens are Lego bricks of language. “Unbelievable” might be 3 bricks; “cat” is 1. The model builds its answer one brick at a time.
ELI5 (context window): It is the size of the model’s desk. A bigger desk holds more pages at once, but takes more room in your kitchen.
ELI5 (inference): Training is going to school. Inference is taking the exam after you have already learned.
3. Model types #
| Type | What it means | Example |
|---|---|---|
| Base | Only predicts the next text. Not good at following instructions. | Qwen3-8B-Base |
| Instruct / Chat | Further trained to follow instructions and chat. Best default choice. | Qwen3-8B |
| Reasoning (“thinking”) | Writes a long step-by-step “thought” before answering. Better at math and code, but uses many more output tokens. | DeepSeek-R1 [4] |
| Dense | Every parameter is used for every token. | Qwen3-32B |
| MoE (Mixture of Experts) | Many specialist sub-networks; only a few activate per token [7]. | Qwen3-30B-A3B |
| Distilled | A small model trained to imitate a bigger one. | DeepSeek-R1-Distill-Qwen-7B |
| Multimodal / VL (Vision-Language) | Accepts images (sometimes audio) as input. | Qwen-VL family |
| Embedding | Turns text into numbers for search; does not chat. | bge, nomic-embed |
| Coding | Tuned for programming. | Qwen-Coder family |
Size classes (rough): tiny under 3B, small 3-9B, medium 10-35B, large 70B+, huge 200B+.
ELI5 (MoE): A hospital with 100 doctors. For each patient only the 3 right specialists look at them. You must keep all 100 doctors in the building (memory for total parameters), but each patient is seen quickly (speed depends on active parameters).
4. Model families you will meet #
- DeepSeek (Chinese lab). DeepSeek-V3 is a 671B-parameter MoE with 37B active per token [3]. DeepSeek-R1 is the reasoning model built on it [4]. Common confusion: the small “DeepSeek-R1” models (1.5B to 70B) that people run locally are distills: Qwen or Llama models fine-tuned on R1’s output. They are useful, but they are not the real 671B R1.
- Qwen (pronounced roughly “chwen”; made by Alibaba Cloud). Qwen3 spans 0.6B to 235B parameters, in dense and MoE versions, with a thinking on/off mode [5]. Qwen3-30B-A3B has 30B total and 3B active parameters, which makes it a good fit for laptops with lots of RAM.
- Others: Llama (Meta), Gemma (Google), Mistral, Phi (Microsoft), gpt-oss (OpenAI, open weights).
5. Quantization #
Weights are normally stored as 16-bit numbers. Quantization stores them with fewer bits (8, 5, 4 or even 3), shrinking the file and memory use with a small quality loss [6][7].
ELI5: It is JPEG for models. A photo saved at lower quality takes far less space, and unless you zoom in you hardly notice. Go too low and it becomes blocky.
| Format | Approx. bits per weight | 7B model size | Quality |
|---|---|---|---|
| FP16 / BF16 (16-bit floating point / brain float) | 16 | ~14 GB | Reference |
| Q8_0 | ~8.5 | ~7.4 GB | Nearly identical |
| Q6_K | ~6.6 | ~5.8 GB | Excellent |
| Q5_K_M | ~5.7 | ~5.0 GB | Very good |
| Q4_K_M | ~4.85 | ~4.2 GB | Good: the usual sweet spot |
| Q3_K_M | ~3.9 | ~3.4 GB | Noticeable loss |
| Q2_K | ~3.0 | ~2.6 GB | Poor; avoid for small models |
File formats: GGUF (used by llama.cpp, Ollama, LM Studio) [8]; safetensors (full-precision, safe format); GPTQ and AWQ (Activation-aware Weight Quantization; GPU-oriented) [6][7]; MLX (Apple’s framework). Rule of thumb: a bigger model at 4-bit usually beats a smaller model at 8-bit.
6. Hardware concepts #
- CPU (Central Processing Unit): runs anything, slowly for AI.
- RAM (Random Access Memory): your main system memory.
- GPU (Graphics Processing Unit): thousands of small cores, ideal for AI math. VRAM (Video RAM) is the GPU’s own fast memory.
- iGPU (integrated GPU): a GPU inside the CPU chip, such as Intel Arc graphics in recent Core Ultra laptops. It has no VRAM of its own and shares system RAM, so it is slower, but it can use a lot of memory.
- Unified memory: CPU and GPU share one big memory pool (Apple Silicon, AMD Strix Halo).
- NPU (Neural Processing Unit): a low-power chip for AI tasks. Software support for large language models is still more limited than for GPUs.
- TOPS (Tera Operations Per Second): trillions of simple math operations per second, usually 8-bit integers. It is a marketing number for NPUs; Microsoft’s Copilot+ PC label requires an NPU of 40+ TOPS [9]. TOPS (and FLOPS, Floating-point Operations Per Second) mainly affect prefill speed.
- Memory bandwidth (GB/s): how fast memory can be read. This usually decides generation speed, because every generated token requires reading the whole active model from memory.
ELI5 (TOPS): TOPS is how many math problems the chip can do per second, like a very fast calculator. Bandwidth is the width of the hallway that brings ingredients to the chef. A fast chef in a narrow hallway still waits.
Capacity decides what fits. Bandwidth decides how fast it runs.
- Software support: NVIDIA (CUDA, best support), AMD (ROCm/Vulkan), Intel (SYCL, OpenVINO, Vulkan), Apple (Metal) [8].
- Offloading: if the model does not fit in VRAM, some layers run from system RAM. It works but is much slower.
7. Rules of thumb #
Memory (GB) ≈ parameters (billions) × bits per weight / 8 (the weights)
+ KV cache (grows with context)
+ ~1 GB (runtime overhead)
KV cache = 2 × layers × KV heads × head dimension × bytes per value × tokens
Tokens/second ≈ memory bandwidth (GB/s) / active weights (GB) × ~0.6 efficiency
Example: an 8B model at Q4_K_M needs 8 × 4.85 / 8 ≈ 4.9 GB, plus about 1 GB of overhead and about 1 GB of KV cache at 8K context, so roughly 7 GB. For MoE models, memory follows total parameters, speed follows active parameters.
8. What runs on what (estimates) #
| Hardware | Usable memory | Comfortable models (4-bit) | Expected generation speed |
|---|---|---|---|
| Thin laptop, Intel Arc iGPU, 16 GB RAM | ~8 GB for the model | 1-4B (Qwen3-1.7B/4B); 7-8B is tight | ~3-12 t/s |
| Laptop, Intel Arc iGPU, 32 GB RAM | ~16 GB | Up to 14B dense; 30B-A3B MoE (~18 GB) is borderline | 14B: ~5-10 t/s; MoE: ~10-25 t/s |
| Desktop, RTX 3060 12 GB | 12 GB VRAM | 7-14B fully on GPU | ~30-60 t/s |
| Desktop, RTX 4060 Ti 16 GB | 16 GB VRAM | 14B at Q5/Q6; ~24B at Q4 | ~25-45 t/s |
| Desktop, RTX 3090/4090 24 GB | 24 GB VRAM | 32B at Q4 with moderate context; 30B-A3B | ~25-40 t/s (32B) |
| Desktop, RTX 5090 32 GB | 32 GB VRAM | 32B at Q5/Q6; long context | ~40-70 t/s |
| Apple Silicon / unified, 64-128 GB | 48-96 GB | 70B at Q4 (~42 GB); large MoE models | ~5-12 t/s (70B) |
| Server, 400+ GB | 400+ GB | Full DeepSeek-R1 671B at 4-bit (~400 GB) | Server territory |
On Intel Arc laptops, use llama.cpp (Vulkan or SYCL backend), Ollama builds with Intel support, or Intel’s OpenVINO tools [8]. Windows usually lets the iGPU use about half of system RAM.
9. Calculator #
Open the HTML version of this guide for the interactive calculator. It uses the formulas in section 7. Quick reference (8K context):
| Model | Q4_K_M | Q8_0 | FP16 |
|---|---|---|---|
| 7-8B | ~7 GB | ~11 GB | ~18 GB |
| 14B | ~11 GB | ~17 GB | ~30 GB |
| 32B | ~22 GB | ~37 GB | ~67 GB |
| 70B | ~46 GB | ~78 GB | ~144 GB |
Generation time estimator #
The HTML version also has a second calculator. Choose a model and settings for text, code, image and video, and it shows the estimated time on every device at once: an 11th-gen Core i5 laptop, a Core Ultra Series 3 “Panther Lake” laptop with Arc B390 graphics, and desktops with an NVIDIA RTX 3060, 4060 Ti, 5070 Ti, 3090, 4090 or 5090. Method:
- Text and code: time = prompt processing + output tokens ÷ tokens per second (section 7 formula). One word is about 1.33 tokens; one line of code is about 12 tokens. “Thinking mode” adds hidden reasoning tokens.
- Image and video: time is scaled from reference timings on an RTX 4090 by each device’s relative compute, times steps and resolution. If the model does not fit in GPU memory, it is flagged as “needs RAM offload” (about 4x slower) or “does not fit”.
- Device assumptions: Arc B390 has 12 Xe3 cores, an advertised ~122 INT8 TOPS for the GPU and LPDDR5X-9600 memory (about 120 GB/s measured) [12]. The 11th-gen Core i5 uses Iris Xe graphics with roughly 51 GB/s DDR4-3200 memory; older Intel iGPUs are much slower and often need smaller models.
Reference timings on an RTX 4090 (24 GB), used as the anchor:
| Model | Setting | Approx. time |
|---|---|---|
| SD 1.5 | 512x512, 25 steps | ~1 s |
| SDXL | 1024x1024, 30 steps | ~3 s |
| FLUX.1 schnell / dev | 1024x1024, 4 / 28 steps | ~3 s / ~20 s |
| LTX-Video 2B | 5 s clip, 768x512 | ~20 s [13] |
| Wan 2.1 1.3B | 5 s clip, 480p | ~4 min [14] |
| Wan 2.2 5B | 5 s clip, 720p | ~9 min [15] |
| Wan 2.1 14B | 5 s clip, 480p | ~25 min (estimate) |
10. Getting started #
- Install Ollama or LM Studio [10].
- Start small:
ollama run qwen3:8bon most machines. - If it is too slow, drop to a smaller model or lower quantization. If there is memory to spare, go bigger first, then raise quality.
- For serving many users on server GPUs, look at vLLM [11].
11. Common pitfalls #
- Mistaking distills for the real thing. “DeepSeek-R1 7B” is a small Qwen model taught by R1, not R1 itself. Expect much weaker results than the 671B model.
- “It fits in RAM, so it will be fast.” Fitting only decides whether it runs. Speed depends on memory bandwidth, and spilling from VRAM into system RAM can cut speed several times over.
- Forgetting the KV cache. A model that fits with a 2K context may not fit at 32K. Lower the context or quantize the cache.
- Quantizing too far (or not at all). Q2/Q3 on small models hurts quality badly; FP16 on a laptop wastes memory. Start at Q4_K_M or Q5_K_M.
- Comparing sizes across designs. A 30B-A3B MoE needs memory for 30B but runs about as fast as a 3B. A dense 32B is much slower.
- Trusting TOPS numbers. NPU or GPU TOPS are peak figures for a specific number format. Real speed depends on memory bandwidth, drivers and whether your tool supports that chip (CUDA, Vulkan, SYCL, OpenVINO, Metal).
- Wrong backend or settings. An integrated GPU can sit idle while the CPU does the work. Check that GPU offload is on and watch utilization.
- Reasoning models feel slow. They generate thousands of hidden “thinking” tokens before the answer. Turn thinking off for simple tasks.
- Using a base model as a chatbot, or the wrong chat template. Use Instruct versions, and let your tool apply the correct template.
- Thermals and power mode. Laptops throttle on battery, in quiet mode and under sustained load; long video generation can run for hours.
- Treating answers as facts. Local models hallucinate, small ones more. Verify anything important.
- Unsafe downloads and licenses. Prefer safetensors or GGUF files from the original publisher; older pickle-based files (.bin, .pt) can run code. Check the license before commercial use.
- Benchmark worship. Leaderboard scores rarely match your task. Test two or three models on your own prompts.
ELI5: Buying a bigger kitchen (more RAM) does not make the chef faster. The width of the hallway (bandwidth) and which stove you actually switch on (the right backend) matter just as much.
Citations #
Figures for bits per weight and hardware speeds are approximations (community values from llama.cpp; speeds estimated from bandwidth ÷ model size, not measured).
- Vaswani et al., “Attention Is All You Need” (2017). https://arxiv.org/abs/1706.03762
- Open Source Initiative, “The Open Source AI Definition.” https://opensource.org/ai/open-source-ai-definition
- DeepSeek-AI, “DeepSeek-V3 Technical Report” (2024). https://arxiv.org/abs/2412.19437
- DeepSeek-AI, “DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning” (2025). https://arxiv.org/abs/2501.12948
- Yang et al., “Qwen3 Technical Report” (2025). https://arxiv.org/abs/2505.09388
- Frantar et al., “GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers” (2022). https://arxiv.org/abs/2210.17323
- Lin et al., “AWQ: Activation-aware Weight Quantization” (2023). https://arxiv.org/abs/2306.00978; and Jiang et al., “Mixtral of Experts” (2024) for Mixture of Experts, https://arxiv.org/abs/2401.04088
- llama.cpp project and GGUF format. https://github.com/ggml-org/llama.cpp
- Microsoft, Copilot+ PCs. https://www.microsoft.com/en-us/windows/copilot-plus-pcs
- Ollama https://ollama.com; LM Studio https://lmstudio.ai
- Kwon et al., “Efficient Memory Management for LLM Serving with PagedAttention” (vLLM, 2023). https://arxiv.org/abs/2309.06180
- Intel Core Ultra Series 3 (Panther Lake) specifications and review measurements: Wikipedia, “Panther Lake (microprocessor)” https://en.wikipedia.org/wiki/Panther_Lake_(microprocessor); Club386 review of Core Ultra Series 3 (GPU 122 TOPS INT8, AIDA read ~118.8 GB/s) https://www.club386.com/?p=131124; Liliputing, “Intel launches Core Ultra Series 3 Panther Lake mobile chips” https://liliputing.com/intel-launches-core-ultra-series-3-panther-lake-mobile-chips/
- Lightricks, LTX-Video repository (real-time-class video generation claims). https://github.com/Lightricks/LTX-Video
- Wan-Video, Wan2.1 repository (1.3B model, ~8 GB VRAM, ~4 min for 5 s 480p on an RTX 4090). https://github.com/Wan-Video/Wan2.1
- Wan-Video, Wan2.2 repository (TI2V-5B, 5 s 720p in under 9 min on an RTX 4090). https://github.com/Wan-Video/Wan2.2
- Image-generation reference timings (SD 1.5, SDXL, FLUX) are approximate community benchmark figures for an RTX 4090, not measurements made for this guide. Table figures marked “estimate” are the author’s extrapolations.