hardware · Level 2
Running open-weight AI models on your own computer, for free
A hands-on guide to Ollama, LM Studio and llama.cpp: what your RAM or VRAM can realistically run, how quantisation trades size for quality, and where to find real models on Hugging Face.

Your next step
Start this course online
Register your start, then work through the lessons and exercises at your own pace. You can download the PDF separately. Where a scored exam is available, you will find it after the lessons.
Register or resume your course
Start with the essentials
The short answer
You can run real open-weight AI models on an ordinary laptop for no ongoing cost, using free tools such as Ollama, LM Studio or llama.cpp. What you can run depends mostly on memory: a model's weights need roughly its parameter count times the bytes each parameter is stored in, and quantisation lowers that at some cost to quality. Start small, quantised and local, then grow from there.
What you will learn
- You will be able to explain what 'open-weight' and 'free' actually mean in this context, and how they differ from a hosted AI subscription.
- You will be able to install and use at least one of Ollama, LM Studio or llama.cpp to run a model locally.
- You will be able to estimate, roughly, whether a given model will fit your machine's memory, and know why a mixture-of-experts model's memory need does not match its speed.
- You will be able to search Hugging Face for an open-weight model, read enough of its model card to judge its licence and size, and choose a sensible quantisation.
- You will have run at least one model end to end on your own machine, and know the first three things to check when it is slow or will not load.
Who it is for
Anyone comfortable installing ordinary desktop software who wants to run an AI model on their own computer, for privacy, for offline use, to avoid a subscription, or simply to learn. No programming is required for the main path; a short section for the technically curious uses the command line.
Before you start
- None beyond comfort installing and running desktop applications. Which AI model should I use? is helpful background on open-weight models, and GPU memory maths and Inference engines explained are natural next steps once you want the exact formulas.
Learn in your browser · Chapter 01 of 05
Why run a model on your own computer
Before you install anything, it helps to know what you are choosing, and what 'free' does and does not mean here.
A hosted AI assistant such as a chatbot in your browser sends your text to someone else's server and charges you, directly or through a plan, for the privilege. An open-weight model is different: its parameters are published for anyone to download, so you can run it on hardware you already control. Free tools such as Ollama, LM Studio and llama.cpp load those weights and let you talk to the model without sending anything over the internet, once the model is downloaded.
Scroll sideways to see every column.
| Question | Running it yourself | A hosted AI assistant |
|---|---|---|
| Does your text leave your machine? | Not once the model is downloaded, unless you choose to expose it. | Yes, to the provider's servers. |
| What does it cost, day to day? | No subscription or per-message fee. You pay in hardware, electricity and your own time. | Usually a subscription or a pay-per-use price. |
| Which models can you use? | Whatever open-weight model fits your hardware. | Whatever the provider currently offers. |
| How capable is it? | Generally smaller and less capable than the largest hosted models, though the gap keeps narrowing. | Often the largest, most capable models available. |
| Does it work offline? | Yes, once downloaded. | No, it needs a connection. |
| Who maintains it? | You do: updates, security, disk space. | The provider does. |
One more distinction matters before you start. Open-weight means the parameters are downloadable under some licence. Open source, in the stricter sense used by the Open Source Initiative's Open Source AI Definition, also asks for the training code, real information about the training data, and freedom to use the model for any purpose. Most of the well-known 'open' models you will meet in this workbook are open-weight, not fully open source by that definition. It rarely changes whether you can try a model on your own machine for personal use, but it matters if you plan to redistribute weights or use them commercially, which Open model licences, datasets and deployment obligations covers properly.
Try it yourself · Activity 01
5 minName your reason
Before installing anything, write down why you are doing this.
- Pick one reason: privacy, avoiding a subscription, working offline, or simply learning how it works.
- Name one real task you would actually use a local model for this week, such as drafting an email or summarising a document you already have.
- Note your machine's approximate RAM (Settings > About, or System Information), so chapter 2 has a real number to work with.
Does your reason change what 'good enough' looks like? Someone avoiding a subscription can accept a smaller model than someone with a strict privacy requirement who has no other option.
Learn in your browser · Chapter 02 of 05
The three tools you will meet: Ollama, LM Studio and llama.cpp
Most local-model tools are a friendly front end over a much smaller number of inference engines. Get to know the engine and the front ends make more sense.
llama.cpp is a free, open-source engine, written in C/C++ and MIT licensed, that runs language models on ordinary hardware, including CPU-only machines and mixed CPU-and-GPU setups. It popularised the GGUF file format, a single file holding a model's weights plus the metadata needed to run it. A large part of the local-model ecosystem, including both tools below, builds on llama.cpp or a close relative of it. Each fact in this chapter was checked against the named tool's own documentation in September 2026; tools change quickly, so check the current page before you rely on a detail.
Scroll sideways to see every column.
| Tool | What it is | Interface | A natural first step |
|---|---|---|---|
| Ollama | A free command-line tool, with a desktop chat app on Mac and Windows, that downloads and runs open-weight models and exposes a local API. | Command line, plus a native chat window on Mac and Windows. | Install it and run one command to chat with a small model. |
| LM Studio | A free desktop application that is a graphical front end over llama.cpp, and on Apple Silicon Macs, Apple's MLX, with a built-in model browser tied to Hugging Face. | Graphical app, with an optional command-line tool called lms. | Browse and download a model entirely with the mouse. |
| llama.cpp | The engine itself. You build it or download a release, then run it directly against a GGUF file. | Command line, with an included local HTTP server. | For anyone who wants the most control, the least software between them and the model, or an unusual setup. |
Ollama. Install it from ollama.com, a one-line installer script for Mac and Linux, and a normal installer for Windows, then run a model by name. It downloads the weights the first time and reuses them afterwards.
# Install (macOS or Linux)
curl -fsSL https://ollama.com/install.sh | sh
# Pull and run a small model, then chat in the terminal
# (model names change: check ollama.com/library for the current list)
ollama run llama3.2
# See what you have downloaded
ollama list
# Remove a model you no longer want
ollama rm llama3.2You can also point Ollama at a GGUF file you downloaded yourself, using a small text file called a Modelfile.
# Modelfile
FROM ./my-model.ggufSave that next to the .gguf file as Modelfile, then run ollama create my-model -f Modelfile, followed by ollama run my-model.
LM Studio. Download the installer for Mac, Windows or Linux from lmstudio.ai. Inside the app, press Ctrl+2 (Cmd+2 on Mac) to jump to the Discover tab and search Hugging Face's model catalogue by name, pick a file, and download it with a click; LM Studio highlights the quantisation levels your hardware can realistically run. Load the model, then chat in the built-in window. LM Studio also ships a command-line tool called lms, and a local server compatible with the request format several hosted chat APIs use.
# Search Hugging Face from the terminal instead of the app
lms get qwen
# Download a specific model and quantisation from a Hugging Face URL
lms get https://huggingface.co/<org>/<model>-GGUF@Q4_K_Mllama.cpp directly. This route suits people who want to script things, run on unusual hardware, or avoid an extra layer of software. Download a prebuilt release or build it from source, then run its included server against a GGUF file. Exact binary names and flags change between releases, so read the current README rather than trusting an old example, including this one.
# Illustrative only: check the current README for the exact binary name and flags
./server -m my-model.gguf --port 8080Try it yourself · Activity 02
15 minGet one reply
Install one tool and have it answer a real question.
- Install Ollama or LM Studio.
- Download the smallest model the tool suggests or offers by default, often in the 1 to 3 billion parameter range.
- Ask it one real question from the task you named in chapter 0.
- Note, honestly, how long the first reply took to start, and whether the answer was useful.
Was the wait for the first reply closer to instant, a few seconds, or noticeably slow? That single impression tells you more about whether this setup will suit daily use than any spec sheet.
Learn in your browser · Chapter 03 of 05
Will it fit? Size, RAM, VRAM and quantisation without the full maths
You do not need the exact formulas to get started. You need one honest rule of thumb, and to know what quantisation is actually trading away.
A model's file size, and roughly the memory it needs to run, comes from two numbers: how many parameters it has, and how many bytes each one is stored in, its precision. The rule is simple: size in bytes is roughly parameters times bytes per parameter. Real quantised files are usually a little larger than this simple sum, because each block of weights also stores a small scaling value, so always trust the file size shown on the download page over your own arithmetic.
Scroll sideways to see every column.
| Precision | Bytes per parameter | A 7-billion-parameter model, roughly |
|---|---|---|
| 16-bit, often the model's original training precision | 2 | 14 GB |
| 8-bit | 1 | 7 GB |
| 4-bit, a common starting point | 0.5, a little more in practice | about 3.5 to 4 GB |
Quantisation is the act of storing a model at lower precision than it was trained in, to shrink the file and the memory it needs. In the GGUF world you will see names such as Q8_0, Q6_K, Q5_K_M, Q4_K_M, Q3_K and Q2_K, plus a newer 'IQ' family, such as IQ4_XS or IQ3_S, for very low bit-widths. The number is roughly the bits used per weight; the letters describe the method, and K-quants generally mix precisions across a model's different parts, spending more bits where it costs more to be wrong. As a starting point, Q4_K_M or Q5_K_M is a common, reasonable default: noticeably smaller than the original, with a quality loss most people cannot easily spot in ordinary use. Go lower only when you are genuinely short of memory, and expect the loss to become more noticeable as you do.
Memory also comes in different places, and they are not interchangeable. VRAM is the memory on a dedicated graphics card: fast, and usually the smallest pool in the system, from a few gigabytes on older laptops to 24 GB or more on high-end cards. System RAM is larger and shared with everything else your computer is doing; running a model from RAM alone, on the CPU, works but is generally slower than running it on a GPU. Unified memory, used by Apple Silicon Macs, is shared between the CPU and GPU in one pool, so a Mac with a large amount of unified memory, and current configurations start at 16 GB and run up to 512 GB on the highest Mac Studio option, can often run larger models than a laptop with a similarly sized but separate VRAM pool, because the GPU can reach the whole pool.
Scroll sideways to see every column.
| RAM, or VRAM / unified memory | Roughly comfortable, at 4-bit | Possible, but tight |
|---|---|---|
| 8 GB | Small models, up to about 3 billion parameters | A 7 to 8 billion parameter model, with a short context and little else running |
| 16 GB | 7 to 8 billion parameter models | 13 to 14 billion parameter models, or a mixture-of-experts model of similar total size |
| 32 GB | 13 to 14 billion parameter models comfortably | Around 30 billion parameters, dense or mixture-of-experts |
| 64 GB or more | 30 billion parameters and above | Larger still, depending how much you need for other work at the same time |
Treat that table as a rough starting point, not a promise: it assumes 4-bit weights, a modest context length, and leaves headroom for your operating system and everything else you have open. For the exact method, including the key-value cache that context length adds on top of the weights, see GPU memory maths for LLMs and SLMs.
Try it yourself · Activity 03
8 minSize your own machine
Turn the table into a real starting point.
- Find your machine's total RAM, and its GPU's VRAM if it has a dedicated one.
- Use the table to pick a parameter-count range you can run comfortably.
- Pick a quantisation: 4-bit to start, unless you already know you have room to spare.
If your honest answer is 'comfortable' only for a very small model, is that still useful for the task you named in chapter 0? Often it is: small models are perfectly capable of drafting, summarising and formatting.
Learn in your browser · Chapter 04 of 05
Finding a real model on Hugging Face
Hugging Face is the model hosting site both Ollama and LM Studio point to, directly or indirectly, and the most direct way to see what is actually available today.
Hugging Face hosts models from individual developers, universities and the companies that train frontier-scale models, searchable and filterable by task, format and licence. You do not need an account to browse or download public models, though creating a free one makes downloading and returning to models easier.
- Go to huggingface.co/models.
- Filter by task; for a chat model choose 'Text Generation'.
- Filter by library or format: choose GGUF for llama.cpp, Ollama and LM Studio.
- Sort by 'Trending' or by downloads, to see what people are actually using right now, not just what is newest.
- Open a model's page and read its model card before downloading anything.
A model card is the closest thing to a label on the tin. Before you download, check: the licence, a name such as Apache-2.0 or MIT, or a custom licence you should actually read; the base model, if it is a fine-tune of something else; whether GGUF files are available, often in a separate repository named with '-GGUF' at the end, sometimes uploaded by the community rather than the original publisher; and any stated intended use or limitations. Prefer safetensors or GGUF files over an older pickle-based format: Hugging Face's own documentation warns that pickle files can execute code when loaded, which is a real security risk for a file you downloaded from a stranger.
Scroll sideways to see every column.
| Family | Publisher | Roughly | Notes |
|---|---|---|---|
| Llama | Meta | From a few billion to hundreds of billions of parameters, across several generations | One of the most widely supported families; licence terms have varied by version, so check the current one. |
| Gemma | Google DeepMind | From about 1 billion to the high tens of billions | Comes with its own usage terms; the small sizes are aimed squarely at ordinary hardware. |
| Qwen | Alibaba Cloud | Dense models from 0.6 to 32 billion parameters, plus mixture-of-experts versions up to 235 billion total, 22 billion active | Widely used on personal hardware; the smaller dense sizes are released under Apache-2.0. |
| Mistral, Mixtral and Ministral | Mistral AI | From a few billion parameters up through mixture-of-experts models | Several sizes are aimed specifically at running on a single consumer machine. |
| Phi | Microsoft | A few billion parameters | Marketed on strong results for its size rather than raw scale. |
| DeepSeek | DeepSeek | From a few billion, distilled versions, up to hundreds of billions, mixture-of-experts | The distilled small versions are the practical choice for personal hardware. |
| gpt-oss | OpenAI | 20 billion and 120 billion parameters, both mixture-of-experts | Released under Apache-2.0 in August 2025, OpenAI's first open-weight release since GPT-2; the 20-billion version is built to run on consumer hardware. |
Try it yourself · Activity 04
12 minFind and check one model
Use the filters to find a real candidate for the task you named in chapter 0.
- On huggingface.co/models, filter to Text Generation and GGUF, and search for a small model in the 1 to 4 billion parameter range.
- Open its model card and note its licence.
- Find the file list and note the file size at Q4_K_M, or the nearest quantisation offered.
Was the licence easy to find and understand? If not, that is itself useful information about the model.
Learn in your browser · Chapter 05 of 05
Running your first model, safely, and what comes next
Time to put it together: download, load, prompt, and know what to check when something goes wrong.
- Pick a tool, Ollama or LM Studio, and a model and quantisation, using chapters 1 to 3.
- Download it. This can take a while on a slow connection; a 4-bit 7 to 8 billion parameter model is typically a few gigabytes.
- Load it, and send a first prompt drawn from your real task.
- Watch two things: how long before the first word appears, and roughly how fast the words then stream.
- If it is too slow or will not load, use the table below before giving up on the model entirely.
Scroll sideways to see every column.
| Symptom | Likely cause | What to try |
|---|---|---|
| Model will not load, or the app crashes | Not enough memory for this size and quantisation | Choose a smaller model or a lower quantisation, and close other memory-heavy applications |
| Loads, but generation is very slow | Running on the CPU when a GPU was available, or a model too large for VRAM so it is partly offloaded | Check the tool's settings for GPU acceleration, and confirm it is actually enabled |
| Replies are garbled or ignore the system prompt | Wrong chat template or prompt format for this model | Use the tool's default chat mode for that model rather than a raw completion mode |
| Disk filling up | Downloaded models accumulate; a single model can be several gigabytes | Remove models you are not using: ollama rm, or delete the file in LM Studio's model manager |
What local models are honestly good at, on ordinary hardware: drafting and editing text, summarising something you already have in front of you, answering questions about your own documents, simple coding help, and anything where working offline or keeping data off someone else's server matters more than having the single most capable model available. What they are honestly weaker at, compared with the largest hosted assistants: very long or complex reasoning chains, broad general knowledge at the edges of what a much larger model was trained on, and tasks needing tools or web access the model itself does not have. Neither of those is a flaw in the tools; it follows directly from running something small enough to fit on your machine.
Try it yourself · Activity 05
15 minCompare two quantisations
Feel the trade-off from chapter 2 directly, rather than taking it on trust.
- Download the same model at two quantisation levels, for example Q4_K_M and Q6_K or Q8_0.
- Ask both the same three real questions.
- Note, in your own words, whether you can tell the difference in the answers, and whether you can tell the difference in speed.
If you could not tell the answers apart, the smaller file is probably the better everyday choice. If you could, you now know, for your own tasks, what the trade genuinely costs.
You now have a working local setup: a tool, a model that fits your machine, and a sense of what to check when it misbehaves. From here, GPU memory maths for LLMs and SLMs gives you the exact formulas behind chapter 2, Inference engines explained goes deeper on speed, batching and serving a model safely to more than one user, and Open model licences, datasets and deployment obligations covers what you are actually allowed to do with a model beyond trying it yourself.
Keep learning
The complete workbook
This workbook is a practical getting-started guide, not a marketing pitch. You will install and compare Ollama, LM Studio and llama.cpp, learn a rough but honest way to judge whether a model will fit your machine's RAM or VRAM, understand what quantisation actually trades away, and use Hugging Face to find and check a real open-weight model. It ends with a full first run, a short troubleshooting table, and an honest account of what local models are, and are not, good for.
- 01Why run a model on your own computerRead here · 1 exercise
Before you install anything, it helps to know what you are choosing, and what 'free' does and does not mean here.
- 02The three tools you will meet: Ollama, LM Studio and llama.cppRead here · 1 exercise
Most local-model tools are a friendly front end over a much smaller number of inference engines. Get to know the engine and the front ends make more sense.
- 03Will it fit? Size, RAM, VRAM and quantisation without the full mathsRead here · 1 exercise
You do not need the exact formulas to get started. You need one honest rule of thumb, and to know what quantisation is actually trading away.
- 04Finding a real model on Hugging FaceRead here · 1 exercise
Hugging Face is the model hosting site both Ollama and LM Studio point to, directly or indirectly, and the most direct way to see what is actually available today.
- 05Running your first model, safely, and what comes nextRead here · 1 exercise
Time to put it together: download, load, prompt, and know what to check when something goes wrong.
Also inside: a 9-point checklist, a glossary of 12 terms and 10 questions and answers to test yourself. 5 hands-on exercises, each with a worked answer at the back where the workbook gives one.
The PDF is free. We ask for your name and email before downloading. Read the privacy notice at the download form. Free to download and use for personal learning, study groups and inside your own team. Please do not resell the workbooks or republish them as your own. Link people to trust-agent.ai instead.
Get your free PDF workbook
Enter your name and email, then download the complete workbook. This form also works without JavaScript.
Test yourself
Questions and answers
Is running a model locally actually free?
There is no subscription or per-message charge, so day to day it costs nothing extra beyond electricity. You do spend hardware, disk space and setup time, and if you need to buy a machine to do it, that is a real cost. For a laptop you already own, the marginal cost of trying it is small.
What is the difference between open-weight and open source?
Open-weight means the trained parameters are published for download under some licence. Open source, in the Open Source Initiative's stricter definition, also requires the training code and real information about the training data, plus freedom to use the model for any purpose. Most well-known 'open' models are open-weight, not fully open source by that definition.
Do I need Ollama, LM Studio or llama.cpp, or all three?
Just one to get started. LM Studio suits people who prefer a graphical browser and downloader. Ollama suits people comfortable with a short list of terminal commands, or who want its local API. llama.cpp directly suits people who want the most control or an unusual setup. All three can use the same GGUF files, so trying a second one later mostly changes the interface, not the underlying model.
How do I know if a model will fit my computer?
As a rough rule, a model's weights need about its parameter count times the bytes each parameter is stored in: roughly 2 bytes at 16-bit, 1 at 8-bit, and half a byte at 4-bit, plus a little more in practice. Compare that against your RAM, or your GPU's VRAM, leaving headroom for your operating system and the context you plan to use. GPU memory maths for LLMs and SLMs gives the exact method.
What does quantisation actually cost me?
Some quality, unevenly across tasks, in exchange for a smaller file and often more speed. Q4_K_M or Q5_K_M is a reasonable starting point for most people. There is no single published number for how much quality you lose at any given level; the only reliable test is comparing outputs on your own real prompts.
Why can a 30-billion-parameter model run at a reasonable speed on a laptop?
If it is a mixture-of-experts model, such as one labelled '30B-A3B', only a fraction of its parameters, here about 3 billion, actually run for each word generated, even though all 30 billion must be held in memory. Memory need follows the total; speed follows the active count.
Where should I actually look for open-weight models?
Hugging Face, filtered by task, Text Generation for a chat model, and by format, GGUF for llama.cpp, Ollama or LM Studio. Read the model card for its licence, base model and any stated limitations before downloading, and prefer safetensors or GGUF files over older pickle-based formats.
Are these models safe to use commercially?
It depends entirely on the individual licence, which you should read on the model's own page. Open weights are not automatically open source, and some licences restrict commercial use, redistribution, or certain applications. Open model licences, datasets and deployment obligations covers this properly; this workbook only gets you to a working local setup.
Should I expose my local model to my home network so other devices can use it?
Only with authentication in front of it. By default, Ollama and LM Studio's local servers listen only on your own machine, which is the safe default. Opening it up to your network without adding authentication is a real, not theoretical, risk if anyone else can reach that address.
What can a local model not do as well as a large hosted assistant?
Generally, very long or complex reasoning chains, and broad general knowledge at the edges of what a smaller model was trained on. This follows directly from running something small enough to fit on your machine, not a flaw in the tools themselves. For many everyday tasks, drafting, summarising, and answering questions about your own documents, a well-chosen small local model is genuinely good enough.
Write as you go
My notes
Use this scratchpad for your own notes, working or answers as you read. Notes are saved in this browser on this device. Downloading makes a local copy; it does not send your notes to Mickai.
Consolidate your learning
Review your work
Work through the exercises and questions, then compare your reasoning with the worked answers. A scored exam and verifiable certificate are not yet available for this course.
Review the questionsLearn the language
Key terms
- Open-weight model
- A model whose trained parameters are published for anyone to download and run, under some licence. It does not necessarily mean the training code or data is published too.
- Quantisation
- Storing a model's weights with fewer bits than it was trained in, to shrink the file and its memory need, at some cost to quality.
- GGUF
- A single-file format for a model's weights and metadata, used by llama.cpp and the tools built on it, including many quantised versions of popular models.
- Parameter
- One learned number inside a model. The parameter count, multiplied by the bytes each one is stored in, gives roughly the size of the weights.
- VRAM
- The dedicated memory on a graphics card. Fast, and usually the smallest, most limiting memory pool for running a model on a GPU.
- Unified memory
- A single memory pool shared between the CPU and GPU, used by Apple Silicon Macs, which lets the GPU reach a larger amount of memory than a typical separate VRAM pool.
6 of the workbook's 12 terms. The complete glossary is in the workbook.
Follow the evidence
Sources and checks
Facts last checked: .
These workbooks use AI assistance. See how the workbooks are made.
- Ollama (README)Ollama, GitHub
- Ollama FAQ: network exposure and concurrent requestsOllama, GitHub
- LM Studio documentationLM Studio
- GGUF usage with LM StudioHugging Face Hub documentation
- llama.cpp: LLM inference in C/C++ (README)ggml-org, GitHub
- llama.cpp quantize tool documentationggml-org, GitHub
- GGUF file format specificationggml-org, GitHub
- Hugging Face Hub documentation: model cardsHugging Face Hub documentation
- Hugging Face Hub documentation: pickle securityHugging Face Hub documentation
- Qwen3 (README)Qwen team, Alibaba Cloud, GitHub
- Introducing gpt-ossOpenAI
- The Open Source AI Definition 1.0Open Source Initiative
Created by Mickarle Wagstaff-Irons - Micky Irons with the Mickai team. Published by Mickai LTD. Last updated 29 September 2026.
NextKeep going
Where to go next
Recommended for you
GPU memory maths for LLMs and SLMs
A repeatable method for checking whether a language model fits your GPU: weights, KV cache, training memory and adapters, plus a small calculator you can run.
Recommended for you
Inference engines explained
How inference engines run a model: memory maths, quantisation, prefill and decode, batching, hardware, and serving a model safely over a local API.
Recommended for you
Open model licences, datasets and deployment obligations
Decide whether you may use, host and redistribute an 'open' model or dataset: licence families, dataset rights, model cards, AI-BOMs, hash checks and a checklist tool.