[ norboten ]
automation · lab ai-01

The Model Server Nobody Can Reach

· about 35 minutes · runs on ubuntu-26.04-automation · unrated

An unrated lab. It runs on your machine with no account and no network, and everything about it — the faults, the checks, the hints and the reference solution — is in the repository. An attempt on it is recorded on your profile and never moves a rating: only rated labs do. Rated and unrated labs.

The briefing

This box is the team's little model server: Ollama with the qwen2.5:0.5b model on disk, and nginx in front of it on port 8080 so colleagues do not have to talk to Ollama directly.

Nothing works. The internal chat page times out, http://127.0.0.1:8080/api/tags returns nothing useful, and after last week's tidy-up — when the models were moved to /srv/models — no one has seen a single generated token. People who tried longer prompts said the answer "just stops".

What is expected, and graded:

  1. The ollama service runs, as the ollama account, and starts at boot.
  2. That account can read the models in /srv/models, and nobody else can write there.
  3. http://127.0.0.1:8080/api/tags lists qwen2.5:0.5b through nginx.
  4. POST http://127.0.0.1:8080/api/generate returns a completion through nginx.
  5. The proxy is configured for streamed answers: no response buffering, and no short read timeout that cuts long generations off.

You have root through sudo. Everything must still hold after a reboot.

What is graded

The machine is checked, rebooted, and checked again. A check passes only if it passes both times.

CheckObjective
01_ollama_service_runsMake the deployment survive a reboot
02_models_readable_by_ollamaRun a local model server as a service account that can read its models
03_tags_through_the_proxyPublish an internal API through nginx without breaking streamed responses
04_generate_through_the_proxyPublish an internal API through nginx without breaking streamed responses
05_proxy_ready_for_streamingPublish an internal API through nginx without breaking streamed responses

Start it

  1. 2Labs
  2. ai-01select this one
  3. udownload it
  4. sstart the machine

Reading

Where the lab's hints send you, level by level, as you ask for them (h, then l opens a journal section in the TUI).

Theory for this lab

4 questions on the same topic, in the lab's Theory tab. They never affect the lab's grade. Three of them, to answer here:

Question 1

Short prompts work through nginx; long answers requested with "stream": false end in a 504 after exactly 5 seconds. Which directive is responsible?

Question 2

Why is `sudo -u ollama ollama list` not a test of whether the ollama account can read its models?

Question 3

nginx returns 502 and its error log says `connect() failed (111: Connection refused)`. What does that mean?