Check a mortgage borrower's pay stub for qualifying income
Every loan file carries pay stubs, and each one means reading year-to-date pay and deciding whether a bonus really repeats. This app reads each stub, proposes a qualifying monthly income and sends an excluded bonus to an underwriter.
PresenterOpens the private repo. Visible to admins only.
For loan underwritersCross-domain · Banking
Why it matters
Today's manual process, and the same job with the app
Mortgage and consumer-lending underwriters and processors, checking pay stubs before income goes into a loan file.
✕Today's manual process
1Open each pay stub in the loan file and find the year-to-date earnings.
2Read the bonus note and decide by eye whether the bonus has a real payment history.
3Check the overtime to see how many pay periods it was actually paid in.
4One wrong call puts a bonus that will not continue into qualifying income.
Every stub read and judged manually
✓With the app
1Each stub is read, with ten details filled in and the stub line each came from.
2The bonus note is judged: a repeating bonus or a one-time payment, from the stub's own words.
3Overtime is read with the number of pay periods it was paid in.
4A monthly income is proposed, and an excluded bonus goes to an underwriter to decide.
Underwriters decide only the flagged bonuses
See it work
One real case, read by the app, step by step
Casey D. Rossi at Blue Harbor Logistics has a $3,433.34 bonus described as a one-time spot bonus.
Check a mortgage borrower's pay stub for qualifying incomeReference appBuilt to be shaped to your process
4
1What the stub says name, employer, pay frequency and period end, each with its source line.
2No overtime here the stub shows none, so none is counted toward income.
3The bonus, judged described as a one-time spot bonus, so it does not repeat.
4Sent to an underwriter a proposed $4,819.75 a month, with the bonus left out.
For engineers
How it is built, and how we measured it
All fourteen steps of the build are written up, from the business case to running it in your own environment.
Check a mortgage borrower's pay stub for qualifying income
A small, forkable project that does one job end to end. Run once for real, and every figure on these pages captured from that run.
PresenterOpens the private repo. Visible to admins only.
The business caseThe problem this solves
Verifying a pay stub for a loan file means reading the year-to-date earnings, checking whether overtime was paid consistently enough to count toward qualifying income, and deciding whether a bonus's payment history is real or just sounds recurring — for every stub in the file. Someone manually opening each pay stub, reading the bonus history note, and deciding by eye whether a bonus or overtime figure has enough payment history to count toward qualifying income before it goes in a loan file.
Audience
Mortgage and consumer-lending underwriters and processors who review pay stubs for income verification, and the people who build tooling for them. Every number on these pages came from one real run of this code, not from a vendor page.
The inputThe actual pay stubs
The corpus is 55 pay stubs, 0.02 MB (txt 55). Plain text, one format, invented rather than fetched — a real pay stub cannot be published at all (see SOURCES.md). Ten fields are chosen because the same ones matter to underwriting income verification: who, where, pay frequency, the base/overtime/bonus YTD figures, and whether the bonus has a documented history of recurring.
The corpus
The 55 pay stubsgenerated from a fixed seed, so no real record, person or institution appears in it.
Where each came fromwritten for this kit rather than collected — the corpus is generated in the kit's own repository, so there is no third-party data in it.
Swap this folder for your own material and the kit is pointed at your pay stubs. That is the whole change — there is no database to migrate.
One pay stub, as the model receives itIV-0001.txt · 1 of 55
Employee
--------
Casey D. Rossi
Employer
--------
BLUE HARBOR LOGISTICS
Pay Frequency
-------------
semimonthly
Pay Period End
--------------
2026-07-25
Year-to-Date Earnings
---------------------
Base pay YTD: $33738.27
Overtime pay YTD: none
Bonus pay YTD: $3433.34
Bonus History
-------------
Discretionary spot bonus, single payment, no history of recurrence.
The outcomeWhat a good result looks like
A ten-field extracted record per stub, plus two pure-code computed figures — a proposed qualifying monthly income and whether an excluded bonus needs underwriter review — informational only, never an automatic approval or denial.
And when it cannot
This run found zero extraction or classification errors across 55 stubs on either tier — there is no observed failure to report from the run itself. What the run did not test: a bonus note worded ambiguously in BOTH directions at once, an employer name that changes mid-year, a non-English stub, or a second corroborating document — this kit reads one stub at a time and never cross-references a W-2 or employer verification letter. See Business.not_good_enough.
Where it fitsWhat did work
Every line below is a measured result from this kit's own runs, with the figure that supports it. The headline above is not softened by any of them.
Screening a stack of pay stubs for which ones need a human to chase a second income document before a loan file closes — either tier — they tie on every accuracy figure measured here 100% flag recall and precision on both tiers this run, against the free keyword floor's 66.7% recall (3 missed review flags).
Deciding the two tiers on cost or speed when accuracy is identical — the fast tier Roughly half the p50 latency (2,768 ms vs 5,075 ms) and 8% fewer output tokens per call for identical scores on this corpus.
At a glanceHow the whole thing runs
100%extraction accuracy
2,768 msp50, end to end
$1.45per 1,000 pay stubs · Google Gemini 3 Flash
Run once, for real, on 2026-08-21. Every figure on these pages was captured from that run — nothing is written from intent.
14 steps, grouped by the question that sends you to them rather than by build order. Each tile carries the one figure that step is about, and opens the page behind it.
Check a mortgage borrower's pay stub for qualifying income14 steps · 4 questions · run once, for real · 2026-08-21
Every tile is a linkall 14 steps · no step without a page
Should you use this?What you bring, where it stops, and when not to use it
Before you commit an afternoon to this, these are the answers that decide it. Each one is rendered from the record it lives in — and links the page that holds it in full.
What do I have to bring?
Replace data/corpus/*.txt, write data/fields.json, and supply a gold record per stub with a stated flag for every optional field. Corpus lens →
When is this the wrong choice?
Avoid: The keyword floor for the bonus-continuance judgment specifically — its fixed word list is exactly what the planted ambiguity is built to defeat. That is the case against the best-fitting scenario (“Screening a stack of pay stubs for which ones need a human to chase a second income document before a loan file closes”). 2 scenarios scored in all, each with its own.Eval lens →
Where does it stop working?
Scanned or image-only stubs — there is no OCR step. 3 recorded failure modes, each from a run rather than a guess.Corpus lens →
What was never verified?
Whether the model would still score 100% on a larger, adversarially-constructed set of ambiguous bonus notes — this run's 12 ambiguous cases (of 31 bonuses) all resolved correctly on both tiers, but 12 cases is not enough to rule out a harder ambiguous phrasing this corpus did not think to plant. 3 items this kit says it could not check.Eval lens →
Can I run this on a model I control?
Yes — any OpenAI-compatible endpoint, including one on your own hardware. The shipped adapter takes its host from BASE_URL and its model from MODEL, so nothing in src/ changes. The published figures come from 2 models on the fast tier and the deliberating tier, one provider, one key. Prompt lens →
And if it fits — what do I stand up?
4 artifacts with a stated home and a stated egress, and 3 decisions each with what you provision past its ceiling — plus what was not measured. That is the next page, not this one.step 14 — Run it in your environment →
Not asked of this kit — 2 questions: clone (a fresh clone of this kit runs with nothing fetched); judge (nothing here is graded by a model).
Last verified 2026-08-21 — r001-income-verify. Every figure on these pages was captured from that run.
Run itHow this reaches your data
Every result on this page was produced by pure code over checked-in files, with no API key — which is why you can read the numbers before anyone spends anything.
Run this on your own data
The pipeline, its eval harness and the runs behind every numberdeployed inside your environment, on your own model endpoints, against your own documents.
The corpus above is the shape, not the limitit is a folder swap, and there is no database to migrate.
Checked before this shipped — Verified from a cold clone with no key configured: 55 stubs segment into 330 sections in 0.003 seconds, and the assembled prompt for IV-0001 replays byte for byte — its three part sizes match what run r001 recorded.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
Step 01 of 14Business case
Written for: product manager · Measured during the eval run. Never estimated, never quoted from a vendor page.
In brief
100.0%rows answered
2,768 msp50, end to end
4,625 msp95
2 minclone to first result
What the clock covers. model call only, one per stub
Current processWhat it replaces
Someone manually opening each pay stub, reading the bonus history note, and deciding by eye whether a bonus or overtime figure has enough payment history to count toward qualifying income before it goes in a loan file.
Where it is not good enough
This run found zero extraction or classification errors across 55 stubs on either tier — every one of the 448 stated cells hit, 0 hallucinations, 0 wrong bonus-continuance calls. That is a small sample for a rule this consequential, and a clean run says nothing about the harder cases this corpus does not test: a bonus note near the OT continuance threshold worded ambiguously in BOTH directions at once, an employer name that changes mid-year after an acquisition, or a non-English stub. It also reads one stub at a time and never cross-references a second document — see Data.breaks_on.
One question, end to end. Colour on the fan-in is the corpus format; a red hook marks every station with a recorded failure, and the words — every sub line, failure and report field — are in the ledger beneath. Every station is a link — click one to jump to its row, and each row links to the lens that explains it.
The free keyword floor (evals/baseline.py, a fixed list of continuance-sounding words checked against the Bonus History note) scores 97.3 pct extraction accuracy but 66.7 pct flag recall — three missed review flags — against 100 pct flag recall and precision on both tiers here, with zero errors of any kind. No red-team run exists for this kit — this footer names that absence rather than a resistance rate it does not have.
The swap seams
Seam
File
What changes
SECTION_HINTS
src/select.py
map fields to your own stub's headings; unmatched falls back to the whole document
PROVIDERS
src/adapters/__init__.py
any OpenAI-compatible host, or Anthropic's Messages API
this kit's own flat continuance threshold and review threshold — replace with your actual loan program's published rules before trusting the computed figures for anything real
the field schema
data/fields.json
a different set of fields entirely, with its own types and allowed values
Components
Component
File
Role
segment
src/segment.py
cut the pay stub into addressable sections, pure code
select
src/select.py
pick which sections carry each field, pure code
prompt
src/prompt.py
assemble one call for all ten fields
extract
src/extract.py
the AI layer, one provider one key — plus the pure-code computation downstream: qualifying monthly income and the review flag
judge
evals/judge.py
score field accuracy and the flag's recall/precision separately, pure code
Where it breaks at scale
One call per stub, no concurrency and nothing shared between calls: 55 stubs took under three minutes wall clock on the fast tier. A stack of thousands needs batching and a rate-limit strategy this kit does not have. It also never cross-references a second document — a real underwriting file's bonus continuance is often corroborated against a W-2 or a separate employer letter this kit never reads.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
Step 03 of 14App UI
Written for: anyone, in 5 seconds · Screenshots of the running app taken during the run.
SuccessesWhen it works
Before anything is asked of the model. Ten named fields with their own types and allowed values, plus a second panel for the two pure-code figures computed afterwards.successOpen full size →IV-0001, extracted live. A $3,433.34 bonus described as a one-time, discretionary spot bonus correctly reads bonus_recurring: no, and the computed panel below routes it: "YES — route for underwriter review," with a proposed $4,819.75 qualifying monthly income that excludes it.successOpen full size →
LimitsWhen it does not
A report showing only wins is an advert. This one is required, and the validator now refuses a kit that omits it.
The same button with no API_KEY configured. A calm 200 and a plain sentence, not a stack trace: nothing was called, nothing was spent, and the field table stays browsable.failureOpen full size →
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
Step 04 of 14Corpus
Written for: "can I point this at mine?" · Measured off the corpus the run actually used.
In brief
55pay stubs
0.02 MiBtxt 55
330sections · p50 42 chars
$0.00setup · 0.003s
How it is cutWhat one section is
cut on underlined section headings; a stub with none falls back to one whole-document segment so a span still resolves
SetupWhat the setup figure measured
There is no index. Preparation is segmentation only — 55 stubs cut into 330 sections by src/segment.py, pure code, no model and no key.
LicenceLicence
MIT — this repository's own licence. Every employee, employer and dollar figure is invented; a real pay stub cannot be published at all — it is one of the most sensitive documents a person holds.
Bring your ownBring your own pay stubs
Replace data/corpus/*.txt, write data/fields.json, and supply a gold record per stub with a stated flag for every optional field. SECTION_HINTS in src/select.py maps fields to headings and will need editing for a different stub layout; when it does not match, selection falls back to the whole document — slower, more expensive, always correct.
What breaks it
Scanned or image-only stubs — there is no OCR step.
A stub whose sections are not headed — segment() falls back to one whole-document segment, so a span names "document" and locates nothing finer.
A second corroborating document (a W-2, an employer verification letter) is never cross-referenced — the continuance determination comes from the stub's own Bonus History note alone, whatever it does or does not say.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
Step 05 of 14Prompt
Written for: engineer · Logged from the run, verbatim.
In brief
The assembled prompt in full, and its real decomposition. Every part below occurs in the prompt that was actually sent, and the token counts sum to the recorded input total — they were measured against the provider’s own counter, not apportioned by character share.
AssemblyHow the prompt is assembled
Part
Characters
Tokens
system
1,096
342
field schema
1,184
310
pay stub sections
369
187
Total
839
This is the cost lesson as arithmetic: of the 839 tokens assembled, 342 are instructions — 41% of the prompt, the largest single part. A per-request bill follows whichever part is biggest, and on this kit that is the one named here.
Measured token-for-token via evals/prompt_tokens.py's nested-prefix subtraction against the provider's own tokenizer, not estimated from characters — see results/tokens-p001-income-verify.json.
Full promptThe prompt in full
The verbatim prompt, as sent
the prompt, as sent
SYSTEM:
You extract structured fields from a pay stub. You return JSON and nothing else.
RULES, in order of importance:
1. If the stub does not state a field, return null for it. Do not infer it, do not compute it, and do not use what you know about the world. A null is a correct answer -- a stub with no overtime this year correctly has null for every overtime field, and a stub with no bonus correctly has null for every bonus field.
2. `bonus_recurring` means the Bonus History note states an ACTUAL PAYMENT HISTORY of two or more prior payments (e.g. "paid in 2024 and 2025", "paid each quarter for two years"). It is 'no' for a note that only uses a word like "annual" or "recurring" WITHOUT stating any payment history ("Annual performance bonus" with no history given), and 'no' for an explicitly one-time or discretionary bonus. The label alone is not history -- read for a stated history, not a keyword.
3. Copy values verbatim from the stub wherever possible.
4. Use the exact allowed value for a field that lists them.
5. Return every field named in the schema, even when the answer is null.
USER:
Extract these fields:
- employee_name (string) -- the name on the pay stub, verbatim
- employer_name (string) -- the employer that issued the stub
- pay_frequency (enum) one of: weekly, biweekly, semimonthly, monthly -- the pay frequency stated on the stub
- pay_period_end (string) -- the stub's pay period end date, YYYY-MM-DD
- ytd_base_pay (number) -- year-to-date base pay, no currency symbol
- ytd_overtime_pay (number) -- year-to-date overtime pay, or null if the stub states none
- overtime_periods_paid (integer) -- how many pay periods this year paid overtime, or null if none was paid
- overtime_periods_total (integer) -- how many pay periods have elapsed this year, or null if no overtime was paid
- ytd_bonus_pay (number) -- year-to-date bonus pay, or null if the stub states none
- bonus_recurring (enum) one of: yes, no -- does the Bonus History section describe an actual history of the bonus recurring across two or more prior payments (an annual/quarterly bonus with stated payment history), or a one-time/discretionary payment? A note that merely uses the word 'annual' or 'recurring' with no stated payment history is 'no' -- the label alone is not history. null if no bonus this year.
Return a JSON object with exactly these keys: employee_name, employer_name, pay_frequency, pay_period_end, ytd_base_pay, ytd_overtime_pay, overtime_periods_paid, overtime_periods_total, ytd_bonus_pay, bonus_recurring
Use null for any field the stub does not state.
PAY STUB
--------
Employee
--------
Casey D. Rossi
Employer
--------
BLUE HARBOR LOGISTICS
Pay Frequency
-------------
semimonthly
Pay Period End
--------------
2026-07-25
Year-to-Date Earnings
---------------------
Base pay YTD: $33738.27
Overtime pay YTD: none
Bonus pay YTD: $3433.34
Bonus History
-------------
Discretionary spot bonus, single payment, no history of recurrence.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
Step 06 of 14Evals
Written for: the skeptic · The harness output, with as_of / model version / dataset version / verified_by.
In brief
Check a mortgage borrower's pay stub for qualifying income — 55 pay stubs. Two tiers of one model family answered, and every answer was then graded Two different ways — because the grade is a measurement too, and most of what went wrong on this kit went wrong in the ruler rather than the model.
55pay stubs
55source documents
2model tiers
110graded answers
2grading methods
MeasurementsWhat was measured
COUNTED448 · 448 / 448extraction accuracy — stated cellsDecided by == against a fixed gold value. No model graded this and it reproduces to the digit — which makes it checkable, not necessarily right: it is only as good as the gold behind it.
COUNTED9 · 9 / 9review-flag recall — stubs that should have been flaggedDecided by == against a fixed gold value. No model graded this and it reproduces to the digit — which makes it checkable, not necessarily right: it is only as good as the gold behind it.
NOT YET KNOWN—A person confirmed the gold is rightThe grader is == and needs no confirming. The gold does: it is machine-derived from the registry's structured modules, and every rate on this page rests on that derivation being faithful to what the prose actually says. Nobody has read a document against its gold record by hand.
Two words carry this page: Counted is deterministic and nobody's opinion and Not yet known is printed blank rather than filled with something plausible. There is no Judged row here and that is the point: nothing on this page is a model's opinion about another model. The row most worth having is currently the empty one.
How the method was validated
The scorer (evals/judge.py) is pure code, exact match with light normalisation against a mechanically-derived gold — there is no judgement to validate, only comparison. What WAS validated: tools/build_corpus.py's gold is read back off the same generated YTD figures the document states, never carried over from a separate target, and evals/check_labels.py asserts stated/value consistency on every row before any run is allowed to spend. The TRUE review flag is derived by running the same pure-code compute() over gold's own values, never a separately-typed truth.
343.44output tokens · the fast tier · 2,768 ms p50
369.91output tokens · the deliberating tier · 5,075 ms p50
Two tiers, one API key
Not two vendors and not a vendor comparison — which is the whole reason the two-model rule could be met without signing up to a second provider. Both tiers send the same retrieved context; the slower one writes about twice as much back, waits 1.8× as long, and lands one row apart on 55. This set does not separate them on quality and no ranking should be read from it — which is not an opinion about the models but something the second run below demonstrated.
Grading costWhat it costs
Every dollar on these pages is a MEASURED token count multiplied by a named vendor's PUBLISHED rate — a projection onto a rate card, not a bill anyone paid.
Priced at
Per 1M in / out
One pay stub
1,000 pay stubs
Share that is the prompt
Google Gemini 3 Flash the cheapest model Google publishes a rate for, and the card every kit in this series projects onto so the rows compare across use cases
$0.50 / $3.00
$0.001452
$1.45
29%
Same work, 1× the bill
The same pay stubs, the same tokens — only the rate card changed. And on that card about 29% of what you pay is the prompt this pipeline sends, not the answer it writes.
which tier is called — the two tiers tie on accuracy and diverge only on output length and latency (see cost_by_model), so on this corpus the lever buys nothing measurable.
Rates checked 2026-08-18. The provider that actually ran r001 and r002 publishes no rate card this repo commits, so nothing here is what was actually paid — the real spend for this kit's build is recorded in the commit history and the shared call ledger, not on this page.
The gradersTwo ways to grade
Grader
Cost / 1k
Data leaves
Same answer twice
Result
Per-field exact match, light normalisation Does the model's value for each field match gold, after trimming whitespace/punctuation and treating numbers within half a cent as equal?
$0.00
no
yes
the fast tier 100.0% · the deliberating tier 100.0%
Review-flag confusion matrix Does the run's own pure-code needs_review (computed from what the model extracted) match the same computation run over gold's own true values?
$0.00
no
yes
the fast tier 100.0% · the deliberating tier 100.0%
Every row opens its own page: how the test was run, the input on one real row, the prompt or formula with every iteration of it, and the analysis.
Why this set cannot separate them
Partially — the corpus's planted ambiguity is what the keyword floor fails, but on THIS run neither model tier failed it even once, so the separation is between the models and the floor, not between the two tiers. Every field but bonus_recurring scored a clean 100% hit rate (or a clean abstain on a stub with no overtime/bonus) on both tiers, and bonus_recurring itself hit 31 of 31 stated cases on both. A corpus large enough to separate the two tiers from each other would need to find a case the fast tier gets wrong that the deliberating tier does not — none occurred in this 55-stub run.
Choosing oneWhich one to use
The comparison is only useful if it ends in a choice. The answer is conditional — and it is not the grader with the best agreement score.
If your situation is
Use
Because
And avoid
Screening a stack of pay stubs for which ones need a human to chase a second income document before a loan file closes
either tier — they tie on every accuracy figure measured here
100% flag recall and precision on both tiers this run, against the free keyword floor's 66.7% recall (3 missed review flags).
the keyword floor for the bonus-continuance judgment specifically — its fixed word list is exactly what the planted ambiguity is built to defeat.
Deciding the two tiers on cost or speed when accuracy is identical
the fast tier
Roughly half the p50 latency (2,768 ms vs 5,075 ms) and 8% fewer output tokens per call for identical scores on this corpus.
paying for the higher tier here — this run found nothing it bought.
This pipeline was also attacked, which is a different question from whether its answers are right: see Threat model for the injection experiment, its two gates and what it does not prove.
Failure causesHow it fails
Cause
What it means
Rows
A real example
keyword-only-continuance
Bonus history read by keyword, not by stated payment history — the corpus's planted ambiguity, illustrated by the baseline (neither scored model tier fell into it on this run)
3
IV stub with bonus note "Annual performance bonus." (no payment history stated): gold bonus_recurring=no. The free keyword floor (evals/baseline.py) matches the word "annual" and answers yes, wrongly including the bonus in qualifying income and suppressing…
What we could NOT verify
Whether the model would still score 100% on a larger, adversarially-constructed set of ambiguous bonus notes — this run's 12 ambiguous cases (of 31 bonuses) all resolved correctly on both tiers, but 12 cases is not enough to rule out a harder ambiguous phrasing this corpus did not think to plant.
Whether the $1,000 review threshold and the 75% overtime continuance threshold match any real loan program's actual published rules — they do not, by design (see README); no real program's guideline was consulted or reproduced.
How either tier performs on a real, messy pay-stub layout (multi-column PDFs, payroll-provider-specific formatting, scanned images) — this corpus is plain text with a single, consistent underlined-heading layout by construction.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
Step 07 of 14Unit cost
Written for: whoever signs off on the bill · Measured over the eval run, per model. Never quoted from a vendor page.
In brief
Tier
Input tokens
Output tokens
p50 latency
Google Gemini 3 Flash
the fast tier
842.42
343.44
2,768 ms
$0.001452
the deliberating tier
842.42
369.91
5,075 ms
$0.001531
The token counts are measured on a real run and belong to this pipeline — which sections are selected, the field schema, the prompt — so they hold wherever you run it. The dollars are those counts multiplied by each vendor's published rate, checked 2026-08-18. Nobody paid these particular bills; they are what the same work would cost you on a card you can sign up to today.
Identical work in both rows — the same query, the same tokens. Only the price list changed. Which is why the token count is the measurement and the dollar is arithmetic you can redo on your own card.
Answering vs gradingAnswering and grading are two separate bills
The keyword floor (evals/baseline.py) and the scorer (evals/judge.py) are both pure code and cost $0.00 to run against either result set. The figure above is both runs' own token counts (the fast-tier and deliberating-tier runs, 55 stubs each) priced at Google Gemini 3 Flash's published rate — the same basis cost_per_query_usd uses, not a second, larger spend.
Cost driversWhat actually moves the bill
The fixed system prompt and field schema (652 of 839 tokens on the example call, 78%) outweigh the pay stub itself (187 tokens) on a short, ten-field stub — the floor every call pays before a single YTD figure is read.
Output length: the model returns a full ten-key JSON record every call regardless of how many fields the stub actually states, so a stub with no overtime or bonus still pays for four null values in the reply.
Your volumeWhat it costs at your volume
Linear in stubs: each call is independent and self-contained, with no shared context or index to amortise. This run's 55 stubs cost about $0.080 projected onto Gemini 3 Flash's rate, so ten times the set is about $0.80 on the same rate and the same prompt — arithmetic on the measured per-call rate, not a second run.
Where pricing changes shape
Your return, with your numbers
Volume
What it replaces
Time saved per item
We publish the inputs, not a return: a return depends on your labour cost and your volume. The ROI dashboard takes it from here, and AI Costing explains the math.
Other modelsOn other models
This is arithmetic, not a run. No model below was executed against the labelled set, and no accuracy is claimed for any of them. What transfers is the input volume: retrieval is model-independent, so every model would receive the same passages.
46,333input tokens · this run
18,889output tokens
—not priced — no committed card for the provider that ran it
The exact work behind every number on these pages: 55 pay stubs extracted, each scored by pure code against a mechanically-derived gold set. This run (r001-income-verify, the fast tier) answered all 55 of 55 stubs with no truncation -- the row this table prices, the same one Cost.cost_by_model[0] uses.
Model
Provider
One eval pass
This whole run
Per 1,000 queries
Rates as of
gpt-5-6-luna
OpenAI
$0.032
$0.032
$0.58
2026-09-12
gemini-3-flash
Google
$0.080
$0.080
$1.45
2026-09-18
gemini-3-8-flash
Google
$0.106
$0.106
$1.92
2026-09-18
llama-5
Meta
$0.138
$0.138
$2.51
2026-09-18
claude-haiku-4-5
Anthropic
$0.141
$0.141
$2.56
2026-09-12
grok-4-5
xAI
$0.206
$0.206
$3.75
2026-09-18
grok-4-6
xAI
$0.206
$0.206
$3.75
2026-09-18
claude-sonnet-5
Anthropic
$0.282
$0.282
$5.12
2026-09-12
gemini-3-1-pro
Google
$0.319
$0.319
$5.81
2026-09-18
gpt-5-6-terra
OpenAI
$0.319
$0.319
$5.81
2026-09-12
gpt-5-6-sol
OpenAI
$0.563
$0.563
$10.24
2026-09-12
claude-opus-4-8
Anthropic
$0.704
$0.704
$12.80
2026-09-12
claude-opus-5
Anthropic
$0.704
$0.704
$12.80
2026-09-12
claude-fable-5
Anthropic
$1.408
$1.408
$25.60
2026-09-18
claude-fable-5-1
Anthropic
$1.408
$1.408
$25.60
2026-09-18
gpt-6-astra
OpenAI
$1.408
$1.408
$25.60
2026-09-17
Read this against the numbers above
Every row below prices the FAST TIER's own 55-call run (r001-income-verify) -- the deliberating tier's own token counts are on Cost.cost_by_model[1] and are not separately projected here.
Neither tier's registered run left anything to disable -- src/adapters/__init__.py's thinking parameter is only sent when a caller passes one, and this kit's own harness never does (see LLM.settings) -- so unlike several sibling kits, there is no reasoning-on/reasoning-off discrepancy to caveat here.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
The codeEvery file, and what it is for
Five modules, no framework, and almost no dependencies. The pipeline is stdlib Python, because a kit is meant to be read and changed by someone who cloned it ten minutes ago — every dependency is a thing they have to understand before they can touch the part they came for.
Four of these are swap seams: the points you edit to make the kit yours. Each is marked, and each block below is the module’s real shape, read out of the file rather than written here.
The files on this page are not in the public GitHub catalog.
src/segment.pysegment
cut the pay stub into addressable sections, pure code
src/segment.py
# Cut a document into addressable sections. Pure code — no model, no network.
def sections(text):
def locate(text, value):
def span_label(secs, start):
src/select.pyselect — a swap seam
pick which sections carry each field, pure code
You change it to: map fields to your own stub's headings; unmatched falls back to the whole document
src/select.py
# Pick which sections plausibly carry each field. Pure code -- the last deterministic step
SECTION_HINTS = {
def for_field(secs, field):
def plan(secs, fields):
src/prompt.pyprompt
assemble one call for all ten fields
src/prompt.py
# Assemble the extraction prompt. One prompt per stub, all ten fields in it.
SYSTEM = (
def field_schema(fields):
def build(doc_text, secs, fields, selector):
def parse(raw, fields):
src/extract.pyextract — a swap seam
the AI layer, one provider one key — plus the pure-code computation downstream: qualifying monthly income and the review flag
You change it to: this kit's own flat continuance threshold and review threshold — replace with your actual loan program's published rules before trusting the computed figures for anything real
src/extract.py
# Extract one stub's fields: segment, select, prompt, one model call, then a pure-code
HERE = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
FIELDS = os.path.join(HERE, "data", "fields.json")
CORPUS = os.path.join(HERE, "data", "corpus")
MAX_TOKENS = 4000
OT_CONTINUANCE_THRESHOLD = 0.75
LARGE_BONUS_THRESHOLD_USD = 1000.0
def load_fields():
def load_doc(stmt_id):
def documents():
evals/judge.pyjudge
score field accuracy and the flag's recall/precision separately, pure code
evals/judge.py
# Score an extraction run. PURE CODE -- gold is exact and the answer is one value per cell, so
def norm(v):
def _num(v):
def equal(field, got, want):
def score_cell(field, got, want, stated):
def score(fields, records, golds):
def score_flags(flags, golds):
Start hereThe shortest path into it
src/segment.pycut the pay stub into addressable sections, pure code
src/select.pypick which sections carry each field, pure code A swap seam.
src/prompt.pyassemble one call for all ten fields
src/extract.pythe AI layer, one provider one key — plus the pure-code computation downstream: qualifying monthly income and the review flag A swap seam.
evals/judge.pyscore field accuracy and the flag's recall/precision separately, pure code
Every entry above is a file in this kit, listed in the order the pipeline runs it.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
ScenariosWhat it costs at your volume
Everything below is computed from one measured base: 842 input and 343 output tokens per query, all of it fixed — this kit sends the document's own selected sections, so there is no retrieval depth to turn. Change the volume and the bill scales linearly, because nothing here batches.
Grading really is free here, and that is a property of the ruler rather than a discount
This kit is graded by pure code — the grader makes no model call, needs no key and sends nothing anywhere, so the grading line above is zero at every sampling rate and the leak count stays at nought. What that buys is a ruler you can run on every row, every time, for nothing. What it costs is reach: a code grader can only check what is mechanically checkable.
OperationsFour shapes of workload
The same arithmetic, at volumes worth naming. These are illustrations of scale, not measurements of anyone’s deployment.
Shape
Querys/day
Per day
Per month
Per year
Model follows the controls above.
What this ignoresWhere a real bill diverges
Read before quoting any of it
Output length is assumed constant.A terser or more verbose model moves it, and output is priced above input everywhere.
No volume, committed-use, batch or cache discount is modelled.Each moves real enterprise pricing and none are on a public rate card.
Longer documents cost more and nothing here caps them.This kit selects the document’s own sections in pure Python, so there is no vector store to price — but a corpus of longer records raises the input tokens per query directly, and that is the very number every figure above multiplies.
Grading adds nothing to this bill, and would if you changed the ruler.A code grader is free and local; swapping in an LLM judge would cost more per row than the extraction itself and send every row to a vendor. The instrument is a cost decision, not a footnote.
Rates age.Every one carries the date it was read on the cost page.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
In one lineWhat this kit exposes
This run's stubs are entirely synthetic (tools/build_corpus.py) -- no untrusted party wrote any stub text. In a real deployment a stub arrives from the applicant, an employer's payroll system or a payroll provider's portal -- exactly the kind of externally-authored input this kit's architecture reads verbatim and trusts, with no verification step before the Bonus History note reaches the model. No attack has been tried against this kit; see redteam.why.
Read from the shared .env or the real environment only, never written into the repo, never requested from a reader on any surface. src/app.py's /api/extract handler strips api_key and base_url out of any exception message before it reaches the browser, so a misconfigured key cannot leak into a UI error.
The experimentWe did not attack it — and three of four boundaries hold
An indirect prompt injection needs a field an outside party controls that reaches the prompt. In THIS corpus every stub is generated by tools/build_corpus.py, so there is no live untrusted text in the run this report measures -- but a real deployment's stubs arrive from an applicant, an employer or a payroll provider, and that surface has not been attacked. The four gates below are boundaries confirmed by reading the code, not payloads run through it. Confirmed by reading the code, not by a run, on 2026-08-21 -- no attack run was fired; see redteam.why.
Boundary checked
What could go wrong
What the code guarantees
Does an extraction ever write anywhere or trigger a downstream action?
An extraction could plausibly post an approval, a denial or an income adjustment.
No code path does. src/extract.py::extract() and src/app.py's /api/extract both return a record only; neither writes to any file or store -- confirmed by reading every call site.
Could a misconfigured provider key leak into a UI-visible error?
An exception raised from a bad key or base URL could echo the secret back to the browser.
src/app.py's /api/extract handler strips api_key and base_url out of any exception message before returning it -- confirmed by reading the handler (see key_handling).
Is the overtime continuance threshold, the large-bonus threshold, or the qualifying-income arithmetic something a prompt or a reply can move?
A crafted Bonus History note could plausibly shift OT_CONTINUANCE_THRESHOLD or LARGE_BONUS_THRESHOLD_USD, or talk the arithmetic into a different answer.
No. OT_CONTINUANCE_THRESHOLD and LARGE_BONUS_THRESHOLD_USD in src/extract.py are module-level constants, read once at import time -- nothing the model returns is consulted when computing them; qualifying_monthly_income and needs_review are both computed after the model call, in pure code (src/extract.py::compute()).
Could a crafted Bonus History note talk the model into a fabricated bonus_recurring value with no basis in the stub text?
A note written to mimic a genuine multi-year payment history could plausibly move bonus_recurring to 'yes' with no real history stated, folding a one-time bonus into qualifying income.
Unmeasured -- no attack has been tried. bonus_recurring is an enum with no span at all (see Eval.scores.non_spannable_fields), unlike the copied-verbatim fields src/segment.py::locate() can check against the stub text -- nothing stops the model from ASSERTING a recurring history the stub never states; see could_not_verify.
The first three boundaries hold, confirmed by reading the code, not by an attack trial. The fourth is the one this run has not tested: bonus_recurring is the field the whole guardrail depends on, and it is also the one field this kit's own span mechanism cannot check, because it is an enum, not a copied value -- no crafted input has ever been run against it.
The result0 attack trials, and three of four boundaries checked here hold in code: no write path exists, the overtime and bonus thresholds are fixed constants the model cannot move, and a misconfigured key cannot leak into a UI error. The fourth -- whether a crafted Bonus History note could talk the model into a fabricated bonus_recurring=yes -- is unmeasured.
1externally-authored field a live deployment would carry (the stub text itself, typed or scanned by a preparer) -- synthetic on this run's corpus
0 of 0attack trials run
n/adecision-flip resistance -- not measured
This run's corpus is entirely generated (tools/build_corpus.py) -- no stub's text was authored by an outside party. A real deployment's stubs arrive from an applicant, an employer or a payroll provider -- exactly the kind of externally-supplied text this kit's architecture reads verbatim and trusts, with no verification step. Whether a Bonus History note crafted to mimic a genuine multi-year payment history (a fabricated 'paid in 2024 and 2025' string with no real basis) could talk the model into a false bonus_recurring=yes is unmeasured for this kit.
Read this twice
The review flag is exactly as good as bonus_recurring. src/extract.py::compute() never re-derives bonus_recurring from the stub text -- it trusts the model's own answer and only checks the dollar threshold and the arithmetic. On this run both tiers scored a clean 100 pct extraction accuracy and 100 pct review-flag recall and precision, with zero errors of any kind across 55 stubs -- a genuinely clean run, and also a small one for a rule this consequential (see Business.not_good_enough). A future version should recompute bonus_recurring independently before trusting a live flag, and a red-team pass targeting exactly that field is the natural next measurement.
HonestyWhat this does not prove
Whether a Bonus History note crafted to mimic a genuine multi-year payment history (a fabricated 'paid in 2024 and 2025' string with no real basis in the stub) could talk the model into a false bonus_recurring=yes -- no red-team run exists for this kit.
Whether the live app's own /api/extract behaves identically to the registered run under an adversarial stub -- both use the same src/extract.py::extract(), but neither has been tested against one.
Whether a code-level consistency check on bonus_recurring (re-deriving it from the stub text by pure code) would catch a model's fabricated 'yes' in practice -- none has been built or exercised.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
In one lineThe guardrail is enforced in code
Not a prompt instruction the model can ignore — a comparison applied after the reply is parsed, before anything downstream sees it.
the guardrail, verbatim
A pay stub's excluded bonus is flagged for underwriter review when it is $1,000 or more and bonus_recurring is 'no'. Overtime only counts toward qualifying income when it was paid in at least 75% of this year's pay periods. Both are computed in pure code from the model's own extracted fields -- never asked of the model directly, never overridden by anything it returns.
src/extract.py::compute() -- OT_CONTINUANCE_THRESHOLD, LARGE_BONUS_THRESHOLD_USD and the flag arithmetic are module-level constants and pure code, read once at import time. Unlike a prompt instruction the model could ignore, this guardrail cannot be talked out of firing by anything in the reply text; it only depends on the model's own bonus_recurring (and, for the overtime component, overtime_periods_paid/overtime_periods_total) values being right in the first place -- a DIFFERENT, prompt-level dependency the flag inherits (see is_not and could_not_verify).
EvidenceDoes it hold?
What
Measured
The review flag never misses a stub that should have been flagged
9 of 9 stubs that should have been flagged were flagged, on both tiers (100 pct recall) -- see Eval.scores.
The review flag never fires on a stub that should not be flagged
0 false positives among the 46 stubs that should not have been flagged, on both tiers (100 pct precision).
The overtime continuance and large-bonus thresholds are not something a prompt or a reply can move
OT_CONTINUANCE_THRESHOLD and LARGE_BONUS_THRESHOLD_USD in src/extract.py are module-level constants, read once at import time -- confirmed by reading compute(); nothing the model returns is consulted when computing them.
No code path writes an approval, denial or posting based on the flag
src/extract.py::extract() and src/app.py's /api/extract both return a record only; neither writes to any file or store -- confirmed by reading every call site.
The limitWhat a guardrail is not
IT IS NOT A CHECK ON bonus_recurring ITSELF. The flag trusts the model's own answer for that field completely -- nothing re-derives bonus_recurring from the stub text before computing the flag. This run found zero disagreements on that field across 55 stubs on both tiers (see Eval.scores), which is evidence the prompt's stated-history rule held up on this corpus, not evidence the guardrail itself checked and cleared anything -- it never looks at the stub text at all.
It does not guarantee an approval or a denial -- the flag is a routing signal for a human reviewer, never itself a decision. See UI.shots and Data.breaks_on.
It has not been attacked. Whether a Bonus History note crafted to mimic a genuine payment history could also evade the flag is unmeasured -- see Security.could_not_verify.
WatchedWhat is watched, and why that one
2runs recorded
0 / 0deterministic metrics exact
+0.0%largest move — latency
0band breaches
—model half · needs provider URL
The kit measures 14 watched figures plus 8 comparability guards and 5 reference constants — three duties, not one list. 0 of the watched are grader rates, each on its own grader page; this board watches the ones that decide when to look again. Each square is one watched figure; filled means the latest run measured it.
8 measured by the latest run6 need the model half
Metric
Owner
Role
Why this one
field-exact-match-with-normalisation
Per-field exact match, light normalisation
alarm
extraction_accuracy specifically on the bonus_recurring field, since that is the one field this corpus is built to test -- see taxonomy; the 448-of-448 clean-run rate, since a drop anywhere would mean something in the prompt or the corpus changed; stated vs scored cells -- 448 of 550 possible cells were stated; the rest are correct nulls on no-overtime/no-bonus stubs, not misses — alarm on Any drop in extraction_accuracy below the measured 100 pct, on any field -- this run's clean result is the baseline, and any regression means the prompt, the corpus, or the provider changed.
flag-confusion-matrix
Review-flag confusion matrix
alarm
review-flag recall specifically -- 9 stubs should be flagged in this corpus, and missing one routes an excluded bonus past underwriter review; false positives among the 46 stubs that should NOT be flagged, since a false positive costs a reviewer's time rather than a missed risk; whether a field-level miss (see the other grader) ever changes the flag -- it has not, on either tier, this run, because there were no field-level misses to begin with — alarm on Any review-flag false negative, on any run -- a missed flag is the safety-critical failure this kit exists to catch, and recall was 100 pct on both tiers this run.
GuardsBefore any comparison
Preconditions, not alarms. If one moves, the runs were not measuring the same system and nothing else on this board may be differenced.
Guard
Value
If it moves
corpus.doc_count
55
different corpus — nothing is comparable
corpus.bytes
20,734
pay stubs edited — the count held, the bytes did not
split.count
330
the sections count moved — a different set was scored
split.size_p50
42
the median size of one section moved
split.size_p95
160
the 95th-percentile size of one section moved
dataset.rows
55
the test set changed — every rate has a new denominator
tokens.context_limit
1,000,000
different model family
index.build_seconds
0.003
no index is built here — a change is in corpus preparation, not an index rebuild
all shared guards held between the recorded runs (documents 55, extraction_cells 448, failures 0, refusal_cells 102, thinking True) — which is why the history below is allowed to mean anything.
The reference constants — the null-grader baseline, the adjudication matrix, the negative count — are the third duty. They are never re-measured per run: a baseline that moves with the thing it measures is not a baseline.
BandsThe alarm bands
Derived from evidence, never picked: exact-match where two runs reproduced a metric to the digit, wider than the measured same-input drift for latency, one row of the negative class for any rate — denominator printed beside it.
Group
Band
Denominator
Where the band comes from
Extraction accuracy
exact match at 100 pct on both tiers
448 stated cells
two independent tiers (r001-income-verify, r002-income-verify) reproduced the identical figure to the digit -- the exact-match band MONITORING's own rule calls for.
Refusal accuracy
exact match at 100 pct on both tiers
102 refusal cells (correct nulls on stubs with no overtime or no bonus)
two independent tiers reproduced the identical figure to the digit.
Hallucinations
exact match at 0 on both tiers
448 stated cells
two independent tiers reproduced zero to the digit.
Span rate
exact match at 97.24 pct on both tiers
spannable extracted values (non-enum fields with a non-null answer)
two independent tiers reproduced the identical figure to the digit.
Latency
2,768ms / 4,625ms p50/p95 on the fast tier, 5,075ms / 7,329ms p50/p95 on the deliberating tier — roughly double, not same-input drift, because the two tiers are different models
55 calls per tier
measured directly on both tiers.
Token totals
46,333 input tokens on both tiers (identical prompt); 18,889 output on the fast tier vs 20,345 on the deliberating tier, about 8 pct more
55 calls per tier
measured directly on both tiers.
HistoryRun history
2 recorded runs. A dash is a metric that run did not measure, and a dash is never differenced: not measured is a third state, neither a value nor a zero, and reading it as zero is how a board reports an improvement on a run that never looked.
Metric
r001-income-verify 2026-08-21
r002-income-verify 2026-08-21
extraction accuracy
1.000
1.000
refusal accuracy
1.000
1.000
invented values
0
0
values with a span
0.9724
0.9724
input tokens, whole run
46333
46333
model latency p50 ms
2768.00
5075.00
model latency p95 ms
4625.00
7329.00
output tokens, whole run
18889
20345
not a time series No two of these 2 runs measured the same system — they differ on the model — so nothing here may be differenced and the Verdict column is left off. Read this block DOWN a column, as a comparison between those runs, not along a row as a history.
DeviationsWhat deviated
0 breaches across 2 runs
The day a band breaks, a row renders here carrying the metric, the two runs, the band it crossed and what changed between them — model, prompt, chunker or top_k, read off the run records’ guards. A deviation with no diff beside it is an alarm nobody can act on.
RippleThe ripple map
Which figures move together, so one alarm reads as a system. Every edge carries its basis: measured names the run that showed it; reasoning admits nothing has varied it yet.
Lever
What moves
Basis
Evidence
which tier is called (fast vs deliberating)
output tokens (+8 pct) and latency (roughly +2x) move together; extraction accuracy, refusal accuracy, hallucinations and span rate do not move at all
the two bonus fields (ytd_bonus_pay, bonus_recurring) both resolve to a correct null together, and computed needs_review resolves to null rather than false -- a missing input is never treated as a zero
reasoning
src/extract.py::compute() only sets needs_review when ytd_bonus_pay is a number -- confirmed by reading the function; this run's corpus includes stubs with no bonus by construction (NO_BONUS_FRACTION=0.35 in tools/build_corpus.py) but no committed run isolates their scores separately.
FiresWhat fires when a band breaks
Where evals stop sitting beside the guardrail and start feeding it. Where the answer is nothing automatic, the row says so — hiding it would undo “What a guardrail is not” above.
Nothing fires yet. Not one of the 6 bands on this kit names a consequence, so there is no row to print. Which is the honest answer to the heading: a band that nothing is wired to is a number somebody has to notice, and this kit has only those. An empty table would have said the same thing while looking like a rendering failure.
NextThe three you would add first
Re-derive bonus_recurring from the Bonus History note by pure code, and compare it to the model's own answer before trusting the flagthe flag's only real dependency is a field this guardrail currently takes on faith -- src/segment.py already does word-boundary text matching for spannable fields, and a similar pattern check could flag a disagreement rather than silently trusting the model, though it would need to be stricter than the free keyword floor this kit already ships (see Eval.baseline) to add anything.
Cross-reference a second document (a W-2, an employer verification letter) before trusting a continuance determinationthe flag is computed from one stub's own Bonus History note alone today (see Architecture.breaks_at_scale); a real underwriting file usually corroborates income history against a second document, and nothing here does that.
Replace the flat 75% overtime continuance threshold and the flat $1,000 review threshold with a real loan program's published rulesboth are this kit's own declared policy, not a real program's guideline (see README/SOURCES.md) -- Data.breaks_on and could_not_verify both name this as unverified against anything real.
None of these is built here. They are named against the seam they sit on so they can be argued with.
CadenceWhen to re-run, and what it costs
Re-check the flag's evidence on any change to OT_CONTINUANCE_THRESHOLD or LARGE_BONUS_THRESHOLD_USD in src/extract.py, or to the bonus_recurring rule in src/prompt.py -- either changes what the flag is computed FROM. Re-run evals/run.py (paid) on any change to MAX_TOKENS or the provider/model.
What this cannot tell you
Whether the flag would still hold 100 pct recall and precision on a larger or harder set of ambiguous bonus notes -- this run's 12 ambiguous cases (of 31 stated bonuses) all resolved correctly on both tiers, but 12 cases is not enough to rule out a harder confusable phrasing this corpus did not think to plant.
Whether a crafted Bonus History note could move bonus_recurring without the flag ever noticing -- no red-team run exists for this kit, see Security.could_not_verify.
Whether the 75% overtime continuance threshold and the $1,000 review threshold match any real loan program's actual published rules -- they do not, by design; see README/SOURCES.md.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
In one lineNo framework, deliberately
No framework and no dependencies beyond the standard library -- requirements.txt is empty, with a comment explaining that the emptiness is load-bearing. The whole extraction decision is three files: src/segment.py, src/select.py and src/adapters/__init__.py.
The mappingSeam by seam, who owns what
Seam
File here
Framework equivalent
Note
the corpus
tools/build_corpus.py
none -- a seeded generator
55 pay stubs, generated from a fixed seed, never fetched. Gold is read back off the same generated YTD figures the document states, never carried over from a separate target -- evals/check_labels.py asserts stated/value consistency on every row before any run is allowed to spend; see data/SOURCES.md.
segmentation and selection
src/segment.py, src/select.py
text splitters / retrievers
a heading-based cut (src/segment.py) and a fixed field-to-heading map (SECTION_HINTS in src/select.py) -- no embeddings, no index, no ranking; a field absent from the map gets the whole document rather than nothing.
prompt assembly
src/prompt.py
prompt templates
the ten-field schema and the bonus_recurring rule are one declaration, and SYSTEM is built from it -- so the prompt can be published verbatim, which a template assembled two calls away cannot be.
the model
src/adapters/__init__.py
chat model wrappers / vendor SDKs
raw HTTP over urllib for every provider, so a forker runs this on whichever key they hold. This kit's own MAX_TOKENS=4000 (carried over from sibling kit docs-extract's own experience on a similarly-shaped record) is a plain constant, not a client-library setting.
evaluation
evals/judge.py
eval harnesses
per-field exact match plus a separately-scored review-flag confusion matrix is a loop and a handful of counters, not a platform.
spend control
src/budget.py
none
an append-only ledger written BEFORE each call, shared by every kit under one .env so the cap is on the KEY rather than per kit.
The seams are the ones this kit already publishes, so the mapping cannot drift from the code.
GraphsWhere LangGraph changes the answer
Nothing here is a graph. The pipeline has one path per stub -- segment, select, prompt, call, parse, compute -- with no branching and no state carried between stubs. A framework would add an orchestrator to a for-loop.
The other sideWhat a framework costs you
A different field schema (data/fields.json) or a different continuance rule needs its own gold set and its own evals/check_labels.py pass -- a framework's own schema layer would not remove that work, only relocate it.
SECTION_HINTS is a five-minute edit for a new stub layout because it is a plain dict, not a configured retriever -- a framework's own chunking/retrieval abstraction would need its own re-tuning pass instead, with its own failure modes to learn.
Swapping providers is one function and one entry in PROVIDERS (src/adapters/__init__.py) -- a framework's own model abstraction would add a dependency and a version to track for the same one-line change this file already gives away free.
What we could NOT verify
Whether a framework's own retrieval or agent abstraction would resolve anything this kit does not already handle was not tested -- this run found zero field-level or flag-level errors on either tier (see Business.not_good_enough), so there is no observed weakness here for a framework to address.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
In one lineWhat one run of this kit actually cost, in time and tokens
Measured on r001-income-verify on the fast tier, 2026-08-21. This kit records telemetry measured per run — 4 of the 6 readings on this axis, 4 of them with a band the guardrail board can judge against.
The readingWhat the last run measured
Reading
Last run
Band
What fires
Model, median
2,768 ms
2,768ms / 4,625ms p50/p95 on the fast tier, 5,075ms / 7,329ms p50/p95 on the deliberating tier — roughly double, not same-input drift, because the two tiers are different models
—
Model, p95
4,625 ms
2,768ms / 4,625ms p50/p95 on the fast tier, 5,075ms / 7,329ms p50/p95 on the deliberating tier — roughly double, not same-input drift, because the two tiers are different models
—
Input tokens
46,333
46,333 input tokens on both tiers (identical prompt); 18,889 output on the fast tier vs 20,345 on the deliberating tier, about 8 pct more
—
Output tokens
18,889
46,333 input tokens on both tiers (identical prompt); 18,889 output on the fast tier vs 20,345 on the deliberating tier, about 8 pct more
—
No movement column. Not one of the 1 earlier run on record is comparable with this one — a different model tier, or a changed guard — and differencing across that measures two systems rather than one. Said once here rather than as a dash on every row.
Retrieval not shown. No run of this kit has ever recorded a retrieval timing, because the pipeline has no such stage. Those readings are left out rather than dashed: a dash says “this run did not measure it”, which promises a later run could.
DriftMedian call, run over run
r001-income-verify2,768 ms
r002-income-verify5,075 ms
Hatched bars are runs that are not comparable with the latest — a different model tier or a changed guard. They are drawn because hiding them would make the history look shorter than it is, and greyed because differencing across them would be measuring two systems.
The other sideWhat this does not tell you
What we could NOT verify
No stage-by-stage span tree. These are whole-call timings; which part of the pipeline spent the time is not recorded by this kit's harness.
Latency is a run-level median and p95. The spread between the fastest and slowest single call is not stored, so the distribution cannot be drawn.
No earlier run is comparable to this one (a different model tier or a changed guard), so nothing on this page is a trend yet.
One machine, one network, one region. Latency includes the provider round trip from a single location and will not transfer to yours.
The first of those is the one worth doing something about, and it is a solved problem: instrumenting a pipeline so each step reports its own duration is a couple of lines. Observability / tracing has the code, and what the result looks like once it is running.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
In one lineWhat you provision, honestly
Everything measured on this page says where it was measured; everything not measured says that — the same contract as the other thirteen pages. Where a retrieval index would be on other kits, this one has: no index — each document goes whole into one call.
The machineWhat this needs
Dependencies
nothing beyond the standard library — requirements.txt names no package
Configuration
7 environment variables — the full knob table is at the bottom of this page
Last verified run
2026-08-21, across 2 committed records
Enumerated from the kit’s own source by build/facts/envscan.py, committed, and drift-checked — never typed into this page.
Your dataWhere everything sits
Artifact
Where
Leaves your machine?
pay stubs
data/corpus/*.txt — 55 stubs, generated once from a fixed seed (SEED = 20260821) by tools/build_corpus.py
read whole by src/segment.py and src/select.py; never modified after generation
gold labels
data/gold.jsonl — 55 rows, read back off the same generated YTD figures the document states (never a target that seeded them), checked against the document text by tools/build_corpus.py's own _verify() pass
never — evals/judge.py is pure code, no model, no key
the field schema
data/fields.json — the ten-field record src/prompt.py assembles the user message from
read by src/prompt.py and src/extract.py only
the key
.env — never committed (see .gitignore)
only inside the Authorization header, to the configured BASE_URL (src/adapters/__init__.py)
The wireWhat crosses it, and when
Runtime call site
Destination
src/adapters/__init__.py line 55
the configured BASE_URL
Build-time (corpus tooling, run once)
Destination
none — this kit’s corpus is generated locally
Zero-egress topology: point BASE_URL at a local OpenAI-compatible server and nothing leaves the machine — statically true of the shipped adapter, whose only credential travels in the Authorization header.
The third state
What the provider retains, trains on or logs once a request arrives is not measured here — it is provider-dependent, and this page does not assert what no run of ours can verify.
The shapeHow it ships, and what you add
The key
Read from the shared .env or the real environment only, never written into the repo, never requested from a reader on any surface. src/app.py's /api/extract handler strips api_key and base_url out of any exception message before it reaches the browser, so a misconfigured key cannot leak into a UI error.
You add
your reverse proxy and your identity in front of one process — the kit deliberately ships neither, because identity belongs to your estate, not to a kit
Never ships
Docker, Helm, a queue, a database. The product is a folder of readable Python; what to run it under is this page’s job to state, not the kit’s job to impose
The ladderEach decision, and what you provision past its ceiling
Decision
The kit ships
Measured here
Past the ceiling
What stops being valid
model
one call per STUB, carrying the selected sections plus the ten-field schema, behind src/adapters/__init__.py — OpenAI-compatible wire format over raw HTTP, so a forker runs this on whichever key they hold. MAX_TOKENS is fixed at 4000 (src/extract.py), set on sibling kit docs-extract's own experience with a similarly-shaped JSON record rather than a ceiling this kit has ever hit — 0 of 55 calls truncated on either tier.
2,768ms p50 / 4,625ms p95 on the fast tier, 5,075ms p50 / 7,329ms p95 on the deliberating tier (the fast-tier and deliberating-tier runs, 2026-08-21 -- see Cost.cost_by_model)
one call per stub, no concurrency and nothing shared between calls — see Architecture.breaks_at_scale. A stack of thousands needs batching and a rate-limit strategy this kit does not have; MAX_CALLS_PER_DAY in src/budget.py caps the shared key across every kit on this machine, not this kit's own throughput.
point src/adapters/__init__.py at a different provider or model and every published accuracy/cost/latency figure is void until re-run — this run's numbers are this model's numbers, not a property of the prompt.
corpus refresh
tools/build_corpus.py regenerates the whole corpus — 55 pay stubs across a fixed roster of names and employers — byte-identically from a fixed seed (SEED = 20260821) every time it is run. There is no incremental refresh; gold is derived from the same generated YTD figures the document states (never a target that seeded them) and the script's own _verify() pass checks every stub's stated dollar figures appear verbatim in the document text before anything is scored.
0.038s wall time to regenerate all 55 stubs and their gold labels (measured directly, 2026-08-21 (python3 tools/build_corpus.py, timed) — see Data.index for the separate segmentation figure, a different step)
a real deployment's stub layout, employer roster and bonus-note vocabulary do not come from a fixed seed and grow without bound — how a genuinely varied set of real-world pay-stub templates would change what src/segment.py (heading-based) and src/select.py (SECTION_HINTS) can resolve was not measured; see Architecture.breaks_at_scale and Data.breaks_on.
point tools/build_corpus.py at your own stub layout and employer roster, and every published accuracy figure is void — they are this corpus's own planted ambiguity, not a property of the model.
labels
evals/check_labels.py asserts gold/document consistency (one gold row per document and vice versa, every enum value allowed by the schema, and stated agreeing with whether each optional overtime/bonus field is null) before evals/run.py is allowed to spend anything. Scoring (evals/judge.py) is per-(stub,field) exact match with light normalisation, plus a separately-scored review-flag confusion matrix computed from the model's own extracted fields by pure code (src/extract.py::compute), never from a second model call.
448 of 550 possible (stub,field) cells actually scored (55 stubs x 10 fields; a null field on a no-overtime or no-bonus stub is a correct abstention, not a cell to score) plus 9 stubs carrying a review-flag verdict, scored separately (lenses.Eval.dataset, the fast-tier and deliberating-tier runs, 2026-08-21)
the gold set stops at 55 stubs and covers one planted ambiguity (a bonus note that sounds recurring vs. one that states an actual payment history) at a fixed 40 pct rate — a real portfolio's mix of ambiguous phrasing is unmeasured, and a second corroborating document is never cross-referenced; see Data.breaks_on.
a different field schema (data/fields.json) or a different continuance rule needs its own gold set and its own evals/check_labels.py pass before any published figure can be trusted again.
Every threshold is a measurement with its provenance beside it, or says is_measured:false. A ceiling with no seam says so — it is the point the kit is outgrown, never a forced join.
When it failsFailure signatures
What you see
What it is
First move
bonus_recurring answered 'no' on a Bonus History note that contains the word 'annual' or 'recurring'
the model read for a STATED payment history rather than pattern-matching the label — this is the corpus's planted ambiguity (AMBIGUOUS_FRACTION=0.40 in tools/build_corpus.py), and on this run both tiers got every one of these cases right (see Eval.taxonomy)
read the stub's own Bonus History line before assuming a 'no' next to the word 'annual' is a mistake — the prompt's own rule (see README) is that the label alone is never history, and this run found zero cases where either tier applied the keyword shortcut instead of the stated rule (the fast-tier and deliberating-tier result files, both runs, 2026-08-21 — see Eval.taxonomy (the keyword-only-continuance entry) and Eval.baseline for the same pattern's effect on the free keyword floor)
No machine symptom — this failure leaves no trace in any output.
no path in src/extract.py::compute() or src/app.py writes an approval, denial or posting of any kind — both qualifying_monthly_income and needs_review are returned to the caller as fields on the response record and nothing downstream of this kit acts on them. A flipped flag on a real deployment would show up only in whatever underwriting system consumes this kit's output, which this kit does not have and does not simulate — so there is no committed artifact naming that failure, on purpose: it is out of this kit's boundary, not unmeasured.
Whether a 55-stub, single-seed run's zero-error result generalises to a harder ambiguous phrasing this corpus did not plant, or to a larger sample size, was not tested — see Eval.could_not_verify. Concurrency (every run in this series is one call at a time, sequential), the 75 pct overtime continuance threshold and the $1,000 review threshold against any real loan program's actual published rules, and how either tier performs on a real, messy pay-stub layout (multi-column PDFs, payroll-provider-specific formatting, scanned images with no OCR step) are all unmeasured — see Eval.could_not_verify and Data.breaks_on for the full list.
The corpus licence, from the Data lens: MIT — this repository's own licence. Every employee, employer and dollar figure is invented; a real pay stub cannot be published at all — it is one of the most sensitive documents a person holds. Your corpus’s licence is yours to verify, and the labels you write are about your documents.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
In one linePer-field exact match, light normalisation
Does the model's value for each field match gold, after trimming whitespace/punctuation and treating numbers within half a cent as equal?
$0.00per 1,000 pay stubs
nodata leaves your network
yessame answer every time
MethodHow the test was run
evals/judge.py::score, in-process, no key and no model. The same function evals/baseline.py and evals/run.py both call -- a baseline and a real run scored by two different scorers cannot be compared honestly.
Every grader on these pages scored the same 110 already-recorded answers. Nothing was re-generated, so this compares rulers and not models.
The inputOne real row, seen by every grader
doc
IV-0001
field
bonus_recurring
ytd bonus pay
3433.34
bonus recurring model
no
gold bonus recurring
no
needs review
yes
qualifying monthly income
4819.75
Grader
Verdict
Why
Per-field exact match, light normalisation
correct
IV-0001: a $3,433.34 bonus described as "Discretionary spot bonus, single payment, no history of recurrence." Gold: bonus_recurring=no, needs_review=true. Both tiers answered bonus_recurring=no and the run's own pure code then computed needs_review=true and a $4,819.75 qualifying monthly income that excludes the bonus, correctly routing it for underwriter review.
Review-flag confusion matrix
correct
IV-0001: gold needs_review=true (the $3,433.34 bonus is excluded because bonus_recurring=no, and it is over the $1,000 threshold). Both models' own extracted bonus_recurring=no fed src/extract.py::compute(), which correctly computed needs_review=true on both tiers -- flagged for underwriter review as it should be.
The formulaWhat it computes
The analysisWhat it actually did
Model
Result
the fast tier
scored 100.0%
the deliberating tier
scored 100.0%
In operationWhat to monitor
Reference standard: tools/build_corpus.py's gold, read back off the same generated YTD figures the document states (never a target that seeded them); evals/check_labels.py asserts stated/value consistency on every row before any run is allowed to spend.
These rates are UNKNOWN, on purpose
This grader IS the reference standard for field values -- it cannot be scored against itself. What can go wrong is the corpus's own generation logic, which tools/build_corpus.py's own verification pass (_verify()) checks by confirming every stub's stated dollar figures appear verbatim in the document text.
Watch these
extraction_accuracy specifically on the bonus_recurring field, since that is the one field this corpus is built to test -- see taxonomy
the 448-of-448 clean-run rate, since a drop anywhere would mean something in the prompt or the corpus changed
stated vs scored cells -- 448 of 550 possible cells were stated; the rest are correct nulls on no-overtime/no-bonus stubs, not misses
Alarm on
Any drop in extraction_accuracy below the measured 100 pct, on any field -- this run's clean result is the baseline, and any regression means the prompt, the corpus, or the provider changed.
How tight can the band be? There is no tolerance band on the field grade itself -- it is exact match after trimming whitespace/punctuation and treating numbers within half a cent as equal, never a continuous score to round.
Cadence: Re-score on any change to src/prompt.py, data/fields.json or tools/build_corpus.py -- the first two change what is asked, the third changes what is asked about. Re-run evals/run.py (paid) on any change to MAX_TOKENS or the provider/model.
The decisionWhen to reach for it
Use it
Gold is derived from the same generated YTD figures the document states, never from a separate target -- true of every kit corpus, never true of a real underwriting team's own pay-stub history.
Do not use it
The true field values are not known in advance -- the normal state of a real income-verification review, and the reason this corpus is generated rather than captured.
Check a mortgage borrower's pay stub for qualifying income
PresenterOpens the private repo. Visible to admins only.
In one lineReview-flag confusion matrix
Does the run's own pure-code needs_review (computed from what the model extracted) match the same computation run over gold's own true values?
$0.00per 1,000 pay stubs
nodata leaves your network
yessame answer every time
MethodHow the test was run
evals/judge.py::score_flags, in-process, no key and no model. Computed from the run's own pure-code needs_review (src/extract.py::compute), never from a second model call -- the model never sees or states the flag directly.
Every grader on these pages scored the same 110 already-recorded answers. Nothing was re-generated, so this compares rulers and not models.
The inputOne real row, seen by every grader
doc
IV-0001
field
bonus_recurring
ytd bonus pay
3433.34
bonus recurring model
no
gold bonus recurring
no
needs review
yes
qualifying monthly income
4819.75
Grader
Verdict
Why
Per-field exact match, light normalisation
correct
IV-0001: a $3,433.34 bonus described as "Discretionary spot bonus, single payment, no history of recurrence." Gold: bonus_recurring=no, needs_review=true. Both tiers answered bonus_recurring=no and the run's own pure code then computed needs_review=true and a $4,819.75 qualifying monthly income that excludes the bonus, correctly routing it for underwriter review.
Review-flag confusion matrix
correct
IV-0001: gold needs_review=true (the $3,433.34 bonus is excluded because bonus_recurring=no, and it is over the $1,000 threshold). Both models' own extracted bonus_recurring=no fed src/extract.py::compute(), which correctly computed needs_review=true on both tiers -- flagged for underwriter review as it should be.
The formulaWhat it computes
The analysisWhat it actually did
Model
Result
the fast tier
scored 100.0%
the deliberating tier
scored 100.0%
In operationWhat to monitor
Reference standard: tools/build_corpus.py's gold needs_review, computed the identical way src/extract.py::compute() computes it -- from the same generated YTD figures the document states, using OT_CONTINUANCE_THRESHOLD=0.75 and LARGE_BONUS_THRESHOLD_USD=1000.0.
These rates are UNKNOWN, on purpose
This grader is scored against a mechanically-derived gold value (src/extract.py::compute(), the same pure-code path both the run and the gold set use), not against a second grader's judgement -- there is nothing here to publish an agreement rate against. What can go wrong is the corpus's own threshold placement, which tools/build_corpus.py's own verification pass checks against the same generated YTD figures.
Watch these
review-flag recall specifically -- 9 stubs should be flagged in this corpus, and missing one routes an excluded bonus past underwriter review
false positives among the 46 stubs that should NOT be flagged, since a false positive costs a reviewer's time rather than a missed risk
whether a field-level miss (see the other grader) ever changes the flag -- it has not, on either tier, this run, because there were no field-level misses to begin with
Alarm on
Any review-flag false negative, on any run -- a missed flag is the safety-critical failure this kit exists to catch, and recall was 100 pct on both tiers this run.
How tight can the band be? There is no tolerance band -- the flag is a binary confusion matrix (flagged/not flagged against gold), never a continuous quantity to round.
Cadence: Re-score on any change to OT_CONTINUANCE_THRESHOLD or LARGE_BONUS_THRESHOLD_USD in src/extract.py or tools/build_corpus.py, or to data/fields.json's bonus/overtime fields. Re-run evals/run.py (paid) on any change to MAX_TOKENS or the provider/model.
The decisionWhen to reach for it
Use it
Gold's needs_review is computed the identical way from the same generated YTD figures the document states (OT_CONTINUANCE_THRESHOLD and LARGE_BONUS_THRESHOLD_USD in tools/build_corpus.py, matching src/extract.py's own copy) -- true of every kit corpus, never true of a real loan program's own published threshold.
Do not use it
The true continuance determination is not known in advance, and a real program's own threshold has not been checked against this kit's flat $1,000 / 75 pct figures -- see Eval.could_not_verify.
A living map of modern AI — kept current every morning