tuiml create-algorithm: register a user-authored algorithm.
tuiml_create_algorithm tool. It stores the submitted source under ~/.tuiml/user_algorithms/ and adds the class to the component registry, so the rest of the CLI and every MCP tool can use it by class name.Functions
Validate, save, and register a new user-authored algorithm.
The source must define exactly one @classifier or @regressor class. It is checked with an AST denylist before anything is written (no subprocess, socket, os, urllib or requests imports; no eval, exec, open or __import__ calls), then saved to ~/.tuiml/user_algorithms/.
Once saved the class is added to the component registry under its own class name, so every other command and MCP tool (tuiml train, tuiml describe, tuiml_benchmark) can use it immediately. Each version is also registered under the pinned alias , so two versions of the same algorithm can compete in a single experiment.
Requires TUIML_ALLOW_USER_ALGORITHMS=1 in the environment.
Register a classifier whose source lives in a local file:
$ tuiml create-algorithm --name MyKNN --kind classifier \
--code "$(cat my_knn.py)"
Submit an explicit version and description:
$ tuiml create-algorithm --name MyKNN --kind classifier --version 1.1.0 \
--description "kNN with distance weighting" --code "$(cat my_knn.py)"
Overwrite an existing version instead of bumping it, printing raw JSON:
$ tuiml create-algorithm --name MyKNN --kind classifier \
--code "$(cat my_knn.py)" --force --json-output
Options
--name
--kind
--code
--version
--description
--force/--no-force
--json-output