fix¶
Fix a broken existing pipeline definition.
<model-dir> is the path to a model version directory containing a definition.py,
e.g. models/sentiment/v1/.
What it does¶
- Reads the existing
definition.py - Validates it against a sample input you provide
- If validation passes — reports success and exits (nothing to fix)
- If validation fails — sends the error + current code to the LLM for a fix
- Re-validates the fixed code; retries up to 3 times
- Shows a unified diff of the proposed changes
- Writes the fixed file only after you confirm
Example¶
You will be prompted for a sample input to run the pipeline against.
Retry behaviour¶
Up to 3 fix attempts are made. Each failure sends the latest traceback back to the LLM. If all 3 attempts fail, the command exits with an error and the original file is left unchanged.
Notes¶
- Only
load()andpredict()are ever rewritten. The rest ofdefinition.py(imports,MODEL_NAME,build_pipeline) is preserved. - The command is interactive-only. It requires a TTY to prompt for sample input and confirmation.

