Skip to main content

Training for PraisonAI — LLM fine-tuning (Unsloth) and iterative agent training extracted from the praisonai wrapper.

Project description

PraisonAI Train

Training for PraisonAI — fine-tune LLMs and iteratively train agents, as a standalone package or as part of the full praisonai stack.

What it does

Command What happens Needs GPU/ML deps?
praisonai-train agents --input "What is Python?" Runs your agent, grades the answer with an LLM judge, feeds suggestions back, repeats No
praisonai-train agents --input "Explain AI" --human Same loop, but you give the feedback No
praisonai-train llm dataset.json Fine-tunes an open model (Llama, Qwen, …) on your dataset with Unsloth Yes
praisonai-train list / show / apply Browse training sessions and apply the best iteration to an agent No

Install

# Agent training only (lightweight)
pip install praisonai-train

# + LLM fine-tuning (heavy ML stack: torch, unsloth, trl, ...)
pip install "praisonai-train[llm]"

# Or as part of the full PraisonAI stack (same commands via `praisonai train ...`)
pip install "praisonai[train]"

GPU setups often prefer the conda installer, which pins CUDA-compatible versions:

setup-conda-env   # or: bash praisonai_train/setup/setup_conda_env.sh

Quickstart: train an agent in 2 minutes

export OPENAI_API_KEY=sk-...

# One input, three improvement iterations, LLM-as-judge
praisonai-train agents --input "What is the capital of France?" --iterations 3

# See what happened
praisonai-train list
praisonai-train show <session-id>

# Apply the best iteration and chat with the improved agent
praisonai-train apply <session-id> --run "And what about Germany?"

Python API:

from praisonaiagents import Agent
from praisonai_train import AgentTrainer, TrainingScenario

agent = Agent(instructions="You are a helpful assistant.")
trainer = AgentTrainer(agent=agent, iterations=3)
trainer.add_scenario(TrainingScenario(id="demo", input_text="What is Python?"))
report = trainer.run()
report.print_summary()

Quickstart: fine-tune an LLM

pip install "praisonai-train[llm]"

# dataset.json in ShareGPT or Alpaca format; config.yaml is generated if absent
praisonai-train llm dataset.json --model llama-3.1

Tuning knobs (LoRA rank, epochs, quantization, Ollama/HuggingFace export) live in config.yaml — see the template in praisonai_train/setup/config.yaml.

How it fits the PraisonAI stack

praisonaiagents  (core SDK)
   ├── praisonai-code   (terminal CLI)
   ├── praisonai-bot    (bots & gateway)
   └── praisonai-train  (this package)
        └── praisonai   (wrapper: installs everything)
  • Depends only on praisonaiagents — no circular deps, installs standalone.
  • With the full stack installed, the same commands are available as praisonai train ....
  • Old import paths (praisonai.train.agents, python -m praisonai.train.llm.trainer) keep working via wrapper shims.

Development

# From the monorepo root
cd src/praisonai-train
PYTHONPATH="../praisonai-agents:." python -m pytest tests/unit/train -q

# Import-direction gate (train must not import the wrapper)
bash ../../scripts/check_c10_train_imports.sh

Boundary details: src/praisonai/tests/PRAISONAI_TRAIN_MANIFEST.md.

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

praisonai_train-0.0.2.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

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

praisonai_train-0.0.2-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file praisonai_train-0.0.2.tar.gz.

File metadata

  • Download URL: praisonai_train-0.0.2.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for praisonai_train-0.0.2.tar.gz
Algorithm Hash digest
SHA256 56c255e58de9db616b04d25d04f44811a9adac0ce686717b125ecb52d9840a45
MD5 9902fa81406784fa5330f57eac68e470
BLAKE2b-256 826147591eb2d7a8635752f9cfd5761292a27ff3050cdf91da8d17ff6a2852f0

See more details on using hashes here.

File details

Details for the file praisonai_train-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for praisonai_train-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 455e752859911930ddb982079aca1016d9a4d71ae9bb99e10476670d2888ddc2
MD5 62e2b0cc0648fd54b9ff17d8e4c99c69
BLAKE2b-256 0c35e6754f2102637eb01098ce62d2d4f420cd95f68b511c9afc933e282c8bda

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