Skip to main content

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 run asks the question of every row and stores each answer under its exact input, so a re-run costs nothing.
  • hunch test measures accuracy against gold, an answer key or your own reviews, as a range, not a single number.
  • hunch diff shows which rows a change to the question would flip, before you ship it.
  • hunch review shows you the rows worth reading, and your verdicts become gold.

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 .

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

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.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hunch-ai 0.1.0
File Size Uploaded
hunch_ai-0.1.0.tar.gz 69.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hunch-ai 0.1.0
File Interpreter ABI Platform
hunch_ai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 142.5 kB

Release files / hunch_ai-0.1.0.tar.gz

Download URL hunch_ai-0.1.0.tar.gz
Size 69.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5a5131b58eb43868f9a4d68cc6ef6c8b74d9dae1882aa547ae70cb0e6f1b0d9f
BLAKE2b-256 checksum
How to use checksums
db35b49671218044f0149623844b05822a62a86bf364354ae4da55bd52eb63be
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

Release files / hunch_ai-0.1.0-py3-none-any.whl

Download URL hunch_ai-0.1.0-py3-none-any.whl
Size 73.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a0e51f97453c6576db88761942ba36aef9c0e76c9e3a670ceaceeadd5ad4546
BLAKE2b-256 checksum
How to use checksums
8f745c5b64fa109dd3218fbeb86d6cc30bf1f6e500d23d4a20cf0f13c84bc553
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

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page