Notes
Set it up
Ollama is the simplest way. Install it, pull a model, and it serves an HTTP API on your machine at port eleven four three four. Your scripts and tools call that address instead of a cloud service; that is how ShopRung's support chat, the judge and the triage experiments in this course ran. Other options exist, such as LM Studio and llama dot cpp, but the idea is the same.
brew install ollama (or the installer from ollama.com) ollama pull llama3.2:3b ollama run llama3.2:3b API: http://localhost:11434 /api/chat, /api/generate ShopRung: SHOPRUNG_CHAT_MODEL= llama3.2:3b npm start
Measured
Real numbers from a sixteen gigabyte Apple M five laptop. The model has three point two billion parameters, compressed to four bits, a two gigabyte download. Loaded, it used seven and a half gigabytes, mostly for its thirty two thousand token context window. The first call took four point one seconds, one point four of them loading; warm calls took about three seconds for a hundred words of output, thirty three to thirty seven tokens a second.
parameters 3.2 billion
quantized Q4_K_M
download 2.0 GB
in memory 7.5 GB, with a
32,768-token context
cold call 4.1 s (1.4 s loading)
warm call 2.7 to 3.2 s for
about 100 tokens
speed 33 to 37 tokens/s Good enough?
Is a small local model good enough? From this course: it answered the support chat golden set well, thirty one of thirty six, but as a judge it only reached moderate agreement with humans, and it labelled eight of twelve failures correctly. Its test cases invented rules and none of its six pytest files ran as written. Good for drafts, summaries and classification with checks around it; not for unreviewed expected values or code.
support chat golden set 31/36 as a judge: kappa 0.52 (calibrated, vs humans) failure triage 8/12 test cases: invented rules pytest files: 0 of 6 ran as written fine for: drafts, summaries, classification with checks
Choose
So decide per task and per kind of data. Local keeps data on the machine, has no token bill and works offline, but you get smaller models on your own hardware, and bigger local models need more memory and run slower. Cloud models are stronger and need no setup, but the data leaves, you pay per token, and the provider's terms apply. Many teams use both: local for anything sensitive, cloud for the rest.
- local: data stays, no token bill, works offline; smaller models, your hardware
- cloud: stronger models, no setup; data leaves, per-token cost, provider terms
- bigger local models need more memory and are slower
- decide per task and data class
Mask first
When data must go to a cloud model, mask it first. We wrote a small script to redact tokens, emails and passwords, and ran it on the ShopRung trace from the coding agents episode. The first version caught the bearer token and the email, and missed the password, because the trace prints it on a different line than we assumed. After fixing the pattern, nothing was left. Test your masker like any other code, on real samples.
bearer token 1 → [TOKEN] email 1 → [EMAIL] password fill 0 ← missed! Fill "Alice123!" fixed the pattern, ran again: password fill 1 → Fill "[PASSWORD]" secrets left: 0
Rules
Write the rules down. Never send credentials, keys or real customer data. Use synthetic or masked test data. Use a local model for logs and traces from shared environments. Use only approved providers whose terms exclude training on your data. Give the masking script its own tests. And keep a record of what was sent, and where, so a leak can be traced.
- never: credentials, real customer data, keys
- synthetic or masked test data
- local model for logs and traces from shared envs
- approved providers only, with no-training terms
- the masker has its own tests
- log what was sent, and where
Common mistakes
Mistakes. Assuming a small local model matches a large cloud one. Measuring speed on the first, cold call. Forgetting that the context window costs gigabytes of memory. Trusting a masking script nobody tested, like our first version. Sending real data just this once. And not pinning the model version, so results change when someone pulls an update.
- assuming local = as good as a large cloud model
- judging speed on a cold start
- ignoring memory: the context window costs gigabytes
- a masker nobody tested
- real data "just this once"
- no model version pinned
Say it like this
In the interview: sensitive logs and data go to a local model. On a sixteen gigabyte laptop, a three billion parameter model ran at about thirty five tokens a second, good enough for drafts, summaries and triage suggestions, not for unreviewed expected values. Anything sent to a cloud model is masked first, and the masking script has its own tests: our first version missed a password.
- "Sensitive logs and data go to a local model: on a 16 GB laptop
- a 3B model ran at about 35
- tokens a second. It is fine for drafts and triage suggestions, not for unreviewed expected
- values. Anything sent to the cloud is masked first, and the masker has tests: ours missed
- a password at first."