Quick Start
1
Install Dependencies
2
Set API Key
3
Initialize Agents
4
Start Server (localhost)
5
Start Server (public bind)
A non-localhost host requires an API key:
6
Verify
Security
praisonai serve agents drives YAML-defined tools (including execute_command), so binding it to a non-localhost interface without authentication is refused.
Authorization: Bearer β¦ header (mirrors jobs/server.py).
Python - Single Agent
Python - Multi-Agent
Multiple
Agent / Agents instances may call .launch(port=N) concurrently from different threads β registration is atomic. If two launch calls use the same path on the same port, the second gets an auto-suffixed path (/path_abc123) and a warning is logged. Server readiness is signalled deterministically (no fixed sleep); .launch() returns only after the port is accepting connections. The wait defaults to 5 seconds and is configurable via the PRAISONAI_SERVER_READY_TIMEOUT environment variable. If the server doesnβt become ready in time, .launch() still returns and a warning is logged β check server logs for startup errors.agents.yaml
CLI Commands
launch() Parameters
Endpoints
/agents and /agents/{agent_name} share one pipeline. The named-agent route previously used a hand-rolled agent that dropped every safety/reliability field; both routes now apply identical YAML lowering.Example Request/Response
Request:Remote Access
Usehost="0.0.0.0" to allow remote connections. For praisonai serve agents, a non-localhost bind requires an API key (see Security):
agents):
How It Works
Theagents server builds one shared generator per app and routes every request through the same YAML pipeline.
- Generator cached per app. A FastAPI
lifespanbuilds a singleAgentsGeneratorat startup andclose()s it at shutdown β no per-request YAML re-parse, framework re-resolution, or fresh 32-worker tool-timeout pool on every call. - Concurrency-safe. Concurrent requests are serialised on the shared
cli_configvia a per-appasyncio.Lock. - Graceful fallback. If the cached generator canβt be built, the server falls back to the per-request
praisonai.arunpath. - Route convergence. Both
/agentsand/agents/{agent_name}run through the cached generator, so both apply identical YAML lowering (ToolResolver,tool_timeout,approval,guardrails, retry policy).POST /agents/{agent_name}returns404for an unknown name.
Environment Variables
Troubleshooting
Related
- Agents API Reference - Full API documentation
- Agents MCP - Deploy agents as MCP server
- Tools MCP - Deploy tools as MCP server
- Deploy CLI - Deploy using praisonai deploy

