Skip to main content

Saddlefit

CI Coverage Release License

Saddlefit fits an agent's harness to one compact model, on your own tasks. It adds what fixes failures, drops what stops helping, and proves each change on tasks the tutor never saw.

The model's weights never change; only the files around it do: system prompt, skills, tool guidance, tool scripts, loop settings, reasoning mode and an EXPERIENCE.md of lessons.

Status: pre-alpha. Built milestone by milestone; see the milestones and the spec.

Three loops

Three loops: the fast loop during a task, the middle loop overnight, the slow loop that improves the tutor itself
  • Fast — during a task. When the task's own check fails, the student probes a few harness variants locally and keeps what passes; the finding goes on probation in a journal.
  • Middle — overnight. A tutor diagnoses training failures and proposes one change at a time; it is accepted only if it wins on repeated runs over held-out tasks, and pruned by ablation once it stops paying for its context.
  • Slow — every few weeks. Statistics on accepted changes become a ranked playbook, gated by an A/B test, until a compact local tutor can take over.
The fast loop in detail
Fast loop: a failed check triggers local probes, and a change that helps stays on probation in the journal
The middle loop in detail
Middle loop: a change is accepted only if it wins on the training batch and again on held-out tasks
The slow loop in detail
Slow loop: a new playbook must beat the old one in an A/B run before the tutor uses it, and a shadow tutor takes over once it is as good as the cloud one

What counts as a compact model

An open-weight model that runs on one consumer machine and meets all four conditions (saddlefit doctor checks them):

  1. Memory — at 4-bit, weights plus a 32k-token context fit in 24 GB or less.
  2. Active size — at most about 10B parameters active per token (a 30B-A3B MoE qualifies).
  3. Speed — roughly 20 tokens per second or more on the target machine.
  4. Tool use — reliable tool calls, natively or through constrained JSON output.
Tier What it is Typical hardware
S dense, 1–4B 8–16 GB laptops, CPU only
M dense, 4–10B, or a looped model 16–18 GB Macs, GPUs with 8–12 GB
L MoE, up to ~35B total and ~5B active 32–36 GB Macs, 24 GB GPUs

Quickstart

Requires Python 3.12+, Docker and a local model runner such as Ollama. Ollama serves models with the context window set on the server, not the one a request asks for, and its default depends on the version and the memory available. Start it with OLLAMA_CONTEXT_LENGTH=32768 (or what student.context_length says); doctor checks the window it actually serves.

uv tool install saddlefit
cd your-python-project
saddlefit init --model qwen3:8b
saddlefit doctor
saddlefit tasks mine
saddlefit baseline
saddlefit fit
saddlefit report

Every command also accepts --json.

More tasks than your history holds

A fit needs tasks the student solves sometimes. Two commands add them, both through the generator model in .saddlefit/saddlefit.yaml, within its max_calls and max_usd (fill in its prices first):

saddlefit tasks generate --type feature --count 5   # or --type bugfix
saddlefit tasks mutate --count 5                     # injected bugs that break existing tests

A task is kept only if its hidden tests fail without the reference solution and pass with it in a fresh container, and if the current student then passes it in one to four of five runs. Generated and mutated tasks join the training and held-out splits, never control.

Watching a fit

On a terminal fit shows one framed status line (round, candidate, stage, runs done, spending); the frame turns amber when no run has finished for longer than a run may take. From another shell, saddlefit status says whether a fit is running, where it is or where it stopped, and what fits have cost. A fit ends by running the fitted harness once over the training and held-out tasks (the closing stage), so saddlefit report can compare it with the baseline.

Work mode

saddlefit run "Add a --dry-run flag to the export command" --check "pytest -q tests/test_export.py"

The student works in a copy of your working tree. If the check fails, the fast loop probes a few mechanics from the starter playbook, combines the ones that help and checks once more. The answer is a patch in .saddlefit/answers/; your files are not touched. A change the fast loop needed is recorded in .saddlefit/journal/: on probation when the combined change passed, rejected when it did not. Neither enters the harness by itself; having fit test probation entries on held-out tasks is planned (#147). --json says whether the check passed; run exits with 4 when it did not, so saddlefit run … && git apply <answer> never applies a failing patch.

Where it comes from

The middle loop follows AutoSaddler; the fast loop and the improver that improves itself follow Harness². What Saddlefit adds is the focus on one compact local model, measured on your own tasks, with a harness that stays small.

Ideas from AutoSaddler and Harness², and what Saddlefit adds Map of related approaches by when the harness improves and who executes; Saddlefit learns ahead of time for a small local model

See the spec, Part D for sources and a fuller comparison.

Documentation

License

Apache-2.0

Metadata

Release files for saddlefit 0.3.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 saddlefit 0.3.0
File Size Uploaded Provenance Actions
saddlefit-0.3.0.tar.gz 184.7 kB With provenance Details for saddlefit-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for saddlefit 0.3.0
File Interpreter ABI Platform Actions
saddlefit-0.3.0-py3-none-any.whl Python 3 none any Details for saddlefit-0.3.0-py3-none-any.whl

Total release size: 405.1 kB

Release files / saddlefit-0.3.0.tar.gz

Download URL saddlefit-0.3.0.tar.gz
Size 184.7 kB
Tags Source
SHA-256 checksum
How to use checksums
755bd864f557c0ff898d71af3d7e21ef1586105e24b55bfc78deaa1b09e84a8d
BLAKE2b-256 checksum
How to use checksums
adbc0ebf49c26f7e3a8808ff5e6005b6e0d1ce1ca0ccca724f79a1c7a34b67aa
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 Nov 5, 2026.

Transparency log

Release files / saddlefit-0.3.0-py3-none-any.whl

Download URL saddlefit-0.3.0-py3-none-any.whl
Size 220.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d951124288b587706287756fc7aab46f0f8d7d1c08a6efddd64ba7537fefbff
BLAKE2b-256 checksum
How to use checksums
e3565827d4b55a27d673d7f8eccac07b82323dffc8454cc3253095d538c1445e
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 Nov 5, 2026.

Transparency log

Security for saddlefit 0.3.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 saddlefit-0.3.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 Nov 5, 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.

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