MixtrainDocsBlog

Use mixtrain routine to create and manage routines, inspect runs or run a routine manually.

List Routines

mixtrain routine list

List all routines in the workspace.

Options:

OptionDescription
--jsonOutput raw routine data as JSON
mixtrain routine list
mixtrain routine list --json

Create Routine

mixtrain routine create <files...>

Create a routine from files. Supports directories and glob patterns. Mixtrain detects the MixRoutine entrypoint and records its trigger configuration.

Options:

OptionDescription
--name, -nRoutine name (defaults to first .py filename)
--description, -dRoutine description
--entrypoint, -eEntrypoint hint: file path, file:class, or class name
mixtrain routine create ./embed-new-rows --name embed-new-rows
mixtrain routine create . --name nightly-eval --entrypoint routines/nightly.py:NightlyEval
mixtrain routine create . --name refresh-index --entrypoint RefreshIndex

Entrypoint Hints

Use --entrypoint when the upload contains more than one candidate class.

FormatExampleBehavior
File only--entrypoint routines/nightly.pyScans only that file. It must contain exactly one MixRoutine class.
File:Class--entrypoint routines/nightly.py:NightlyEvalUses the named class in that file.
Class only--entrypoint NightlyEvalScans all files for a class with that name. It must be unique.

Run Routine

mixtrain routine run <name> [--<input> <value> ...]

Run a routine manually.

Each argument in the routine's run function is can be passed via cli flags. Scalars/enums/ resource references take a plain value; composite inputs — object, tuple, list, dict, tensor — take a JSON value). Run mixtrain routine run <routine-name> --help to see the available arguments.

Dataset-triggered routines accept trigger overrides; schedule and completion triggers run immediately with no extra input.

Options:

OptionDescription
--<input> <value>Set a spec input by name. Composite types take a JSON value.
--input-json, -iAll inputs as one JSON object, or a path to a JSON file. Per-input flags override matching keys.
--trigger-datasetDataset to read for a dataset-triggered run
--trigger-from-versionStart version (default: beginning)
--trigger-to-versionEnd version (default: latest)
--detach, -dStart run and exit without streaming logs
--gpuGPU type
--gpu-per-nodeGPUs per node
--cpuCPU cores
--memoryMemory in MB
--timeoutMax execution time in seconds
--imageDocker image URL
mixtrain routine run embed-new-rows
mixtrain routine run embed-new-rows --detach
mixtrain routine run nightly-eval --limit 100

# Replay a dataset-triggered routine over a version range
mixtrain routine run embed-new-rows --trigger-dataset photos --trigger-from-version 3

View Routine

mixtrain routine get <name>

View routine details, trigger configuration, and recent runs.

List Runs

mixtrain routine runs <name>

List runs for a routine.

Options:

OptionDescription
--limit, -nMaximum runs to show
mixtrain routine runs embed-new-rows
mixtrain routine runs embed-new-rows --limit 100

View Logs

mixtrain routine logs <name> <run_number>

View logs for a routine run.

Options:

OptionDescription
--follow, -fStream logs continuously
mixtrain routine logs embed-new-rows 3
mixtrain routine logs embed-new-rows 3 -f

Edit Routine

mixtrain routine edit <name>

View and modify routine files and metadata.

Options:

OptionDescription
--file, -fEdit file in $EDITOR
--view, -vView file contents
--delete, -dDelete file/folder at this path
--add, -aAdd local files to routine
--include-ignoredInclude files matched by .gitignore when adding files
--name, -nRename routine
--description, -DUpdate description
--entrypoint, -eUpdate or clear the routine entrypoint hint
--yes, -ySkip confirmation prompts
mixtrain routine edit embed-new-rows
mixtrain routine edit embed-new-rows -v routine.py
mixtrain routine edit embed-new-rows -f routine.py
mixtrain routine edit embed-new-rows --add ./src/
mixtrain routine edit embed-new-rows -d old.py
mixtrain routine edit embed-new-rows -n index-new-rows
mixtrain routine edit embed-new-rows -D "Embed newly appended rows"

Download Routine

mixtrain routine download <name>

Download routine source files to a local directory for editing.

Options:

OptionDescription
--dir, -dTarget directory (defaults to ./<name>/)
--force, -fOverwrite existing directory
mixtrain routine download embed-new-rows
mixtrain routine download embed-new-rows --dir ./local-copy/
mixtrain routine download embed-new-rows --force

Upload Routine

mixtrain routine upload <name> --dir <path>

Upload local routine files to update the routine on the platform.

Options:

OptionDescription
--dir, -dLocal directory containing routine files (required)
--include-ignoredInclude files matched by .gitignore
mixtrain routine upload embed-new-rows --dir ./local-copy/

Cancel Run

mixtrain routine cancel <name> <run_number>

Cancel a running routine.

mixtrain routine cancel embed-new-rows 5

Delete Routine

mixtrain routine delete <name>

Delete a routine.

Options:

OptionDescription
--yes, -ySkip confirmation
mixtrain routine delete embed-new-rows
mixtrain routine delete embed-new-rows --yes

On this page