skip to content

part 9 · sources checked 2026-11-20

language models in the pipeline: extraction, classification, retrieval, cost

This module shows where a language model belongs in a collection pipeline, and which checks in code surround each model call.

purpose

A large language model (LLM) can tag, extract, find, and summarize collected text, but each call has a cost and a risk.

The design keeps the model output under control: a structured output, fixed checks in code, a marked degraded mode, and cost limits. After the module, you can decide which task gets a model, which model class it gets, and which checks surround each call.

objectives

  1. Put each pipeline task in one class: deterministic code, a model with validation, or no automation.
  2. Choose a model class for each task from its latency limit and its volume.
  3. Test that each declared model is a model that a server loads.
  4. Design a structured output with whitelists, clamps, and a deterministic linker that records a reason.
  5. Design a retrieval path with two search legs, fusion, a rerank step, and a marked degraded mode.
  6. Identify the prompt injection surfaces of fetched web text, and give a control for each surface.
  7. Calculate the waste of a recompute job, and select the cost controls that stop it.
  8. Build an evaluation set and a gate for each model task, and explain why fakes do not measure quality.

lessons

1 of 10 published

a dim title is not yet published

  1. L01 where a model belongs in a collection pipeline (not yet published)
  2. L02 structured output, validation, and failure handling
  3. L03 field extraction and selector repair with a model (not yet published)
  4. L04 retrieval design for collected data (not yet published)
  5. L05 grounding, prompt changes, and prompt injection (not yet published)
  6. L06 cost control and evaluation with data (not yet published)
  7. L07 model extraction with an evaluation set (not yet published)
  8. L08 a retrieval evaluation gate before each model swap (not yet published)
  9. L09 a prompt-injection test suite (not yet published)
  10. L10 token metering and the cost for each record (not yet published)