Quick Start
How It Works
Resolution order (fromRuntimeResolver):
- Per-model runtime —
model_runtime_configs[model_name] - Per-provider default —
provider_runtime_configs[provider_name] - Auto-selection — placeholder; currently returns
None(reserved for a future release) - Built-in default —
"praisonai" - Legacy
cli_backend— emitsDeprecationWarning
/ first, otherwise claude* → anthropic, gpt*/openai* → openai, gemini*/google* → google, llama* → meta.
Configuration
Agent parameter forms
| Form | Example | When to use |
|---|---|---|
str (runtime ID) | runtime="claude-code" | Most cases |
dict | runtime={"runtime": "claude-code", "config_overrides": {...}} | Inline overrides |
AgentRuntimeConfig | runtime=AgentRuntimeConfig(runtime="claude-code", ...) | Full programmatic control |
None (default) | omit | Use model-map / provider-default / built-in |
YAML — choose your level
AgentRuntimeConfig options
| Option | Type | Default | Description |
|---|---|---|---|
runtime | Optional[str] | None | Runtime ID (e.g. "claude-code", "codex-cli", "praisonai") |
config_overrides | Dict[str, Any] | {} | Runtime-specific config passed to the runtime factory |
provider_default | Optional[str] | None | Provider default (YAML providers.<name>.runtime_default) |
enable_auto_selection | bool | True | Allow auto-selection step in resolution order |
metadata | Dict[str, Any] | {} | Free-form metadata |
from_runtime_id(id, **kwargs), from_dict(d), to_dict(), merge_overrides(overrides), with_runtime(id), is_explicit().
Built-in runtime IDs
Reference IDs:"claude-code", "codex-cli", "praisonai". Built-in default is "praisonai".
Framework gate
Runtime features only work withframework: praisonai. Other frameworks raise:
Fail-closed behaviour
Unknown runtime IDs raise — they do not silently fall back:RuntimeError from Agent:
Common Patterns
- One provider, one runtime everywhere — set
providers.anthropic.runtime_default: claude-code. - Mix runtimes per model —
models.claude-3-sonnet.runtime: claude-codeplusmodels.gpt-4o.runtime: praisonai. - Per-agent override — agent-level
runtimebeats model/provider config when one role needs different behaviour.
Migration from cli_backend
cli_backend still works but emits DeprecationWarning (slated for removal in 2.0.0).
praisonai doctor runtime --fix --execute — see Runtime Config Migration.
Agent-level YAML warning:
Best Practices
Prefer model-map config over agent-level
Prefer model-map config over agent-level
Keep runtime choice with the model, not the role. Use
models.<name>.runtime unless one agent truly needs an override.Always set a provider_default
Always set a provider_default
providers.<name>.runtime_default makes adding new models painless — new models inherit the provider backend automatically.Don't catch the fail-closed error
Don't catch the fail-closed error
Typo’d runtime IDs should fail at startup, not silently fall back to the built-in runtime.
Migrate cli_backend to runtime
Migrate cli_backend to runtime
Use the migration table above or
praisonai doctor runtime --fix before 2.0.0 removes cli_backend.Related
CLI Backend Protocol
Legacy cli_backend reference (deprecated — see Runtime Selection)
YAML Configuration Reference
Full YAML field reference including models.*.runtime
Runtime Preflight
Validate team YAML before AgentTeam.start()
Runtime Config Migration
Migrate legacy cli_backend with praisonai doctor runtime —fix

