Sub topic 1
Open-Weight Models and Why Run Them Locally
Prerequisites
This chapter assumes you can use a terminal, understand basic HTTP and JSON, and know what a large language model (LLM) is. You should also understand that local inference uses your computer's memory and processor or GPU.
Open-Weight Models
An open-weight model publishes the numerical weights produced during training. Weights are the values the model uses to generate text. “Open-weight” does not always mean that the training data, source code, or license is unrestricted.
Running a model locally keeps prompts and responses on your computer. It can work without an internet connection after the model is downloaded, avoids per-request API charges, and gives you control over model versions. The trade-off is that you provide the storage, memory, and processing power. Local models can also be slower or less capable than hosted services.
What Ollama Does
Ollama packages three related pieces:
- A local server that loads models and exposes an HTTP API.
- A command-line interface (CLI) for downloading and running models.
- A local model store that keeps downloaded weights and configuration.
The CLI sends requests to the server. The server loads a selected model into memory and generates a response.
Install and Check the Server
Install Ollama using the instructions for your operating system at the Ollama website. On systems where the command is available, verify the installation and server endpoint:
ollama --version
ollama serve
curl http://localhost:11434/api/tagsollama serve starts the server. If Ollama already runs as a background service, it may report that the address is in use. The curl command should return JSON containing locally available models.
Run Your First Model
Download a model, then start an interactive chat:
ollama pull llama3.2
ollama run llama3.2pull downloads the model. run loads it and opens a prompt. Type a question, then enter /bye to leave the chat.
Read Model Names and Tags
Model names usually combine a family name with a tag, such as llama3.2:3b or qwen2.5:7b. The tag often identifies a parameter count, version, or variant. A parameter is a learned value in the model; more parameters can improve capability but require more memory. Always check the library entry because tag meanings differ between families.
Exercise
What does ollama pull llama3.2 do, and where does the model run after ollama run llama3.2?
Show answer
It downloads the model into Ollama's local store. The model then runs through the local Ollama server on your computer.