Sub topic 1
Open-weight models and why run them locally
Prerequisites
This chapter assumes you can use a terminal and have a general idea of what a large language model (LLM) is. Later chapters also expect basic HTTP and JSON knowledge and some Python or another scripting language. This chapter needs none of those yet.
What "open-weight" means
A language model is a large set of numbers called weights. These numbers are learned during training. To use a model, software loads the weights and runs input text through them to predict the next piece of text.
An open-weight model is one whose weights you can download and run on your own hardware. The license says what you may do with them. Some licenses allow commercial use, and others limit it.
Open-weight is not the same as open source. Open source usually means you also get the training code and training data. With most open-weight models, you get only the finished weights and the license terms. Read the license before you build a product on a model.
A hosted model is the opposite case. You send text to a provider's server through an API and get a reply. You never hold the weights.
Why run a model locally
Running a model on your own machine is called local inference. People choose it for these reasons:
- Privacy. Prompts and documents stay on your machine. This matters for source code, client data, and internal notes.
- Cost. There is no per-token fee. You pay for hardware and electricity.
- Offline use. After the model is downloaded, it works without a network connection.
- Control. You pick the exact model version and settings. A provider cannot retire or change it under you.
- Learning. You can see how model size, memory, and settings affect speed and quality.
What you give up
Local inference has costs too.
| Concern | Hosted model | Local open-weight model |
|---|---|---|
| Quality ceiling | Largest frontier models | Smaller models that fit your memory |
| Speed | Provider's server hardware | Depends on your CPU, GPU, and RAM |
| Setup | An API key | Install software and download files |
| Data location | Sent to a third party | Stays on your machine |
| Ongoing cost | Pay per use | Hardware you already own |
The largest models need far more memory than a typical laptop has. Smaller models run well on ordinary hardware, but they are usually less capable on hard tasks. Choosing a model that fits your machine is a recurring theme in this tutorial.
The local workflow
Every chapter that follows builds on this flow. You download weights once, store them on disk, and load them into memory when you ask for a reply.
Ollama is the tool this tutorial uses to handle the download, storage, and loading steps. The next chapter explains how it is structured.
Check your understanding
Exercise
A team wants to summarize confidential contracts and cannot send them to a third party. Name one reason a local open-weight model fits, and one trade-off they should expect.
Show answer
The contracts stay on their own machines, so no third party receives them. The trade-off is that a model small enough to run on their hardware may be less capable than the largest hosted models, and speed depends on their hardware.
Exercise
Why is "open-weight" not the same as "open source"?
Show answer
Open-weight means the trained weights are downloadable. Open source usually also includes training code and data, which most open-weight releases do not provide. The license also still limits what you may do.