# AI use cases for AI Toolkit (ostris/ai-toolkit)

Repo: [ostris/ai-toolkit](https://github.com/ostris/ai-toolkit) | Use cases: 3 | Page: https://dedupedai.com/use-cases/ostris-ai-toolkit/

AI Toolkit is an all in one training suite for diffusion models, aimed at consumer hardware. It trains LoRAs for image, edit, video and audio models such as FLUX.1, Qwen-Image, SDXL and Wan 2.2, and runs as a CLI with YAML configs or as a web UI on port 8675, with guides for training on Modal or RunPod.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Train a FLUX LoRA from a YAML config: https://dedupedai.com/use-cases/ostris-ai-toolkit/train-a-flux-lora-from-a-config-with-ai-toolkit/
- Manage training jobs from the web UI, with a token: https://dedupedai.com/use-cases/ostris-ai-toolkit/run-and-secure-the-ai-toolkit-web-ui/
- Train a LoRA on a rented GPU with Modal: https://dedupedai.com/use-cases/ostris-ai-toolkit/train-a-lora-on-modal-with-ai-toolkit/

## How to train a FLUX LoRA from a YAML config with AI Toolkit

Repo: [ostris/ai-toolkit](https://github.com/ostris/ai-toolkit) | Difficulty: Advanced | Time: half a day | Basis: From the README

Copy the example FLUX LoRA config, point it at a captioned image folder and run it from the command line.

**Who it is for:** A creator who wants a model that reproduces their own style or subject.

**The problem:** Base image models do not know your character, product or art style.

**The outcome:** A trained LoRA with checkpoints and sample images in an output folder.

### Steps

1. Clone the repo with `git clone https://github.com/ostris/ai-toolkit.git` and `cd ai-toolkit`, then create a venv with `python3 -m venv venv` and `source venv/bin/activate`
2. Install torch as the README shows, then `pip3 install -r requirements.txt`
3. Prepare a dataset folder of jpg, jpeg or png images, each with a .txt caption file of the same name
4. Copy `config/examples/train_lora_flux_24gb.yaml` into the config folder, edit it following its comments, and run `python run.py config/whatever_you_want.yml`

### Prompt to paste into your agent

```text
Using ostris/ai-toolkit, set up the venv, build a captioned dataset from <my image folder>, copy train_lora_flux_24gb.yaml into config with my dataset path and a trigger word, and start training with python run.py.
```

### Caveat

The README warns that pressing ctrl+c while a checkpoint is saving will likely corrupt it.

Risk, legal: Train only on images you have rights to, and follow the base model's license, such as the FLUX.1-dev terms.

Risk, credentials: Gated models need a Hugging Face read token; keep it out of shared configs.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ostris-ai-toolkit/train-a-flux-lora-from-a-config-with-ai-toolkit/

## How to manage training jobs from the web UI, with a token with AI Toolkit

Repo: [ostris/ai-toolkit](https://github.com/ostris/ai-toolkit) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Start the AI Toolkit UI to start, stop and monitor jobs, and protect it with an auth token when it runs on a server.

**Who it is for:** Someone training on a rented or shared GPU box.

**The problem:** Watching long training jobs over SSH is clumsy, and an open UI on a server is a risk.

**The outcome:** A browser UI at port 8675 that asks for your token.

### Steps

1. Install AI Toolkit and Node.js > 20
2. From the repo run `cd ui` and `npm run build_and_start`
3. On any network that is not secure, start it with `AI_TOOLKIT_AUTH=super_secure_password npm run build_and_start` using your own strong token
4. Open the UI at port 8675 and start or monitor jobs; the UI does not need to stay running for jobs to run

### Prompt to paste into your agent

```text
With ostris/ai-toolkit, build and start the UI from the ui folder with AI_TOOLKIT_AUTH set to a strong random token, and tell me the URL and how to stop it.
```

### Caveat

The README calls the AI Toolkit Manager install path experimental; the manual install still works.

Risk, security: Do not expose port 8675 on a public server without AI_TOOLKIT_AUTH; anyone could start jobs on your GPU.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ostris-ai-toolkit/run-and-secure-the-ai-toolkit-web-ui/

## How to train a LoRA on a rented GPU with Modal with AI Toolkit

Repo: [ostris/ai-toolkit](https://github.com/ostris/ai-toolkit) | Difficulty: Advanced | Time: half a day | Basis: From the README

Use the README's Modal path to run a training config on a cloud A100 and download the result from a Modal volume.

**Who it is for:** A creator without a big local GPU.

**The problem:** Consumer laptops cannot train FLUX LoRAs.

**The outcome:** A LoRA trained in the cloud and downloaded to your machine.

### Steps

1. Set up AI Toolkit locally, then run `pip install modal` and `modal setup` to authenticate
2. Run `huggingface-cli login` with a READ token and request access to FLUX.1-dev
3. Copy an example config from config/examples/modal, edit run_modal.py with your local path, GPU and timeout, then run `modal run run_modal.py --config-file-list-str=/root/ai-toolkit/config/whatever_you_want.yml`
4. Check results with `modal volume ls flux-lora-models` and download with `modal volume get flux-lora-models your-model-name`

### Prompt to paste into your agent

```text
Using ostris/ai-toolkit's Modal guide, prepare a config from config/examples/modal for <my dataset>, update run_modal.py, and give me the exact modal run command and the volume commands to fetch the LoRA.
```

### Caveat

Follow the example /root/ai-toolkit paths in the Modal config exactly, as the README stresses.

Risk, cost: Modal bills GPU time; the README default is an A100 40GB with a 2 hour timeout.

Risk, credentials: You authenticate Modal and Hugging Face on your machine; never paste those tokens into configs you share.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/ostris-ai-toolkit/train-a-lora-on-modal-with-ai-toolkit/
