shipwithjev

Catalog / Triage & routing

0329GitHub

tax-doc-classifier

Classifies text-bearing PDF pages into IRS form and page-kind candidates with a confidence gate; document triage, not tax advice, and scanned pages need OCR.

kyotofin/tax-doc-classifierREADME ↗
# tax-doc-classifier

A tax document classifier built with Jev.

We ingest thousands of tax documents using an LLM pipeline built last tax season. Jev classifies 100% of our tax document corpus at $0.001 per page — 34× cheaper and 6× faster than that LLM setup. This is the classifier, open sourced.

One request per page. The page's text goes to [Jev](https://docs.typesafe.ai), TypeSafe's decision model, which returns a probability over 261 IRS forms and 7 page kinds instead of text. No model is trained and nothing is hosted: the classifier is a JSON file describing each form, generated from the IRS's own PDFs.

```ts
import { classifyPage, jevBackend, pdfPageLines } from 'tax-doc-classifier'
import criteria from 'tax-doc-classifier/data/criteria.json' with { type: 'json' }

const lines = await pdfPageLines('return.pdf', 3)
const r = await classifyPage(lines, { backend: jevBackend(), criteria })
// r.form            'form-1040-schedule-a'
// r.kind            'form_page'
// r.formConfidence  0.99
// r.gated           true   (formConfidence >= 0.95)
```

No model is trained and nothing is hosted. The classifier is a JSON file of form descriptions (`data/criteria.json`) and a decision model that reads a page and picks from them. The decision model is [TypeSafe Jev](https://docs.typesafe.ai), a System One model that returns a probability over options instead of text.

## Setup

1. **Node 20+ and pnpm.**
2. **poppler** — provides `pdftotext` and `pdfinfo`, used to read PDF pages. Only `classifyPage` on lines of text works without it.
   - macOS: `brew install poppler`
   - Debian/Ubuntu: `apt install poppler-utils`
3. **A TypeSafe API key.** Get one at [typesafe.ai](https://typesafe.ai), then:
   ```
   export TYPESAFE_API_KEY=…
   ```
   or put it in a `.env` file (git-igno

Also filed under Triage & routing

  1. 0613

    momus: staged Rust code and security review

    A fast scanner that reviews code for correctness, security, reliability, compatibility and test gaps, with actionable feedback. Supports the Jev API and local models.

    Brian Luby · Triage & routing

  2. 0602

    Jevops: SRE log triage with Jev

    Jev triages streaming logs into page, digest or resolve, cutting alert noise and paging humans only for high-confidence incidents. About $1–3 for 1M events a month.

    Mu99Ti · Triage & routing · $1–3 per 1M events/month

  3. 0598

    jev-sec-audit: flag risky npm packages with Jev

    npm install is the scariest command in your terminal. One typo → lookalike package → malicious postinstall → secrets gone. jev-sec-audit flags it in milliseconds using Jev, a System 1 model built for fast decisions, not chat. One step in GitHub Actions. Open source.

    @Dhanush_Nehru · Triage & routing

  4. 0555

    Jev Codex Router: model and reasoning selection per call

    A local Codex router asks Jev to choose the next model and reasoning effort while forwarding the complete conversation to that model.

    0xNatoshi · Triage & routing