Skip to main content
Train agents or fine-tune LLMs without installing the full PraisonAI wrapper. The praisonai-train PyPI package (import: praisonai_train) is Tier 2c — it sits on top of praisonaiagents and gives you the train CLI group and a standalone praisonai-train console script.

Quick Start

1

Agent Training

Improve an agent iteratively — no ML dependencies required.
2

LLM Fine-tuning

Add the [llm] extra to pull the Unsloth/torch stack.

When to Use praisonai-train vs praisonai train

Install the standalone package when you only need training; use the wrapper’s praisonai train when you already run the full stack. Both entry points expose the same commands: every praisonai train <sub> also runs as praisonai-train <sub>.

CLI Subcommands

Five subcommands cover fine-tuning and agent training. See Train CLI for full flags.

Common Patterns

Train, review, apply

Run a training session, inspect the iterations, then bake the best one into your agent.

Apply in Python

Apply a session’s suggestions to an agent directly.

Train on any console

The same commands run identically on macOS, Linux, and Windows — no encoding configuration needed.

Force all iterations

Benchmarks, regression tests, and demos that need to observe the feedback loop across every iteration should pass --no-early-stop (CLI) or no_early_stop=True (Python) so the 9.5 threshold is bypassed.
Without this flag, --iterations behaves as a maximum in LLM-as-Judge mode — training stops as soon as any iteration scores ≥ 9.5.

Windows & non-UTF-8 Consoles

praisonai-train agents renders its summary table with emoji (✅ PASSED, ❌ NEEDS WORK, best-iteration marker) when stdout supports UTF-8, and automatically falls back to ASCII (PASSED, NEEDS WORK, *) when it doesn’t. It detects the console’s encoding at runtime.
The ASCII summary is the correct output on a cp1252 Windows console — not a truncation. The session is saved either way; praisonai-train show <session-id> re-renders it in whichever encoding your current console supports.

Exit Codes

praisonai-train agents reports three distinct outcomes.
On a cp1252 Windows console, a completed training session now exits 0 even if Rich cannot render the summary emoji — you’ll see Training complete but summary could not be displayed: 'charmap' codec can't encode .... Run praisonai-train show <session-id> to inspect the persisted result. If you want the full emoji summary, run chcp 65001 first or set PYTHONIOENCODING=utf-8.

Best Practices

pip install praisonai-train pulls praisonaiagents plus litellm (needed for LLM-as-Judge grading) — enough for agents, list, show, and apply. Add [llm] only when you need Unsloth fine-tuning.
The praisonai-train console script exposes the full train group without installing praisonai. Ideal for lightweight training-only environments.
Existing praisonai.train.*, praisonai.train_vision, and praisonai.upload_vision imports still resolve to the same module objects in praisonai_train. Nothing to migrate.
Backward-compatible: if you already have the wrapper installed, praisonai.train.* imports and the setup-conda-env entry point continue to work unchanged.

Train

Training overview and fine-tuning setup.

Train CLI

Full flag reference for the five subcommands.

Installation Extras

The train install matrix.

Package Tiers

How the six packages stack.

Windows Terminal Encoding

Fix Rich crashes and ASCII rendering on legacy Windows consoles.