hone-models
One interface for local and hosted AI models, with structured output, GPU scheduling and full call records.
Part of honeworks: small, standalone tools for reliable generative-AI workflows. Works on its own; works better with its siblings.
Why: a generative-AI workflow that runs on your own machine calls several models (a local LLM, a vision model, an embedder, a judge, a voice) that share one GPU, answer in different shapes and fail in different ways. hone-models gives them one small interface that checks a request fits the model before sending it, says exactly how a structured answer was obtained, keeps models from fighting over VRAM, and records every call so you can see and replay what happened.
- Local and hosted as equals: Ollama, any OpenAI-compatible server (llama.cpp, vLLM, LM Studio,
OpenAI) and, with the
litellmextra, any model LiteLLM knows. - Checked before calling: vision, context size, thinking and JSON-schema support come from a model
registry, so a prompt that does not fit raises
ContextOverflowinstead of being silently truncated. - Structured output that says what happened: constrain, parse, validate, retry, repair; the result
tells you which (
structured_path) and never hides a truncated reply. - Decision questions: yes/no, choice and score questions answered by a decision model (Jev) or emulated on any LLM, with calibrated probabilities from token logprobs when available.
- Embeddings, GPU leases and local model lifecycle (
mk.gpu.lease,mk.session,mk.unload), and machine state: which models every server holds, partly on the CPU or not, and unloading all but the needed ones without breaking another run (mk.machine.snapshot(),prepare(),load()). - Local text to speech (
mk.speech("kokoro-82m"), extraspeech): long narration into one WAV file; expressive narration with an emotion and intensity per paragraph (mk.speech("chatterbox"), extraexpressive). - Images, music and video (
mk.image,mk.music,mk.video) through ComfyUI workflows or standalone projects run in their own environment (SongGeneration), one registry entry per model: named inputs mapped onto workflow nodes, files uploaded once by hash, a GPU lease per call or session, failed jobs as results with anerror_kind, a call cancelled from another thread (cancel=) (docs/generation.md). - Transcription with word timestamps (
mk.transcriber, extratranscribe) with faster-whisper, in process, a GPU lease per call or session (docs/transcription.md). - A catalog of models with guides: every model we use or may use, installed or not, with its licence,
what installs it (
hone-models models install <id>prints the commands) and a guide saying what it can take and how it behaves with faces, hands, poses, objects and references (mk.guide(id),notes_about(...),mk.select({"features": [...]})); lyrics and prompt phrases written once and converted per model (docs/models-and-guides.md). - Every call recorded as an OpenTelemetry-style span in a local SQLite file, prompt sections included, and replayable with changes.
Install
pip install hone-models # or: uv add hone-models
The core needs only pydantic and httpx. Optional extras:
| Extra | Adds | Needs |
|---|---|---|
cli |
the hone-models command (calls, models, GPU status) |
typer, rich |
gpu |
NVML memory readings for GPU leases | an NVIDIA driver |
litellm |
hosted models through LiteLLM | the provider's API key in an environment variable |
speech |
local text to speech with Kokoro-82M | Python < 3.13, torch; spaCy's English model (docs/speech.md) |
expressive |
expressive speech with Chatterbox (emotion and intensity) | Python < 3.13, torch; dependency overrides (docs/speech.md) |
transcribe |
transcription with word timestamps (faster-whisper) | on a GPU, the CUDA 12 cuBLAS and cuDNN 9 wheels (docs/transcription.md) |
jev is an empty extra: the Jev decision provider needs nothing beyond the core (it calls the API over httpx).
Quickstart
Needs a local Ollama with Gemma 4 12B (ollama pull gemma4:12b), or change the
model id. Point the registry id gemma4-12b at the tag you pulled in ~/.config/hone/models.toml:
[models."gemma4-12b"] with model = "gemma4:12b" (see
the registry docs).
import hone_models as mk
from pydantic import BaseModel
llm = mk.text("gemma4-12b") # a registry id; "ollama:llama3.2:1b" works ad hoc
r = llm.complete([{"role": "user", "content": "Write a haiku about rain."}])
print(r.text, r.usage, r.finish_reason)
class Verdict(BaseModel):
score: int
rationale: str
r = llm.complete(
[{"role": "user", "content": "Rate this pitch 1-5: a shanty about spreadsheets."}], schema=Verdict
)
print(r.parsed, r.structured_path) # a Verdict (or r.error set), and how it was obtained
Each call is recorded in .hone/models/spans.db; hone-models calls list shows them.
Use it with the rest of honeworks
hone-models is the default implementation of the ports the other honeworks packages own, implemented structurally (it imports none of them):
| Port | hone-models | Entry point group |
|---|---|---|
TextClient |
mk.text(...) |
hone.text_clients |
DecisionClient |
mk.decision(...) |
hone.decision_clients |
Embedder |
mk.embedder(...) |
hone.embedders |
GpuLease |
mk.gpu.GPU / mk.gpu.lease |
hone.gpu_leases |
Replayer |
mk.replay.Replayer() |
hone.replayers (no argument) |
MachineProbe (hone-select) |
mk.machine.Machine() / mk.machine.MACHINE |
hone.machine_probes (no argument) |
For example, hone-select judges and hone-taste panels take mk.decision("gemma4-12b") as their
decision client, and hone-flow steps take mk.gpu.GPU as their GPU lease. Spans follow the shared
honeworks records format, so hone-lens reads them next to the other packages' records and replays
calls through mk.replay.Replayer.
Documentation
- docs/: concepts and guides (registry, structured output, prompts, decisions, embeddings, GPU and sessions, records and replay, CLI, testing without models).
- examples/: one runnable, offline example per concept (quickstart, registry, structured output, context budget, providers, decisions, retries, records, GPU leases, testing), each explaining what it shows, how and why; the test suite runs them all.
- design/: why the package exists, the current design, and the change records and decisions behind it.
- CONTRIBUTING.md: conventions, tests and how design changes are made.
How this was built
hone-models 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 API follows design/current.md and may still change before 1.0; changes are listed in CHANGELOG.md. Python 3.11 to 3.13 (the speech extras: 3.11 and 3.12).
License
Apache-2.0. Copyright 2026 Bahman Shadmehr. Third-party material shipped in the package (the voice clips) and the licences of the optional extras' dependencies are listed in THIRD_PARTY_NOTICES.md.
Metadata
Release files for hone-models 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| hone_models-0.1.0.tar.gz | 1.4 MB | With provenance | Details for hone_models-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hone_models-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for hone_models-0.1.0-py3-none-any.whl |
Total release size: 2.7 MB
Release files / hone_models-0.1.0.tar.gz
| Download URL | hone_models-0.1.0.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53d54fc4d708a41b2ee5cbf80475705c813836ee8500ce3ce2627cf261b2963a
|
|
BLAKE2b-256 checksum How to use checksums |
a9dc2529d201fa41045e0e1cf4cb2c317e60e7b0b57e7d39f0dbc49426600683
|
| 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 logRelease files / hone_models-0.1.0-py3-none-any.whl
| Download URL | hone_models-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
901cb44772ff594dfdb5909fd5fa3dbd76b49ccaeaffb4c7ef13e6181c9d720c
|
|
BLAKE2b-256 checksum How to use checksums |
462ab80d242a8354b97d7f556755c2e3679cd978a9bff909636cf72134f676a9
|
| 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 logSecurity for hone-models 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.
Attestation for hone_models-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 logA 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.