praisonai-train fine-tune into a form, a live loss chart, and a run history — all against your local engine.
praisonai-train llm CLI. The engine writes a config.yaml, spawns python -m praisonai_train llm --config <run_dir>/config.yaml as its own process group, and reports on it live.
Quick Start
1
Open the Train tab
Click Train in the sidebar. The app remembers your last-picked view, so it reopens where you left off. The one exception is a launch where the engine still needs setup or has failed — the app forces Chat while the wizard/banner is on screen, and returns to your saved view once the engine is healthy (PraisonAI #4471).
2
Pick a model and dataset
Defaults are
unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit on yahma/alpaca-cleaned — leave them to try a first run.3
Click Start training
The button becomes Training…. A live loss chart appears and the log auto-follows.
4
Close the lid — come back
Reopen the app; the Train tab reattaches to the running job and repopulates step, loss, elapsed, and log.
How It Works
The engine runs one job at a time and keeps its progress in a replayable ring buffer, so closing the window never loses a run. The engine parses two line shapes from the trainer’s output: astep / total tqdm bar and the {'loss': ..., 'learning_rate': ..., 'epoch': ...} dict trl prints each logging step. Everything else is shown verbatim in the log pane.
The full log is persisted to
<PRAISONAI_DESKTOP_HOME>/runs/<run_id>/train.log (UTF-8, errors="replace", flushed per line so it is readable while the run is live), and the config is written next to it as config.yaml (JSON if PyYAML is missing). See Data & Privacy for where PRAISONAI_DESKTOP_HOME points.Reconnect & resync
Opening the tab after a gap replays from your cursor; a long run that overflowed the ring buffer tells you so rather than silently skipping output.Choosing a method
method picks the trainer. sft works with the default dataset; the rest need differently-shaped data, named in the per-method hint under the dropdown.
Configuration
The form posts aconfig object to /train/start. Basic fields are always visible; LoRA and quantization live in the Advanced panel.
Advanced — LoRA & quantization
Advanced — LoRA & quantization
Fixed by the engine
Fixed by the engine
Before writing Publishing is opt-in from the CLI — see Train → Publishing.
config.yaml, the engine pins these so a desktop run stays local:Environment variables
Common Patterns
First fine-tune. Open Train, keep the defaults, click Start. Watch the loss drop as the log follows; the model saves tooutputs/.
Interrupted run. Close the lid mid-training. Hours later, reopen the app — the Train tab reattaches, the loss chart repopulates from history, and the run finishes.
Second start while one is running. Forget a run is going and click Start again — the UI surfaces the engine’s 409 message and re-enables the button. The live run is not disturbed.
Stop. Click Stop; the run and all its dataloader workers die together. The status pill turns cancelled and the log tail is preserved.
Reference
Every route lives on the local engine (127.0.0.1, no auth — the app’s existing design for every route).
SSE event kinds:
start, state, log, progress, metric, end, plus resync when history was evicted past your cursor.
Run summary shape: {id, state, step, total, started, ended, error, elapsed, last_loss}. state is one of running, done, failed, cancelled, stopping.
Best Practices
Keep max_steps small for a first run
Keep max_steps small for a first run
max_steps is omitted when 0 (“no cap”). Set a small value like 10 for a fast smoke test, then raise or remove it once the pipeline is green.One GPU runs one job
One GPU runs one job
The engine refuses a second run rather than queueing. Stop the live run (or let it finish) before starting another — a
409 names the blocking run id.Read the method hint before switching
Read the method hint before switching
Preference methods (
dpo, orpo, kto, cpo) and reward need differently-shaped datasets. The hint under the dropdown names the required columns; the CLI pages have the full shape.Use a separate CUDA env for the trainer
Use a separate CUDA env for the trainer
praisonai-train pulls torch and unsloth. Keep those in a matched CUDA venv and point the engine at it with PRAISONAI_TRAIN_CMD — the desktop engine itself stays stdlib-only.Related
Chat & Streaming
Messages, streaming events, and tool cards in the Desktop app
Data & Privacy
Where runs live and what
PRAISONAI_DESKTOP_HOME controlsTrain (CLI)
The
praisonai-train llm command this tab wrapsPreference Tuning
DPO, ORPO, and KTO dataset shapes and options

