Skip to main content

hone-flow

CI License: Apache-2.0 Python 3.11+

Run AI workflows of plain-function steps as self-contained run folders, with resume, fork, partial runs and human gates.

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

Why

Generative-AI pipelines are slow, costly and only partly deterministic: a model call fails on item 37 of 50, a prompt changes after a review, a person has to approve a draft before the next step spends GPU time on it. Scripts and notebooks lose that state; orchestration platforms bring services to run and maintain. hone-flow sits in between: a library that keeps everything in plain run folders.

You write each step as a plain typed Python function. hone-flow wires the steps together from their parameter names and runs them over a list of items (songs, documents, products). Every run is a folder, local or on S3, that you can open and understand on its own: what each step received and produced, which code and settings produced it, how long it took, what a person decided, and what failed. A crashed or failed run is resumed where it stopped; a finished run is forked to rerun only what changed. There is no server, scheduler or database: a library and a command line.

Install

pip install hone-flow          # or: uv add hone-flow

The core needs only pydantic. Optional extras:

Extra Adds Pulls in
cli the hone-flow command typer
s3 run folders on S3 or any fsspec filesystem fsspec, s3fs
metrics CPU, memory and disk measurements psutil
gpu GPU memory and utilization measurements nvidia-ml-py

pip install "hone-flow[cli,s3,metrics]" installs several at once. Python 3.11 or newer.

Quickstart

import tempfile

import hone_flow as fk

wf = fk.Workflow("hello", storage=tempfile.mkdtemp())


@wf.step()
def words(text: str) -> list[str]:  # `text` is an item input
    return text.split()


@wf.step()
def shout(words: list[str], mark: fk.Param[str]) -> str:  # `words` is the output of step `words`
    return " ".join(w.upper() for w in words) + mark


run = wf.run(
    [fk.Item("a", {"text": "hello world"}), fk.Item("b", {"text": "good night"})], params={"mark": "!"}
)
print(run.status, run.output("shout", "a"))
print("run folder:", run.location)
assert run.status == "completed"
assert run.output("shout", "b") == "GOOD NIGHT!"
assert shout(["plain", "call"], "?") == "PLAIN CALL?"  # still a normal function

This is examples/quickstart.py. A parameter named after another step receives that step's output; any other name is an item input; fk.Param[...] marks a run-level setting.

A run folder

<storage>/hello/
  runs/20260927T140311Z-3f9a1c/
    manifest.json            the run: items, params, steps, state of every step, calls
    spans.jsonl              what happened, as OpenTelemetry-shaped spans
    reports/                 timing.json  output_sizes.json  summary.md
    words/item_a/            metadata.json  inputs/text.json  output/words.json
    words/item_b/            ...
    shout/item_a/            metadata.json  inputs/words.json  output/shout.json
    shout/item_b/            ...
  pinned_runs/               verified copies of runs you want to keep

metadata.json is written last, so a step folder that has one is complete. The JSON files are a public, versioned format (docs/run-format.md); read them with any tool. More: run folders.

Main ideas

  • Resume: run.resume() continues the same run after a failure, a crash or a partial call, and runs only the work left. It refuses (IncompatibleRun) when a step with work left changed its version. Resume and fork.
  • Fork: run.fork(refresh=("shotlist",)) makes a new run beside the old one, reruns that step and its downstream and copies the rest. Without refresh it finds what changed (versions, source, params, input files) and explains every rerun; dry_run=True shows the plan. Resume and fork.
  • Partial runs: wf.run(items, until="step", items_filter=["01"]) runs part of the work now; the run is partial until you resume it. Resume and fork.
  • Gates: @wf.gate() pauses each item for a person, who approves, edits or rejects with a note that the producing step receives as review_note (with its rejected output as previous). Gates.
  • Across items: @wf.final_step() combines every item's result (a workbook from all lessons), a global step returning fk.Items makes the items (chapters of an outline) and @wf.select_step() chooses mid-run which items continue. Steps across items.
  • Progress and labels: on_event= and INFO logs follow a long run while it runs; label= names a run for people. Concepts, Read API.
  • Notifications: Slack, Mattermost, Discord or any HTTP endpoint hears when a run completes, fails or waits for review; an outage never fails a run. Notifications.
  • Measurements: timing and output sizes by default, CPU, memory, disk and GPU on request, in each step's metadata and in reports/. Measurements.
  • Storage: a local folder, s3://bucket/prefix, any fsspec URL, or your own RunStorage. Storage.
  • Records: spans in each run's spans.jsonl, in one trace with the packages your steps call. Records.
  • CLI: hone-flow run / resume / fork / status / show / runs / label / approve / edit / reject / pin / cleanup / notify-retry, each with --json. CLI.
  • Read API: fk.open_runs(storage, name) lists and opens runs without the workflow's code. Read API.

Use with the rest of honeworks

hone-flow needs no other honeworks package. When you have them:

  • Trace context. A step passes ctx.current_trace() to the packages it calls (client.complete(..., trace=ctx.current_trace()) with hone-models, a selection with hone-select), so their spans join the run's trace under the step's span. Records.
  • GPU scheduling. fk.Workflow(..., gpu="hone_models") uses hone-models' GpuLease through the hone.gpu_leases entry point, so workflow steps and model calls share one GPU plan. Adapters.
  • hone-lens reads runs through fk.open_runs and the run format, and reruns a step as a fork. Read API.

Documentation

  • docs/: concepts, one page per feature, the CLI, adapters, the run format.
  • examples/: 27 small runnable scripts, one per concept, in reading order.

Design and contributing

How this was built

hone-flow 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.

Status

Alpha, version 0.1.0. The run-folder format is versioned (format_version "1") and documented; the Python API may still change between minor versions before 1.0. Changes are listed in CHANGELOG.md. Bug reports and ideas are welcome in the issues.

License

Apache-2.0. Copyright 2026 Bahman Shadmehr.

Metadata

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

Built distribution (wheel)

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

Total release size: 382.3 kB

Release files / hone_flow-0.1.0.tar.gz

Download URL hone_flow-0.1.0.tar.gz
Size 280.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c440fc6cba905a5c9bf063d707c50c17956e8753644f856da67911179a262bd2
BLAKE2b-256 checksum
How to use checksums
9e48373d739e4b591ccded2986e189ee03b1fa4f2062955262a4b728b5ec548c
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 2, 2026.

Transparency log

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

Download URL hone_flow-0.1.0-py3-none-any.whl
Size 101.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4826624824eb6b1342bf4102663bd9ad711396365f39baa6ddcb905635f6577a
BLAKE2b-256 checksum
How to use checksums
4cb0b94cdfbd9b0e73254b55787de13997f539dc4385c6f3c1f4eba54b48eccc
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 2, 2026.

Transparency log

Security for hone-flow 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_flow-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 2, 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