← All courses ← Course home

Lesson 08 of 08

End-to-end checklist

One clear pass from licensed local images to a measured, baked Core AI generator. Freeze VAE, text encoder, and UNet, attach LoRA to UNet attention, merge into the UNet, then export the ordinary graph with its VAE parts.

Agent brief (llms.md)

Why this checklist is what you deliver

If you put the model on a phone, you do not deliver a notebook. You deliver a baked UNet (LoRA merged in), the VAE and text-encoder parts the graph needs, the notes that can rebuild that folder, and a device measurement. If any box below is missing, the work is still a demo, not a finished delivery.

The sibling course, LLM LoRA for your writing style, uses this same bake-then-export rule on text. Complete both if you want both methods.

The steps, one box at a time

EvidenceHoldout samples pass
EvidenceHoldout samples pass
MergeAdapter is baked in
EvidenceHoldout samples pass
MergeAdapter is baked in
ExportRecipe writes resources
EvidenceHoldout samples pass
MergeAdapter is baked in
ExportRecipe writes resources
DeviceApp loads and measures

Environment setup

Replay the Mac environment before you say you are done. Use Python 3.11+, uv, and MPS or CPU.

curl -LsSf https://astral.sh/uv/install.sh | sh
mkdir -p diffusion-lora-coreai && cd diffusion-lora-coreai
uv init --python 3.11
uv venv
uv add torch torchvision diffusers peft transformers accelerate datasets safetensors coreai-torch
uv run python -c "import torch; print(torch.__version__); print('MPS:', torch.backends.mps.is_available())"
uv run coreai.diffusion.export --help
xcodebuild -version

Before training

During training

At merge, export, and device

Failure modes

Done when

Keep learning

PyTorch to Core AI in Xcode · From the metal to the model · Core AI models, typed · Model architectures in plain English · LLM LoRA for your writing style

Key concepts

  • Delivery is the baked resource, rebuild notes, device measurement, and eval artifacts.
  • Before train: licensed data, holdout, and a contract that forbids runtime LoRA swap.
  • At ship: merge, export, intact folder, Xcode 27 prepare-once, and lesson 07 eval.
  • Keep the adapter separately for retrain and rebuild.

Takeaways

  • Missing holdout or device time is an untested claim.
  • A new engineer should rebuild from the manifest without guessing flags.
  • The product is the baked .aimodel plus notes, not the adapter alone.