Skip to main content
Runtime selection lets you pick which execution backend (Claude Code, Codex CLI, the built-in PraisonAI runtime) runs each model — declared on the model map, not the agent.
The user chooses a runtime backend for the agent; PraisonAI resolves CLI versus native execution for each model.

Quick Start

1

Simple Usage

2

With Configuration

How It Works

Resolution order (from RuntimeResolver):
  1. Per-model runtimemodel_runtime_configs[model_name]
  2. Per-provider defaultprovider_runtime_configs[provider_name]
  3. Auto-selectionresolve_runtime() picks the highest-priority runtime whose supports(model_ref) returns true; see Agent Runtime Protocol
  4. Built-in default"praisonai"
  5. Legacy cli_backend — emits DeprecationWarning
Provider is inferred from the model name: split on / first, otherwise claude*anthropic, gpt*/openai*openai, gemini*/google*google, llama*meta.

Configuration

Agent parameter forms

Invalid types raise:

YAML — choose your level

AgentRuntimeConfig options

Helper methods: 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 require an adapter whose SUPPORTS_RUNTIME_FEATURES = True (the built-in praisonai adapter has it). Frameworks without that flag raise:
Third-party adapters opt in by setting SUPPORTS_RUNTIME_FEATURES = True on their subclass — see Capability Flags.

Fail-closed behaviour

Unknown runtime IDs raise — they do not silently fall back:
Top-level RuntimeError from Agent:
If you typo a runtime ID, the agent fails at start. This is intentional — silent fallbacks should not ship to production.

Common Patterns

  1. One provider, one runtime everywhere — set providers.anthropic.runtime_default: claude-code.
  2. Mix runtimes per modelmodels.claude-3-sonnet.runtime: claude-code plus models.gpt-4o.runtime: praisonai.
  3. Per-agent override — agent-level runtime beats 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).
For automatic YAML migration, run praisonai doctor fix --execute (or praisonai doctor runtime --fix --execute) — see Runtime Config Migration. Agent-level YAML warning:

Best Practices

Keep runtime choice with the model, not the role. Use models.<name>.runtime unless one agent truly needs an override.
providers.<name>.runtime_default makes adding new models painless — new models inherit the provider backend automatically.
Typo’d runtime IDs should fail at startup, not silently fall back to the built-in runtime.
Use the migration table above or praisonai doctor fix (the shorter equivalent of praisonai doctor runtime --fix) before 2.0.0 removes cli_backend.

Agent Runtime Protocol

Plugin harness registry, register_runtime, and praisonai.runtimes entry points

Runtime Preflight

Validate team YAML before AgentTeam.start()