pip install praisonai-train is enough, no GPU or [llm] extras needed.
Quick Start
1
Benchmark two deployments
Pass one or more Each target prints as it finishes, then a table ranks them by
--deployment flags. Endpoint and key are read from the AZURE_OPENAI_* / OPENAI_* environment.rows/min:2
Drive it from a YAML config
Put the deployments and knobs in a file and point
--config at it — the same idiom as generate and validate.How It Works
The benchmark reuses the data generator’s own HTTP path (build_chat_request / resolve_cfg), so measurements reflect a real generation workload — no duplicated request code.
Which json_mode?
json_mode sends a response_format={"type":"json_object"} hint. Turn it off for endpoints that don’t support JSON mode so you measure speed, not JSON-mode support.
CLI Flags
YAML-only keys:
endpoint, api_key, azure, prompt (a {system, user} dict), and request_timeout (default 180).
--deployment is required via flag or config. n < 1 or concurrency < 1 raises ValueError, and a prompt dict without a non-empty user field also raises. If every request fails, the CLI exits 1 with error: every request failed — check endpoint/api_key/deployment and provider availability.Python API
Callbenchmark_deployments directly for notebooks, dashboards, or CI gates.
BenchResult is a dataclass — serialise any result with .as_dict().
Common Patterns
Benchmark across endpoints in one run
Each target may be a dict overridingendpoint, api_key, azure, or api_version — compare an Azure deployment against a self-hosted OpenAI-compatible server side by side.
Use your real prompt
Set an explicitprompt so the benchmark exercises the exact shape you generate with.
Stream progress with a callback
on_result fires as each target finishes — ideal for a live dashboard.
Best Practices
Match concurrency to your provider quota
Match concurrency to your provider quota
concurrency is in-flight requests per deployment. Raise it to saturate a high-quota deployment; lower it to stay under a rate limit. Throughput is measured per wall-clock second, so it already reflects the concurrency you set.Disable json_mode for OpenAI-compatible endpoints
Disable json_mode for OpenAI-compatible endpoints
Set
--no-json-mode (or json_mode: false) for servers without JSON-mode support, otherwise a rejected response_format shows up as failures rather than a speed number.Keep n representative, not huge
Keep n representative, not huge
The default
n=24 is enough to stabilise p50/p95 without a large bill. Raise it only when you need tighter tail-latency numbers.Write JSON output for regressions
Write JSON output for regressions
Pass
--output bench.json (or output: in YAML) and diff runs over time to catch a deployment slowing down.Related
praisonai-train
The training package and all its subcommands.
Dataset Tooling
Generate and quality-check instruction datasets.
Cross-file dedup
Merge parallel generation batches into one deduped file before you fine-tune.
Train CLI
Full flag reference for every train subcommand.
Installation Extras
The train install matrix.

