Lab 01. Agent anatomy, reliability and the token cost model
Part 1 · Scheduled 8 Nov 2026 · 2-hour lab
Part 1 is currently in progress. This page records the supplied class plan; personal notes and results have not been added.
Lab brief
First 30 min: install Ollama or llama.cpp and a 3B model (LAN server fallback). Write an LM wrapper with reply cache, cost ledger and budget cap. Measure Bangla and English tokens per word on Qwen2.5, BLOOM and o200k_base. Lab rule from today: a coding agent may write code only after you write the test; log three lines per lab (what it wrote, which test proves it, what you reviewed).
What to build and measure
- Install Ollama or llama.cpp and a 3B model; LAN server as fallback (first 30 min).
- Write an LM wrapper: reply cache, cost ledger, budget cap, one test per feature.
- Measure Bangla and English tokens per word on Qwen2.5, BLOOM and o200k_base.
- Lab rule for the whole course: a coding agent may write code only after you write the test; log three lines per lab.
- Pass check in the room: cache hit, cap refusal, cost-ratio table for three tokenizers, first log entry.
Why this class matters
- Industry: Every production LM call sits behind a wrapper with cache, ledger and cap; students build that layer on day one.
- Academic: The tokenizer table is the first dataset of the course and the seed of a thesis on Bangla cost.
- Elsewhere: Students run a model on their own laptop and are not blocked by API keys.
In-room pass check
A repeated call hits the cache; a call over the cap is refused; the table gives the Bangla/English cost ratio for three tokenizers; the verification log has its first entry.
Required materials
- Laptop with 8 GB RAM; staff LAN model server for the rest.
- Pre-downloaded ungated tokenizers (no Llama or Gemma).
- Starter repo with the test skeleton and 200 Bangla-English sentence pairs.
These are materials the draft assigns to the course team. They are not bundled with these notes. See the course guide for the test-first verification log and the deliverables for part boundaries.
Results ledger
[Measurements, test output, run-record paths, and verification log]
Sources
- Ollama docs
- Hugging Face tokenizers docs