hunch
Your code asks a model small questions all day. Which team should get this ticket? Did the agent's fix work? Is this shell command safe to run? hunch writes each question down as a spec, a short YAML file in git, and tells you how often the answers are right.
hunch runasks the question of every row and stores each answer under its exact input, so a re-run costs nothing.hunch testmeasures accuracy against gold, an answer key or your own reviews, as a range, not a single number.hunch diffshows which rows a change to the question would flip, before you ship it.hunch reviewshows you the rows worth reading, and your verdicts become gold.hunch docswrites a page anyone can read and search: what each judgment decides, how well it was measured, and what depends on it.
If you know dbt, the idea will feel familiar: dbt did this for SQL; hunch does it for model judgments.
Install
uv tool install hunch-ai # or: pip install hunch-ai
The package is hunch-ai; the command and the import are hunch. Python 3.12 or later.
Try it
export TYPESAFE_API_KEY=... # the recipe's engine is TypeSafe's Jev
hunch init tickets my-tickets # a spec, 40 sample tickets and a README
cd my-tickets
hunch compile . # the exact request and its cost; nothing is sent
hunch run . --max-cost 0.01 # about $0.001
hunch test .
Working with a coding agent? hunch skill teaches Claude Code, Codex or Cursor the same loop.
A spec looks like this:
judgment: ticket_triage
model: jev-1.13.0
source: tickets.csv
key: id
state: [subject, body] # the columns the model sees
questions:
department:
type: choice
instructions: Which team should handle this support ticket?
criteria:
billing: Problems with money already charged or owed
technical: Something is broken, slow, or misbehaving
sales: Buying more or buying differently
act: 0.80 # below this confidence, a person reviews it
gold: gold_department # the answer key, if you have one
tests:
department: {min_accuracy: 0.90}
Engines: TypeSafe's Jev, or any LLM read through its answer-token probabilities (deepseek:…, openrouter:…). Sources: CSV, coding-agent traces (Claude Code, Cursor, OpenCode, OpenTelemetry), or a Python function.
Docs
- Introduction and quickstart
- Cookbooks: real problems with their measured results, including what did not work
- Spec reference
- Design notes, for working on hunch
Status
v0.1. hunch has run on public datasets, real coding-agent sessions and a 100,000-row test, but no one outside the project has used it yet. Expect the spec format to change before 1.0.
License
Apache 2.0, except server/, which is under the Elastic License 2.0. Third-party data used by the examples is listed in NOTICE.
Release files for hunch-ai 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hunch_ai-0.2.0.tar.gz | 97.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hunch_ai-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 200.0 kB
Release files / hunch_ai-0.2.0.tar.gz
| Download URL | hunch_ai-0.2.0.tar.gz |
|---|---|
| Size | 97.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f9e514030f88fe09c3e891f0a2054f5bf8ccc2b7ba65f6711765c88a7eb9862
|
|
BLAKE2b-256 checksum How to use checksums |
333459b29074409a922ba37f1678fd213de321665bdd7b07be0690bcb9eabe49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / hunch_ai-0.2.0-py3-none-any.whl
| Download URL | hunch_ai-0.2.0-py3-none-any.whl |
|---|---|
| Size | 102.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c0810b9b86f508180850d898e1f27232f05102e71dbef5e60943f754aa91b0fe
|
|
BLAKE2b-256 checksum How to use checksums |
e0d8db9998d638f20a4be6dbfa0ea500fdb5a44be405dbf12f0213ddab785b55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log