Skip to main content

Supermodel

PyPI

An agent-driven ML workspace. Run ML experiments with a coding agent, trust that the results are valid, and keep the project clean enough to understand months later.

Coding agents (Claude Code, Codex, or any harness that reads AGENTS.md) can already write model code. What they don't do on their own is keep an ML project in order. Supermodel gives the agent a structured workspace, a CLI and a set of rules, so you get two things at once:

  1. Results you can trust. The evaluation is frozen and hashed, preprocessing only ever sees training rows, the test set is sealed, and a runner writes every score. The agent never types one.
  2. A workspace that stays clean. Every kind of file has one home, every experiment is recorded with its hypothesis, config, score and exact code, and any past result can be traced and rerun.

You describe what you want in plain language ("predict which users churn", "try LightGBM with target encoding", "what did we try last week?"). The agent puts each piece in the right folder and runs the right command.

Two kinds of project are supported:

  • supervised: classification, regression, ranking and forecasting on tabular data.
  • custom: any method (allocation, optimization, simulation) scored by an evaluator you write.

See docs/spec.md for the design.


The problem

Point a coding agent at a dataset and ask it to "try a few models", and you get results quickly. A few days later the project looks like this:

train.py  train_v2.py  train_lgbm_final.py  train_lgbm_final_FIXED.py
features.py  features_new.py  eval.py  quick_check.py  test_split.py
notebook1.ipynb  Untitled3.ipynb  results.csv  results_old.csv  model.pkl

The workspace turns into a mess

  • File sprawl. The agent writes a new script for every idea. Throwaway checks, half-finished variants and the code that matters sit side by side.
  • You lose track of what you tested. There's no record of which experiments ran, what each one was trying to show, or how it scored.
  • Old code gets overwritten. The agent is free to edit any file, including the code behind last week's best result. Once it changes, that result can't be reproduced.
  • You can't go back. When someone asks how the current model was built, or why an idea was dropped, the answer is spread across chat logs and stale files.

The results can't be trusted

  • Leakage nobody notices. A scaler is fit on the full dataset, early stopping watches the validation fold, or a feature quietly encodes the target. The score looks great and means nothing.
  • A moving yardstick. The split, metric or holdout gets changed between runs, sometimes "to fix a bug". Then E007 and E012 can't be compared.
  • Numbers typed, not measured. The agent summarizes a result from memory or a truncated log, and the summary drifts from what actually ran.
  • Holdout erosion. Every peek at the test set turns it into one more validation set.

You end up re-checking the agent's work line by line and cleaning up after it, which defeats the point of using one.

How Supermodel fixes it

A clean, organized workspace

The same project in Supermodel:

supermodel.yaml      task, split, holdout, metric: the evaluation contract
data/                raw data or a pointer to it
eda/                 marimo notebooks, each rendered to HTML
modeling/            registered, tested steps, estimators and model classes
experiments/         ledger.tsv + one E### folder per experiment (config only)
eval/                frozen splits, metric and scorer, hashed and pinned
champion/            the one model eligible for promotion
memory/              brief, state, decisions, session log
docs/                plans and notes
utils/               throwaway scripts
Friction What Supermodel does
File sprawl Every folder has one job and its own CLAUDE.md contract. New preprocessing, features and models go into registered, tested components in modeling/. Experiments are config only, with no Python. Throwaway scripts go in utils/, analysis in eda/.
Losing track of experiments supermodel new-experiment records the hypothesis and expected effect before anything runs. The runner appends every run to experiments/ledger.tsv with its score, noise band and status. supermodel status shows the best run, the champion and what's next.
Old code overwritten Every run commits its inputs to git and records the commit, so later edits never erase how a result was made. supermodel review E### links the exact code a run used. Evaluation code, the ledger, results and the champion can't be edited by the agent (enforced by guard hooks in Claude Code).
No way to go back Each experiment folder keeps its config, hypothesis, notes, log, results and a protocol.yaml snapshot of the data and evaluation. Crowns, promotions and design changes are logged with reasons in memory/decisions.md. Any run can be rerun from its commit.
Lost context between sessions memory/state.md, the brief, the decision log and the ledger are read at session start. supermodel wrap-up (/wrap-up in Claude Code) updates them and commits.

Valid results

Friction What Supermodel does
Leakage in preprocessing and early stopping Model classes bundle steps and estimator into one fit/predict. The runner passes only training rows to fit, including the early-stopping eval set. Every fold set goes through the same leakage checks.
Split, metric or holdout changing under you supermodel freeze builds the splits and hashes eval/ into a manifest. Every run verifies the pin. After freeze, changing a pinned section blocks runs until the evaluation is unfrozen, which bumps eval_version.
Agent-reported scores Only the runner writes experiments/ledger.tsv and results.json.
Holdout peeking The holdout is encrypted at freeze. Only supermodel promote decrypts it, scores the crowned champion and records the read.
"Is +0.002 real?" Each run is compared fold by fold (or case by case) with the best run so far, and the 95% interval of those differences is the noise band. A gain inside it is reported as within noise, not as an improvement.
Setup questionnaires No interview. Give a sentence, a doc or a data path. The agent infers the configuration, marks each guess # suggested:, and freeze refuses until you've accepted each one.

Why it's useful for ML practitioners

You can run experiments fast without losing rigor. Ask for an idea in a sentence and the agent implements it, registers it, runs it on the frozen evaluation and reports whether the gain is real.

You keep the judgment calls; the agent does the legwork. You decide the split, the holdout, the metric and which model gets crowned. The agent writes features, model classes, notebooks and reports, and runs the experiments.

You can always answer "what did we try, and how?" Every experiment has a hypothesis, a config, a score and a link to its exact code. The ledger is the full history, and nothing in it was typed by the agent.

You get the scaffolding you'd otherwise build yourself. Most teams eventually write their own CV harness, leakage checks, experiment log, holdout discipline and model packaging. Supermodel ships them as one tested workspace:

You'd normally build Supermodel gives you
A cross-validation harness Frozen, hashed folds: window, rows, period, cutoffs, group, random, column or custom, with gaps, stratification and repeats; supermodel splits previews them
Leakage checks The same checks on every fold set, preprocessing fit on training rows only, rolling-origin forecasts that only see past actuals
An experiment tracker A ledger written by the runner, one folder per experiment with its hypothesis, config, scores, train-vs-validation gap and a link to the exact code
A test-set policy An encrypted holdout, read only by promote, and every read recorded
Model packaging One model class per experiment (steps plus estimator) that saves, reloads and scores new data with supermodel predict
Analysis hygiene EDA as marimo notebooks rendered to HTML, saved reviews with versioned score snapshots, plans and notes in docs/

You can pick up where you left off. State, decisions and the ledger live in plain files in git. A new session, a teammate or a different agent starts from the same picture instead of re-exploring the repo.

It isn't tied to one agent. The workspace, CLI and runner work with any harness. See Agent harnesses.


Installation

Supermodel is on PyPI as supermodel-ml. The command and the Python import are both supermodel. It needs Python 3.10 or newer.

With uv (recommended). This installs supermodel as a standalone tool, isolated from your other environments:

uv tool install supermodel-ml --with-executables-from marimo

Don't have uv? Install it with curl -LsSf https://astral.sh/uv/install.sh | sh (see the uv docs for Windows).

With pip. This installs into whichever environment is active:

pip install supermodel-ml

Check it worked:

supermodel --help

Upgrade: uv tool upgrade supermodel-ml (or pip install -U supermodel-ml).

Latest code or development:

uv tool install git+https://github.com/jeffmli/supermodel.git --with-executables-from marimo   # latest main
uv tool install --editable /path/to/supermodel --with-executables-from marimo                 # from a clone

Each project gets its own .venv, created by supermodel init, with the same supermodel you installed. The first supermodel init also adds the /init-project command to Claude Code (~/.claude/commands/) if it's missing.

Agent harnesses

Everything that protects results lives in the workspace and the CLI, so any agent that can run shell commands can drive a project:

  • Any harness. The frozen evaluation, pin checks, encrypted holdout, runner-written ledger and noise band are all enforced by supermodel itself. Each project has an AGENTS.md (startup, setup workflow, model-development checklist) and a CLAUDE.md in every folder describing that folder's contract.
  • Claude Code adds guard hooks that block edits to eval/, champion/ and the ledger, permission prompts for freeze, crown, promote and unfreeze, session-start context injection, and slash commands (/init-project, /setup, /eda, /new-experiment, /status, /wrap-up). SKILL.md describes how Claude uses the workspace.

The examples below use Claude Code. With another harness, start the agent in the project folder and describe what you want to build.


Quick start

supermodel init my-project      # creates ./my-project; `supermodel init --here` uses the current folder
cd my-project
claude

init creates the full skeleton (data/, docs/, eda/, eval/, modeling/, experiments/, champion/, memory/, runner/), a project .venv, and a supermodel.yaml with kind: unset. A --data path is read relative to where you run the command.

Then work through it in conversation:

  1. Say what you want to build. For example: "I want to predict which users churn. Data is in data/users.parquet." Claude runs /setup. It profiles the data (schema only), infers the kind and configuration, marks each guess # suggested:, and replies with one summary and any open questions.
  2. Check the evaluation design. Read the suggested split, holdout and metric in supermodel.yaml. Edit or accept them. supermodel splits previews the fold table; supermodel freeze --check runs every freeze check without writing anything.
  3. Say "freeze". Claude runs supermodel freeze and Claude Code asks you to approve it. This builds the splits, encrypts the holdout and pins eval/.
  4. Say "run the baseline". Claude creates E001 and runs it. After every run you get a run card: the result in plain language, compared to the best run and its noise band, with the fold table and links to the record, ledger row and exact code.
  5. Iterate. Ask for EDA, features or models in plain language.
  6. Crown and promote. "Make E004 the champion" runs supermodel crown. "Check it on the holdout" runs supermodel promote.
  7. Say "let's stop here". /wrap-up logs the session, updates memory/state.md and commits.

Things you can say

You say What happens
"what's the churn rate by plan?" supermodel look "<question>" --code '...' runs a pandas snippet on dev rows and prints the answer
"look at the class balance" supermodel eda "<question>" writes a marimo notebook, renders eda/<name>.html and prints a text summary of each cell
"try LightGBM with target encoding" A new E### with its hypothesis; the step and estimator are registered in modeling/, then run
"run a backtest with 3 folds" supermodel backtest, an unofficial development check (works before freeze)
"what's our best model?" supermodel status: best run vs champion, recent runs, next steps
"show me E003's code" supermodel review E003 prints the run card and links to the exact code
"make E004 the champion" supermodel crown E004 --reason "..." after your approval
"check it on the holdout" supermodel promote scores the champion once on the sealed holdout
"write up the comparison" supermodel report saves a Markdown review and a versioned score snapshot
"let's stop here" /wrap-up

Trust modes

Set with trust: in supermodel.yaml, or supermodel init --trust strict.

  • standard (default for new projects): no sudo, chmod or passphrase, and it works the same on macOS, Linux and Windows. Guard hooks live in the project's .claude/settings.json. The pin and a generated holdout key live in ~/.supermodel, and the guards keep the agent out of them. Claude runs freeze, crown, promote and unfreeze after you approve each one in Claude Code. This catches mistakes and leakage. It does not stop an agent set on cheating, since a script could reach the key.
  • strict (also any project without a trust: key): root-owned pin and guard hooks for this project only, registered in its own root-owned .claude/settings.json (sudo supermodel install --project "$PWD"). Nothing is installed machine-wide; another project or Claude Code session never sees them. A strict install from before this change put a machine-wide Claude Code policy in place, which switches off every project's own hooks: remove it with sudo supermodel remove-machine-policy (every supermodel command warns while it's there). The modeler-only commands must run in your own terminal, and the holdout is encrypted with a passphrase you type. supermodel freeze shows each suggestion to accept or edit, freezes, asks for the passphrase, then asks for sudo once to install the guards and pin.

supermodel freeze --check runs every freeze check and writes nothing, in either mode.


Using it in more detail

Model experiments

Start a new model with supermodel new-experiment "<hypothesis>" --expected "<effect>". Its folder records the hypothesis and a protocol.yaml snapshot of the dataset and planned evaluation. Register the implementation in modeling/ (supervised: steps/, estimators/, model_classes/; custom: methods/) and reference it in the experiment's config. Experiments are config only. Run supermodel backtest E### for development or supermodel run E### for frozen evaluation.

Splits

Supervised folds can be built many ways: window, rows, period, cutoffs, group, random, column or custom, with order_by, keep_apart, gaps, sliding windows, stratification and repeats. Every fold set goes through the same leakage checks. supermodel splits previews the fold table and supermodel splits --suggest proposes splits from the data's shape.

Forecasting

For forecasts made after each period closes, set split.horizon (for example "1d") on a time split. Each validation window is then scored with rolling origins: the runner cuts it into horizon-long blocks and forecasts each with predict(X, meta, history=...), where history holds every actual from before that block's origin and nothing later. supermodel promote scores the holdout the same way. Without horizon, the whole window is forecast from the end of training. Projects frozen before this feature need a re-scaffolded eval/ before freezing to use it.

Backtests and evaluation reviews

supermodel backtest reuses the latest successful backtest strategy, starting from the project's inferred settings on the first run. It works before freeze. Each run saves its methodology, selected dev rows or cases, scores and a Markdown report under experiments/backtests/.

  • supermodel backtest --history lists strategies.
  • supermodel backtest E002 --set '{"split":{"n_folds":3}}' --reason "Compare three validation windows" changes the fold count.
  • supermodel backtest --strategy ID restores an older methodology as the default.

Backtests are unofficial. Champion selection and holdout promotion keep the frozen evaluation contract, and supermodel status only compares backtests within the latest strategy.

To save a review: supermodel report E002 --title "Baseline comparison" --decision "Keep the baseline" --interpretation "..." --next-step "...". Each review gets a folder under memory/reports/ with report.md and a versioned scores.json, and includes the baseline and current champion automatically. Add --promotion to include the recorded holdout result. Regenerate the Markdown with supermodel report --from-json path/to/scores.json.

Inference

After crowning a supervised experiment, score new rows:

supermodel predict --data new_rows.csv --out predictions.csv

It loads the fitted pipeline from champion/model/ and accepts CSV or Parquet. Supply the features listed in champion/model/meta.json. For a rolling-origin forecaster, add --history actuals.csv with the rows whose target is known when the forecast is made.

Notebooks

EDA notebooks are marimo .py files in eda/. supermodel eda "<question>" writes one, runs it, and renders eda/<name>.html next to it. Open that file in a browser; there's no server to start. After editing, supermodel eda --render eda/<name>.py refreshes the page, and supermodel notebook eda/<name>.py opens it interactively in the project's environment.

Project dependencies

Each project has its own .venv with supermodel, marimo, ipykernel and your declared dependencies. Inside the project, supermodel switches to it by itself, so nothing needs activating; VS Code and Jupyter pick it up too. Declare extra packages in supermodel.yaml:

dependencies:
  - torch>=2.3

supermodel env creates or repairs the environment; re-run it after adding dependencies. run, backtest, crown and promote refuse when a declared package is missing and print the install command. supermodel deps runs the same check on its own. Re-run it after reinstalling the tool.

Project docs and memory

Where What
docs/plans/ Plans for upcoming work, one Markdown file per topic; the agent keeps their status current
docs/notes/ Data quirks, gotchas, how-tos and references worth keeping
memory/brief.md What the project is for, and open questions
memory/state.md Current best, champion, active hypotheses, next steps
memory/decisions.md Every crown, promotion and design change, with reasons
memory/sessions/ Automatic daily session log
experiments/ The ledger and one folder per experiment

Command reference

Command Purpose
supermodel init NAME Create a blank project in ./NAME (--here for the current folder; --trust, --data, --no-venv)
supermodel configure --kind ... Set the kind and config (run by /setup; repeatable until freeze)
supermodel profile PATH Schema-only profile of a data file
supermodel check Is supermodel.yaml complete enough to freeze?
supermodel splits [--suggest] Preview or propose folds
supermodel freeze [--check] Build splits, encrypt the holdout, pin eval/
supermodel verify Verify the pin and manifest
supermodel new-experiment Create the next E### folder
supermodel run E### Run one experiment on the frozen evaluation
supermodel backtest Development backtest with a versioned strategy
supermodel review E### Run card and links to an experiment's code
supermodel status Best vs champion, recent runs, next steps
supermodel crown E### --reason Make an experiment the champion
supermodel promote Score the champion on the holdout
supermodel unfreeze --reason Escape hatch: bump eval_version
supermodel install --project Strict only: root-owned guards for that one project
supermodel remove-machine-policy Remove the machine-wide Claude Code policy older versions installed
supermodel predict Score new rows with the supervised champion
supermodel report Save a Markdown review and JSON score snapshot
supermodel look Quick answer from dev data: a pandas snippet, output capped, no notebook
supermodel eda / notebook Write, render or open EDA notebooks
supermodel env / deps Create the project venv / check declared dependencies
supermodel wrap-up End the session: log, state.md, commit
supermodel selftest Run test layers 1–4

Run supermodel <command> --help for the full options.


Examples

examples/ has three runnable projects (churn classification, diabetes regression, store-sales forecasting), each with planted pitfalls. Watch one run end to end, or drive it yourself in Claude Code:

.venv/bin/python examples/run_demo.py churn              # scripted end-to-end run, ~30 s
.venv/bin/python examples/setup_project.py churn ~/sm-churn

Develop

uv venv --python 3.12 .venv && uv pip install --python .venv/bin/python -e .
.venv/bin/supermodel selftest                                  # test layers 1-4, ~3 min on CPU
SUPERMODEL_UPDATE_SNAPSHOTS=1 .venv/bin/supermodel selftest    # re-record ledger snapshots after an intended change

For a worked ablation study, run .venv/bin/python -m pytest -q supermodel/tests/test_ablation_workflow.py. It trains a linear baseline on synthetic data, adds one squared feature, then removes it while keeping the estimator and folds fixed. The test recomputes RMSE from saved predictions and checks that removing the feature recovers baseline performance.

supermodel/testing/ ships the data generators, fake estimators and contract checks, so a new model class can be tested against the same contracts.

Metadata

Release files for supermodel-ml 0.2.1

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

Source distribution (sdist)

Source distribution for supermodel-ml 0.2.1
File Size Uploaded Provenance Actions
supermodel_ml-0.2.1.tar.gz 272.7 kB Without provenance Details for supermodel_ml-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for supermodel-ml 0.2.1
File Interpreter ABI Platform Actions
supermodel_ml-0.2.1-py3-none-any.whl Python 3 none any Details for supermodel_ml-0.2.1-py3-none-any.whl

Total release size: 595.4 kB

Release files / supermodel_ml-0.2.1.tar.gz

Download URL supermodel_ml-0.2.1.tar.gz
Size 272.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8694ba95e3ea6b3ba4d0bdce29553d6b123576c4ab5edfd71a403b46922baa07
BLAKE2b-256 checksum
How to use checksums
c9209fcce7dba9c612a3c79c62059d3d05ee8520c37e8761d3ca373fd6ca7560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / supermodel_ml-0.2.1-py3-none-any.whl

Download URL supermodel_ml-0.2.1-py3-none-any.whl
Size 322.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
645abb87dfb9f3b5dcfa6bd4df545de4fe8a8cc2d3880de977919b14d650962e
BLAKE2b-256 checksum
How to use checksums
03958087aa819f4e74d5a93783845fc1d329d7f30cdc646163532e0b5905ed8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for supermodel-ml 0.2.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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