CHAPTER 04 OF 12
Get your first useful local response
Install a runtime, download a small model, generate and clean up.
In this chapter
Make one successful run reproducible
Your first goal is a small answer you can verify. Installation, downloading, loading and generation are separate stages. Keep their errors and timing separate so that a slow download is not reported as slow inference.
This walkthrough uses a separate port and model directory. That makes the lab easier to identify alongside an existing Ollama desktop service. The server listens on your computer's loopback address. After the required files are downloaded, inference can happen locally; this does not automatically prove that every component on your computer has stopped using the network.
Prerequisites
Use an Apple Silicon Mac, internet access for the installer and weights, Python 3.10 or later, and at least 2 GB of free space for this small exercise. Larger models need a new storage and memory plan. Check python3 --version; use a supported installer from python.org if Python is missing.
Download and install Ollama from its official macOS page. This edition executed inference with version 0.16.3; a newer installed version is a new test environment. Record what you actually have. The Linux instructions and Windows instructions are alternatives, not platforms verified by this Mac lab.
Steps
Open Terminal and check the runtime:
ollama --versionStart the lab server in that terminal:
mkdir -p "$HOME/rtm-lab-models"
OLLAMA_NO_CLOUD=1 \
OLLAMA_MODELS="$HOME/rtm-lab-models" \
OLLAMA_HOST=127.0.0.1:11435 ollama serveKeep that terminal open. In a second terminal, select the same port and download the starter package:
export OLLAMA_HOST=127.0.0.1:11435
ollama pull qwen2.5:0.5b
ollama show qwen2.5:0.5bExtract the companion archive and enter its folder. Run the identity and first-response labs:
python3 rtm_lab.py inventory --output identity.json
python3 rtm_lab.py extract --output first-response.jsonOpen
first-response.jsonin a text editor. Compare the prompt, expected answer and raw response. The note's deadline is Friday at 5 pm; Monday is the review day.Run the same command a second time with another output filename. Keep both records so loading and later requests can be compared.
Expected results
The server should report that it is listening on 127.0.0.1:11435. The pull should finish, and the identity report should name your installed runtime and digest. The extraction report should contain a nonempty response, runtime timing fields and a passed result from the exact rubric.
The reference extraction passed. That result proves one useful local response for that input and configuration. It does not establish broad quality. Chapter 5 deliberately uses a harder set of examples, including notes with no deadline.
Common failures
If the port is already in use, identify the existing process before stopping it, or choose another unused port and use it consistently. If the client cannot connect, check that the first terminal still runs the server. A proxy can interfere with loopback requests; the companion client explicitly bypasses ambient HTTP proxies for these requests.
If the model is missing, run the pull against the same port as the lab client. If a digest differs, preserve your result but do not call it the reference artifact. If the response is wrong, inspect the actual output before changing the scoring rule.
Cleanup
While the server is running, unload the model when finished:
OLLAMA_HOST=127.0.0.1:11435 ollama stop qwen2.5:0.5bTo remove the package from this lab server, use ollama rm qwen2.5:0.5b with the same OLLAMA_HOST. Then press Control-C in the server terminal. Keep the files installed if you plan to continue the next chapter. Do not delete unrelated runtime directories.
Exercise
Replace the note with a real, non-sensitive task you can grade. Keep the original expected answer and write a new expected answer before running the changed input. Explain whether any difference comes from installation, runtime behavior or answer quality.
Sources
Ollama quickstart, local-only configuration and the reference artifact support the setup. The measured output is in the book lab report.