Skip to main content

hone-select

CI License: Apache-2.0 Python 3.11 | 3.12 | 3.13

Generate, score and select the best of N candidates with pluggable code or prompt scorers.

Part of honeworks: small, standalone tools for reliable generative-AI workflows. Works on its own; works better with its siblings.

Why

Generative models are cheap to sample and unreliable one sample at a time. "Generate a few, keep the best" works, but done by hand it turns into ad-hoc loops: an LLM judge that silently returns 0 when it fails, expensive judges run on candidates a regex could have rejected, ties broken by list order, and no way to say later why a candidate won.

You write a generator and a few scorers as plain functions (or ask an LLM judge, or run a script); hone-select generates candidates, drops the ones that fail your gates, scores the rest in cheap-first stages, picks a winner by policy, and records every decision so you can explain it later.

Install

pip install hone-select              # or: uv add hone-select
Extra Adds Install
(none) engine, plain-function and command scorers, SQLite records pip install hone-select
openai LLM judges and text generation via the OpenAI SDK (also Ollama's /v1 endpoint and other compatible servers) pip install "hone-select[openai]"
langchain LLM judges via any LangChain chat model pip install "hone-select[langchain]"
models judges from hone-models by registry id (client = "hone_models:decision") pip install "hone-select[models]"
cli the hone-select command (run, explain) pip install "hone-select[cli]"

Python 3.11 or newer. The core depends only on pydantic; no extra pulls in torch or a GPU stack.

Quickstart

from hone_select import Engine, gate, generator, scorer


@generator()
def write(task, v):
    return f"{task} #{v['index']}" * (v["index"] + 1)


@gate()
def not_too_long(c):
    return len(c.data) < 80


@scorer(cost=1)
def shorter_is_better(c):
    return 1 - len(c.data) / 100


engine = Engine(
    """
[generate]
n = 5
[score]
gates = ["not_too_long"]
cascade = [{ scorers = ["shorter_is_better"] }]
[select]
policy = "argmax"
""",
    registry=[write, not_too_long, shorter_is_better],
)

result = engine.run("hello")
print(result.winner.candidate.data, result.winner.total)  # hello #0 0.92
print(engine.explain(result))

Runs offline in well under a second; the same program is examples/quickstart.py. A scorer returns a value in 0..1 (higher is better), a Score, or None for "could not score". A scorer that raises gives Score(None, error=...) and the run goes on: a failure is never a silent 0.

What you get

  • Gates and cascades: cheap checks reject early; expensive scorers (keep_top) only see finalists.
  • Prompt judges: PromptScorer, PromptGate, PromptPairwise over any DecisionClient; pairwise judgements always run in both orders and count only when they agree.
  • Command scorers: any executable, JSON on stdin and stdout.
  • Policies: argmax, first_above (stop generating once good enough), pairwise_tournament; ties and low confidence escalate to a pairwise judge; fallbacks when everything is rejected.
  • Budgets, score cache, dedup, determinism: cost / time / money caps, cached scores keyed by scorer version, exact or embedding dedup, seeded variation schedules.
  • Records: every step is a span in .hone/select/spans.db; hone-select explain <run_id> rebuilds the decision from the store alone.
  • Experiments: declare a comparison of models, parameters, prompts or programs over test cases in experiments/E0001-.../experiment.toml; hone-select experiments plan shows every run and an estimate, a person approves it (CLI or dashboard), start runs and resumes it, and the results say which setup, model, parameter or prompt wins, against a baseline, with intervals. The subject can be a prompt, your Python function or any command. Run conditions keep a busy machine out of the numbers: the run waits for free CPU, RAM and VRAM, unloads models it does not need, holds the GPU lock and marks every sample. Image, music and video models are a generate subject: each model can be asked its own way, and cases a model cannot do (by its hone-models guide) are listed in the plan and not run, not counted as failures. A person can rate outputs or pick the better of two (A/B), blind to the setup, in the dashboard; A/B results give a win rate with its interval per pair of setups.
  • Dashboard: hone-select dashboard serves a local web page over the store and the experiments: filterable runs, each run's configuration, task and candidate table (variation params, gates, scores, winner, reasons), and candidates across runs compared by any variation param.

Use it with the rest of honeworks

hone-select depends on no other honeworks package. The links are ports (hone_select.ports) and shared records:

  • hone-models provides judges: [judges.local] client = "hone_models:decision" in your config, or Engine(..., judges={"local": hone_models.decision("qwen2.5vl-7b")}) (hone-select[models]).
  • hone-taste audience panels plug in as scorers (any callable returning a Score-like object).
  • hone-flow runs a selection as a step; pass its trace context with engine.run(task, trace=...).
  • hone-lens reads the span store (hone.select.* spans in the shared honeworks span format) for analysis and replay.

Documentation

  • Concepts: the pipeline, scores and None, aggregation, selection, budgets
  • Configuration: every selection.toml key
  • Scorers: code, prompt, command and pairwise scorers
  • Bring your own client: OpenAI, Ollama, LangChain, hone-models, your own
  • Records and the CLI: the span store, trace context, explain, the dashboard
  • Experiments: define, plan, approve, run and read a comparison of setups; subjects that are prompts, code, programs or generation models
  • Examples: one runnable, explained example per concept (What / How / Why), each executed by the test suite; the patterns to copy
  • Design: why the package exists, the current design with its guarantees, and every design change
  • Contributing: setup, quality gates and conventions

Status

Alpha, version 0.1.0. The public API (hone_select.__all__), the config format and the span format are described in design/current.md and covered by acceptance tests, but may still change before 1.0; every change is recorded in the changelog. Issues and pull requests are welcome.

How this was built

hone-select was specified by a human and built by AI coding agents (Claude) working against written specifications and acceptance tests; a human reviewed the decisions they made, and commits written with AI carry a Co-Authored-By line. Every design change, with what was found, what was decided and why, is in design/changes/; the smaller implementation choices, including those still awaiting the owner's review, are in design/decisions.md.

License

Apache-2.0 (LICENSE). Copyright 2026 Bahman Shadmehr. Dependencies and their licences: THIRD_PARTY_NOTICES.md.

Metadata

Release files for hone-select 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 hone-select 0.1.0
File Size Uploaded Provenance Actions
hone_select-0.1.0.tar.gz 275.6 kB With provenance Details for hone_select-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hone-select 0.1.0
File Interpreter ABI Platform Actions
hone_select-0.1.0-py3-none-any.whl Python 3 none any Details for hone_select-0.1.0-py3-none-any.whl

Total release size: 435.7 kB

Release files / hone_select-0.1.0.tar.gz

Download URL hone_select-0.1.0.tar.gz
Size 275.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9a4eea93709d36ea811b8efc1b15c5a88f5ce998bd2aa19eb0b5a5d42f6a0af0
BLAKE2b-256 checksum
How to use checksums
8a5eef6d19ee78aeaaa874fcf2eeeba7c6b43c30606bf92f850de961e98e10f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

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

Download URL hone_select-0.1.0-py3-none-any.whl
Size 160.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94c7d691ee86194f44256ced74119b0957e6c15cac486941764d052ebecb3018
BLAKE2b-256 checksum
How to use checksums
a5973a1ac91dd70ccc641e17402507784fba13e6107e4db764458f38938dbb3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

Security for hone-select 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hone_select-0.1.0.tar.gz

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 Dec 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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