Skip to main content

Agentic LoRA fine-tuning CLI tool wrapping ostris/ai-toolkit.

Project description

auto_ft

A Python CLI that wraps ostris/ai-toolkit to launch and manage LoRA fine-tuning jobs from a plain shell.

auto_ft does not train anything itself — it composes none of the YAML, runs none of the GPU code. It is a thin orchestration layer: spawn a detached Ostris subprocess, watch the on-disk artifacts, and surface JSON-shaped status the way other shell tools and scripts can consume.

What you get

A nine-subcommand CLI over an existing Ostris install:

Command Purpose
auto_ft init Create .autoft/state.json and register a job.
auto_ft prepare Validate a dataset (count, format, resolution, PIL integrity) and write a hash manifest.
auto_ft train Spawn detached Ostris training; returns in ~2s.
auto_ft status Filesystem-derived job status (running / completed / stopped / stale / failed).
auto_ft logs Tail N lines of train.log (platform-independent).
auto_ft stop Terminate a running job (Windows: TerminateProcess).
auto_ft checkpoints List *.safetensors checkpoints.
auto_ft samples List sample image paths.
auto_ft export Copy a checkpoint to a deployable path.

Every successful invocation emits a single JSON object on stdout. Errors emit {"error_code": "...", "message": "...", "details": {...}} and exit 1.

Install

pipx install auto-ft

auto_ft requires Python 3.11+ and a working ostris/ai-toolkit install on the same machine. The CLI launches Ostris as a subprocess; it does not vendor or install Ostris itself.

Configure Ostris

Tell auto_ft how to find your Ostris install. Two options:

Environment variables:

$env:AUTO_FT_OSTRIS_PYTHON = "C:\path\to\ai-toolkit\venv\Scripts\python.exe"
$env:AUTO_FT_OSTRIS_RUN_PY = "C:\path\to\ai-toolkit\run.py"

Config file at ~/.auto_ft/config.toml:

[ostris]
python = "C:\\path\\to\\ai-toolkit\\venv\\Scripts\\python.exe"
run_py = "C:\\path\\to\\ai-toolkit\\run.py"

Env vars take precedence. If both are absent, auto_ft raises E_OSTRIS_CONFIG_MISSING.

Quickstart

# 1. Register a job in the current project.
auto_ft init --name mydog --trigger zyx --dataset .\images

# 2. Validate the dataset (writes <images>\.auto_ft_prep.json).
auto_ft prepare .\images --trigger zyx

# 3. Hand auto_ft an Ostris-shaped YAML and launch.
auto_ft train .\config.yaml

# 4. Check progress (read-only; no side effects).
auto_ft status mydog
auto_ft logs mydog --tail 50

# 5. When the job is done, export the LoRA.
auto_ft checkpoints mydog
auto_ft export .\output\mydog\mydog.safetensors

auto_ft does not generate the Ostris YAML for you — bring your own, hand-authored or composed by any tool you prefer. The CLI's only YAML requirement is that config.process[0].training_folder is an absolute path; Ostris owns the <training_folder>/<config.name>/ join itself.

Trust boundary

auto_ft is a thin wrapper. When you run auto_ft train cfg.yaml, you are trusting:

  • the Python CLI you installed (this package), and
  • the Ostris installation pointed at by AUTO_FT_OSTRIS_PYTHON / AUTO_FT_OSTRIS_RUN_PY.

The CLI never imports ai-toolkit; it only spawns the Ostris Python interpreter as a subprocess. Resume semantics, model loading, GPU ownership — everything compute-bearing — happens inside Ostris.

Status

Alpha (0.1.x). Tested on Windows 10/11 with NVIDIA 8GB VRAM running SDXL LoRA training. The CLI itself is arch-agnostic — any model Ostris can train, auto_ft can launch — but only the SDXL path has been exercised end-to-end so far.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auto_ft-0.1.1.tar.gz (57.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auto_ft-0.1.1-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file auto_ft-0.1.1.tar.gz.

File metadata

  • Download URL: auto_ft-0.1.1.tar.gz
  • Upload date:
  • Size: 57.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for auto_ft-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ac347f24c48b1c3d128f7974dc692693172d3b4ff637853fc30d7be38f29036c
MD5 2b998d8ac7b5340de00435417d4044e0
BLAKE2b-256 14565f8559de2f333cde39c17934c341f81ca54aa00e0728e03409997dee529c

See more details on using hashes here.

File details

Details for the file auto_ft-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: auto_ft-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for auto_ft-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3146525d3fd6d0a12a617de18fe3491d8dd69d5b9422e3d244297bab8befab8b
MD5 b8815f69ca7759e8d8bd3347c10b3ab8
BLAKE2b-256 755b9a5d4e6f9ce1a09417137c07e3cb5abcdfd3b32c35cf96885600aa325ea1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page