VOOZH about

URL: https://www.hardware-corner.net/running-llms-locally-introduction/

⇱ Running LLMs Locally Explained: An Introduction | Hardware Corner


Running LLMs Locally Explained: An Introduction

By Allan Witt | Updated: October 9, 2025

📃Part of Series:
How to Run LLMs Locally

Large Language Models (LLMs) have rapidly emerged as powerful tools capable of understanding and generating human-like text, translating languages, writing different kinds of creative content, and answering questions in an informative way. You’ve likely interacted with them through services like ChatGPT, Claude, or Gemini. While these cloud-based services offer convenience, there’s a growing interest in running these models directly on personal computers – a process known as running LLMs locally.

Running an LLM locally means your own computer system handles the entire process. This involves two main stages: First, loading the model, where the LLM (essentially a very large file containing billions of learned parameters – numerical values representing the model’s knowledge) needs to be loaded into your computer’s memory. Second, running inference, where once loaded, you provide the model with a prompt (input text), and your computer performs calculations using the loaded parameters to predict the next most likely words, generating output text one token at a time. A token is roughly equivalent to a word or part of a word.

This process requires significant computational resources. Your computer can utilize its Central Processing Unit (CPU), Graphics Processing Unit (GPU), or a combination (often called a split load) where parts of the model reside in both system RAM (for the CPU) and VRAM (Video RAM, for the GPU) to perform inference. Running locally offers benefits like data privacy (your prompts don’t leave your machine), customization, offline access, and potentially lower long-term costs compared to API subscriptions.

👁 ecosystem for running local llm

The Local LLM Ecosystem — from hardware and GPU inference to software and front-end tools.

Hardware Requirements: The Foundation for Local LLMs

Choosing the right hardware is crucial for a smooth local LLM experience. Three key hardware aspects directly impact performance:

  • Memory Size (VRAM and System RAM) determines how large a model you can load. LLMs require substantial memory – primarily fast GPU VRAM, but system RAM is also used, especially for larger models or CPU/split inference. Insufficient memory will prevent a model from loading or cause extremely slow performance due to swapping data with slower storage.
  • Memory Bandwidth dictates how fast the model can generate tokens (inference speed). Higher bandwidth (measured in GB/s) allows the processing units (GPU cores or CPU cores) to access the model’s parameters more quickly, leading to faster text generation, often measured in tokens per second (t/s). GPU VRAM typically offers much higher bandwidth than system RAM.
  • Compute Power influences how quickly the initial prompt is processed (prompt processing speed) and contributes to the overall token generation speed. For GPUs, this relates to the number and architecture of compute cores (like NVIDIA’s CUDA cores or Tensor cores). For CPUs, it depends on the number of cores, clock speed, and instruction sets supported.

Minimum System Requirements

While technically possible to run very small models on less, a practical minimum baseline for a usable experience includes a modern 4+ Core CPU (such as Intel Core i5-10th Gen or AMD Ryzen 5 3600), 16 GB of System RAM, 50 GB of free space on an NVMe SSD, and a GPU is recommended for significant speedup. For a better experience, consider 8+ CPU cores, 32-64 GB of RAM, and 100+ GB of free NVMe SSD space. An SSD, especially an NVMe model, is highly recommended over a traditional Hard Disk Drive for faster model loading times.

GPU Tiers for LLM Inference

A dedicated GPU dramatically accelerates LLM inference, with VRAM capacity being the primary factor determining which models you can run effectively.

  • Entry-Level (8GB – 12GB VRAM) GPUs like the NVIDIA GeForce RTX 3060 12GB, RTX 3080 Ti 12GB, RTX 4060 8GB, RTX 4060 Ti 8GB, or AMD Radeon RX 6700 XT 12GB are suitable for smaller models (e.g., Phi-2 3B, Qwen3 8B). These 12GB GPUs can also handle 14B models with 4-bit quantization, though at reduced speeds of 6-7 t/s. Expect moderate token generation speeds; for instance, a Qwen3 8B Q4_K_M model might run at 20-30 t/s on an RTX 3060 12GB.
  • Mid-Range (16GB VRAM) cards such as NVIDIA GeForce RTX 4060 Ti 16GB, RTX 4070 Ti SUPER 16GB, RTX 4080 16GB, or AMD Radeon RX 7800 XT 16GB can comfortably run popular medium-sized models (e.g., Qwen3 14B, Phi-4 14B) with less quantization, and can handle larger models (32B+) with quantization. A Qwen3 14B Q4_K_M might achieve 20-40 t/s on an RTX 4070 Ti SUPER.
  • High-End (24GB – 32GB VRAM) options like NVIDIA GeForce RTX 3090 24GB, RTX 4090 24GB, RTX 5090 32GB, or AMD Radeon RX 7900 XTX 24GB represent something of a border case. In a single GPU setup, they cannot run 70B models but can run 20B, 24B and 32B MoE models with extensive context and very good speeds. There’s also a popular meta approach using dual or triple setups for running large models (e.g., Llama 3.3 70B, GPT-OSS 120B) for higher quality output. A Llama 3.3 70B Q4_K_M could run at 20 t/s on a dual RTX 4090 configuration.
  • Prosumer/Workstation GPUs like the RTX A6000 48GB, RTX 6000 Ada Generation 48GB, and RTX Pro 6000 96GB can now run 70B models on a single setup. The RTX Pro 6000 96GB is an absolute behemoth that will run GPT-OSS 120B at full 128K context, making it the best LLM card you can install in a desktop machine without extensive modifications. However, it comes with a premium price tag.

Running Models on System RAM

While dedicated GPUs offer the fastest inference due to their high-bandwidth VRAM, it is also possible to run large language models directly from system RAM. This approach is much slower because DDR4/DDR5 memory has far lower bandwidth compared to GDDR6/GDDR6X or HBM memory on GPUs, which limits token generation speed and increases latency. However, system RAM is far more affordable and scalable than high-capacity GPUs. For example, a workstation or server with 256GB+ of RAM and multiple memory channels can host massive 671B+ parameter models that would otherwise require multi-GPU clusters. This makes CPU + RAM inference a viable solution for enthusiasts or researchers who prioritize access to very large models over raw speed. The tradeoff is clear: GPUs = speed, CPUs + RAM = affordability and scale.

Unified Memory Platforms (Apple & PC)

Unified Memory Architecture (UMA) allows the CPU and GPU to share a single pool of high-bandwidth memory, eliminating the need for separate VRAM. Apple Silicon Macs (M1, M2, M3 series) leverage UMA effectively: a Mac with 32GB or 64GB of unified memory can load models that would otherwise require expensive discrete GPUs with the same VRAM. This enables Macs to run models up to 30B or even 70B (quantized) without multi-GPU setups. The M3 Ultra with 128GB or even 512GB of unified memory provides a desktop-class solution for running very large models locally.

UMA is now also appearing on PC platforms. Systems like the AMD Ryzen AI Max+ 395 (Strix Halo) support up to 128GB of unified memory, bringing similar benefits to Windows and Linux environments. While UMA systems typically have lower raw compute performance and memory bandwidth compared to high-end discrete GPUs (e.g., RTX 5090, RTX Pro 6000), they excel in affordability, scalability, and efficiency. Massive models that require 256GB+ of memory can be run on these platforms, making UMA a practical solution for very large LLMs even if token generation speed is slower than on top-tier GPUs.

Understanding Model Sizes

LLMs are often categorized by their number of parameters, measured in billions (B). This number roughly correlates with the model’s capability and its resource requirements.

  • Small Models (~0.5B – 4B parameters)
    Examples include Gemma 3 (270M, 1B, 4B), Qwen3 (0.6B, 1.7B, 4B), and Phi-4 Mini (4B). These offer basic text generation, simple instruction following, and coding assistance. They can run on systems with 8GB–12GB RAM/VRAM, including many laptops and older desktops, sometimes even CPU-only (though slowly).
  • Medium Models (~7B – 14B parameters)
    Models such as Qwen3 (8B, 14B), Meta Llama 3.1 (8B), Gemma 3n MoE (6B E2B, 8B E4B), and Phi-4 represent a major step up. They perform well at instruction following, summarization, reasoning, and more complex coding tasks. For local use, 12GB+ VRAM is typically needed, though quantized versions may fit in 8GB. 16GB VRAM or 32GB+ unified memory is recommended.
  • Large Models (20B – 36B parameters)
    Strong performers include Mistral Small, Gemma 3 (27B), Qwen3 (30B A3B, 32B), Qwen3-Coder and GLM-4/GLM-Z1 (32B). These usually need 24GB–32GB GPUs (single or dual setups) but can also run from system RAM with good inference speed. They offer high-quality instruction following, reasoning, and coding, making them very popular among enthusiasts.
  • Extra Large Models (70B – 120B parameters)
    Examples include Llama 3.3 70B, Mistral Large 123B, and GPT-OSS 120B. Running these requires multiple GPUs (3–5 high-memory cards) or large unified memory setups (94GB–128GB system RAM) like on Apple M3 Ultra, M4 Max, or AMD Strix Halo.
  • Massive Models (235B up to 1T)
    This range includes Qwen3 235B A22B, GLM 4.5 (355B), Qwen3-Coder 480B, DeepSeek (671B), and Kimi K2 (1T). These require server-grade GPUs (often in clusters) or systems with huge amounts of system RAM. They deliver extremely high quality, approaching state-of-the-art (SOTA) frontier models in reasoning, coding, and instruction.

Key Concepts Explained

Understanding these terms will help you configure and optimize your local LLM setup:

Quantization is a crucial technique for running large models on consumer hardware. It involves reducing the precision of the model’s parameters (numbers). Instead of using full 16-bit floating-point numbers (FP16), quantization might use 8-bit integers (INT8), 4-bit integers (INT4), or even fewer bits, often using clever methods to preserve accuracy (e.g., GGUF formats like Q4_K_M, Q5_K_M). The benefit is significantly reduced model file size and memory requirements, often leading to faster inference, especially on resource-constrained hardware. For example, a Mistral 7B model in FP16 format is about 14.4 GB, whereas a Q4_K_M quantized version is only about 4.1 GB. There’s usually a small trade-off in output quality or accuracy, though modern quantization methods minimize this effectively for many use cases. Aggressive quantization (e.g., 2-bit or 3-bit) can lead to noticeable degradation.

Tokens per Second (t/s) is the standard metric for LLM inference speed – how many tokens the model generates each second. Higher is better, leading to a more responsive, conversational experience. It’s heavily influenced by hardware (GPU VRAM bandwidth, compute power), model size, and the level of quantization. A speed of 10-15 t/s is usable, while 30+ t/s feels very fluid.

Context Window refers to the amount of text (measured in tokens) the model can consider when generating a response. It includes both your input prompt and the conversation history. A larger context window allows for longer conversations, processing larger documents, or maintaining coherence over extended interactions. Many modern models have context windows ranging from 4,096 to 32,768 tokens or even larger (e.g., Claude 3 models have 200k context windows, though running such large contexts locally is demanding). Running a model with its maximum context window consumes more memory.

Temperature & Sampling are parameters you can often adjust to control the randomness and creativity of the model’s output. Temperature is a value typically between 0 and 1 (or higher). Lower values (e.g., 0.2) make the output more deterministic and focused, picking the most likely next token. Higher values (e.g., 0.8) increase randomness, leading to more creative or diverse responses, but potentially less coherence. A value of 0 essentially makes the output deterministic. Sampling Methods (e.g., Top-k, Top-p) are other techniques to control which tokens are considered during generation, influencing the trade-off between predictability and creativity.

Popular Software for Running LLMs Locally

Several user-friendly tools and underlying engines facilitate running LLMs locally:

LM Studio is a popular GUI application (Windows, Mac, Linux) offering an easy way to download models (primarily in GGUF format) and run them with a simple chat interface. Good for beginners.

Ollama is a command-line tool and API (Mac, Linux, Windows) designed for simplicity. It streamlines downloading and running various open-source models with minimal setup. Excellent for developers integrating local LLMs.

llama.cpp is a foundational C/C++ implementation focused on efficient inference on consumer hardware (CPU and GPU via backends like Metal, CUDA, OpenCL). Many GUI tools use llama.cpp underneath. It’s highly optimized and supports various quantization formats (GGUF).

Text Generation WebUI (Oobabooga) is a feature-rich Gradio-based web interface providing extensive options for loading models (GGUF, GPTQ, AWQ), fine-tuning parameters, managing context, and using extensions. More complex but very powerful.

Optimization for Local LLM Use

Beyond choosing the right hardware, several advanced techniques can significantly boost performance, save VRAM, and improve your overall experience when running models locally. While getting a better GPU is always the most direct path to more speed—with VRAM determining model size, compute cores driving prompt processing, and memory bandwidth increasing token generation—these software-level optimizations are crucial for getting the most out of your setup.

  • FlashAttention: This is a highly efficient implementation of the attention mechanism, a core component of modern LLMs. Its primary benefit is a dramatic reduction in VRAM usage, especially when working with very long context windows. By optimizing memory access patterns, FlashAttention significantly accelerates both prompt processing and token generation. At this point, it is considered an essential optimization with no real downsides. For example, a large model like GPT-OSS handling a 131k context can see its VRAM requirement drop from 97GB to 67GB, while prompt processing speed skyrockets from ~600 t/s to over 2200 t/s, and token generation nearly doubles from ~48 t/s to ~83 t/s.
  • K V Cache Quantization: Similar in principle to model quantization, this technique reduces the precision of the Key-Value (KV) cache—a memory component that stores information about the context window. By quantizing the KV cache to 8-bit or 4-bit integers, you can save a substantial amount of VRAM and further increase prompt processing speed. This feature is available when using FlashAttention.
  • Speculative Decoding: This technique accelerates token generation speed without any loss in output quality. It works by using a smaller, faster “draft” model to predict a sequence of several tokens at once. The main, larger model then checks these predictions in a single pass. If the predictions are correct, they are accepted, effectively generating multiple tokens in the time it would normally take to generate one.
  • Attention Sinks: As one of the newest optimizations, Attention Sinks can provide a massive boost to prompt processing speed, particularly for models with very long context windows. By keeping the initial few tokens of a sequence uncompressed, the model can better maintain coherence over long contexts without needing to re-process as much information. However, this feature is still emerging and is not yet widely available across all models or inference engines. Currently, it is supported by select models like GPT-OSS and inference backends such as llama.cpp.
  • Multi-Token Prediction (MTP):This emerging optimization allows a language model to predict multiple future tokens in a single forward pass, instead of generating them one at a time. By fine-tuning the model to anticipate several upcoming tokens and verify them in parallel, MTP can dramatically increase throughput without increasing VRAM usage. Unlike traditional speculative decoding, which requires a secondary “draft” model, MTP uses the same model as both predictor and verifier, minimizing overhead. In practice, well-tuned implementations have demonstrated 2.5× faster chat performance and up to 5× speedups for structured or predictable tasks such as code generation – all while maintaining identical output quality. MTP requires support at both the model and inference engine levels. 

Troubleshooting Common Issues

If you experience slow performance (low t/s), ensure the model is running primarily on the GPU (check task manager/activity monitor), try a more aggressive quantization level (e.g., move from Q5_K_M to Q4_K_M), close other resource-intensive applications, ensure GPU drivers are up to date, and check if the model layers are split between VRAM and RAM; full GPU offload is usually faster if VRAM allows.

When a model fails to load, it’s almost always due to insufficient VRAM or system RAM. Check the model’s size and quantization against your available memory. The model file might be corrupted; try re-downloading it. Also ensure the software tool supports the specific model format (e.g., GGUF, GPTQ).

For garbled or nonsense output, temperature might be set too high. Try lowering it (e.g., to 0.7 or lower). The model might not be suitable for the task or prompt style. It could indicate excessive quantization degrading performance; try a less quantized version. Ensure the correct prompt format is used if the model requires a specific one (e.g., for instruction-following models).

FAQ Section

How does local performance compare to ChatGPT? Cloud services like ChatGPT (especially GPT-5) often use massive, proprietary models running on powerful datacenter hardware. Local models, especially smaller ones, may not match GPT-5’s reasoning or knowledge breadth. However, medium-to-large local models (e.g., Qwen3, GLM 4.5, gpt-oss) can provide excellent results for many tasks. Speed (t/s) depends heavily on your hardware.

How much will it cost me to run? The primary cost is the upfront hardware investment (especially the GPU). Once you have the hardware, the cost is mainly electricity. Running a high-end GPU (like an RTX 4090, ~350-450W) continuously can add noticeably to your electricity bill, while running smaller models on more efficient hardware or power limit the G{U  is less costly. The models themselves are typically free (open-source).

Can I fine-tune these models locally? Yes, but fine-tuning (further training a pre-trained model on a specific dataset) is much more computationally intensive than inference. It typically requires significant VRAM (often more than inference for the same model size), high compute power, and technical expertise. Tools exist, but it’s an advanced topic beyond basic local inference.

What about Mac vs. Windows/Linux performance? Mac (Apple Silicon) offers excellent capacity for running large models relative to system cost due to Unified Memory. Software like llama.cpp is highly optimized for Apple’s Metal API, though raw speed might trail top-tier NVIDIA GPUs for compute-bound tasks. Windows/Linux with NVIDIA GPU offers the highest peak performance with high-end GPUs (RTX 4090, RTX PRO 6000), benefiting from mature CUDA ecosystem and tools, though VRAM limitations are the main bottleneck compared to high-memory Macs. Windows/Linux with AMD GPU support is improving (via ROCm and Vulkan), but often lags behind NVIDIA in terms of software compatibility, ease of setup, and peak performance for LLMs.

Resources for Going Deeper

Hugging Face is the central hub for discovering, downloading, and learning about LLMs (and other AI models): https://huggingface.co/unsloth/ and https://huggingface.co/bartowski

r/LocalLLaMA (Reddit) offers a large, active community discussing local LLM execution, hardware, software, and new model releases: https://www.reddit.com/r/LocalLLaMA/

Other valuable resources include the LM Studio website (https://lmstudio.ai/),the llama.cpp GitHub Repository (https://github.com/ggerganov/llama.cpp), and the Open WebUI GitHub Repository (https://github.com/open-webui/open-webui).

Read more: Run LLMs Locally