Page 6 of 8~112 min topic

Local model lab

Instrument tokens/sec and fallback reasons

Metrics for local_share ≥ 0.8 and cloud_fallback_with_pii == 0 must distinguish bad input from component failure for legal analyst summarizing NDAs that must not leave the laptop by default.

~14 min this pageTesting and observability

1Learn the idea

Read

Golden signals for this system

Instrument Ollama-backed local router with policy-controlled cloud fallback so legal analyst summarizing NDAs that must not leave the laptop by default can answer: demand, errors, latency/age, saturation. Emit fields needed by local_share ≥ 0.8 and cloud_fallback_with_pii == 0 with bounded labels. Sample successful high-volume traces; keep errors and rollout transitions denser within policy.

Read

Alert path worth paging

Define at least one alert that would fire for LOCAL-FALLBACK-PII-03, with a for/pending window that survives deploy blips. Missing scrape or missing revision labels must not look like health. Include a trace/log example id format you will actually search.

Read

Implementation artifact

emit("route_total", backend=decision.backend, reason=decision.reason)
emit("local_tokens_per_sec", value=tps)

Read

Tests for telemetry

Add a unit/integration check that metrics increment on the happy path and on the fallback silently ships full NDA text to cloud when Ollama is down branch. Store machine-readable output in CI artifacts when practical.

Read

Stage depth

Cardinality discipline: tenant and revision are usually enough; raw question text is not a label. Exemplars or trace links beat screenshots alone when debugging LOCAL-FALLBACK-PII-03. Define who owns alert fatigue review. If you export to a vendor, record retention and access. Synthetic probes should use non-sensitive fixtures and still exercise POST http://127.0.0.1:11434/api/generate. Practice the query you will type at 2am once, while calm.

Read

Field notes for `local-model-lab` / `observability`

Document the exact PromQL or log query in the runbook stub for this service. Verify histograms have buckets around your SLO target. Add a canary synthetic check that exercises the oracle path every few minutes in staging. Confirm that PII redaction happens before export. Track build/version as a label on the golden signals. Delete noisy debug logs before they become accidental product dependencies. In this chapter the product is Ollama-backed local router with policy-controlled cloud fallback, the human stakeholder is legal analyst summarizing NDAs that must not leave the laptop by default, and the incident id you design against is LOCAL-FALLBACK-PII-03. Re-state the oracle in your notes — local llama3.2:3b answers fixture brief at ≥ 25 tok/s; fallback path logs reason=local_timeout — and keep the invariant visible: cloud fallback requires explicit policy flag + redaction pass; local p95 ≤ 6s for 512 tokens. Track local_share ≥ 0.8 and cloud_fallback_with_pii == 0 as the scoreboard. Surface under change control: POST http://127.0.0.1:11434/api/generate. If you only have forty minutes, finish the fixture for fallback silently ships full NDA text to cloud when Ollama is down before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.

Go deeper

Before you start

Why this matters

Name the dashboard row or log line legal analyst summarizing NDAs that must not leave the laptop by default opens first during LOCAL-FALLBACK-PII-03. It must include a correlation id and a bounded label from local_share ≥ 0.8 and cloud_fallback_with_pii == 0. If telemetry is missing, write whether you promote, hold, or roll back — and why hold is the default.

In the wild

See how this idea shows up as a product and a company — then come back to the lesson. Skills transfer across vendors.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Can you jump from alert to LOCAL-FALLBACK-PII-03-class evidence?
2. Do labels stay low-cardinality?
3. Is missing telemetry treated as hold?

All responses are required.