Skip to content

feat(cli): train a model in its environment and record its run - #20

Merged
UltiPro merged 1 commit into
mainfrom
feat/train
Nov 28, 2026
Merged

UltiPro merged 1 commit into
mainfrom
feat/train

Conversation

@UltiPro

@UltiPro UltiPro commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Summary

Adds miniops train <name> [--data PATH] [--seed N], the first command that runs model code: it trains the draft of a model in the model's own environment and records the run with what it takes to repeat it. runs list and runs show follow in the next pull request; until then a training prints its run id.

  • model.toml gets [train] (data, target, seed) and [params]; --data and --seed replace them for one training, and the runner seeds random and numpy.
  • train runs uv sync, then trains a copy of a deterministic zip snapshot of the model directory, which is stored once per content; parameters, target and lock come from that copy.
  • The run is stored as running first and ends as succeeded, failed or interrupted, with author, seed, data fingerprint, lock digest, commit, environment, types to trust, log and model. An error that miniOPs reports, like a missing target column, ends with its message and no traceback.
  • Schema version 2 of the store adds the new run fields; an older store upgrades itself after a backup.
  • Executor.run takes a job file and returns the exit code; LocalExecutor streams the runner's output and kills it on an interrupt.
  • A model directory that the store does not know, as in a fresh clone, is registered with the draft 1.0.0, and the hints of registry list and new point there; CI trains a model from the built wheel.

Known limitations:

  • A host that is killed, or a second interrupt while a run is being recorded, leaves the run running.
  • Every file in the model directory except .venv, caches and .git goes into the snapshot, so data or secrets kept there are copied into .miniops/artifacts/.
  • A process that the model code starts and leaves running keeps the runner's output open, and train waits until it ends.
  • A symbolic link to a directory inside the model directory stops the snapshot with an error.

Checklist

  • PR title follows Conventional Commits (e.g. feat(registry): ...)
  • Larger or architectural changes were discussed in an issue first
  • Tests added or updated (if applicable)
  • No OS-specific assumptions (paths, shell commands, file encodings); works on Linux, macOS and Windows
  • Documentation updated
  • CHANGELOG.md updated under "Unreleased"

@UltiPro
UltiPro merged commit 78767a7 into main Nov 28, 2026
17 checks passed
@UltiPro
UltiPro deleted the feat/train branch November 28, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant