HostedAgent(provider=...) runtimes — like e2b, modal, or flyio — without editing PraisonAI core.
HostedAgent resolves the provider and runs the agent on that backend.
Quick Start
Simple — Programmatic Registration
Register a backend class directly at runtime (ideal for testing or single-project use):
How It Works
HostedAgent.__new__ acts as a factory for non-Anthropic backends. When the resolved backend class is different from HostedAgent, Python’s __new__ returns the backend instance directly — __init__ is skipped. Callers receive the real backend’s methods without any AnthropicManagedAgent-inherited state:
anthropic backend is pre-registered in ManagedBackendRegistry — it resolves to AnthropicManagedAgent.
Configuration Options
ManagedBackendRegistry API Reference
Complete API reference for ManagedBackendRegistry
| Entry-point group | praisonai.managed_backends |
|---|---|
| Built-in backends | anthropic → AnthropicManagedAgent |
| Discovery | Auto-discovered on first registry access |
Common Patterns
Custom Hosted Runtime
Selecting Between Multiple Registered Backends
Graceful Unavailable-Backend Handling
Best Practices
Entry-point naming conventions
Entry-point naming conventions
Use the provider name as the entry-point key — lowercase, no hyphens. The key becomes the value passed to
provider=:is_available() discipline
is_available() discipline
Always implement Never do heavy imports inside
is_available() with a fast, cached check. The registry calls it during startup probing:is_available() — it is called on every registry probe.Error-message hints
Error-message hints
Include helpful hints in your error messages so users know what to install:
Cleanup hooks
Cleanup hooks
Implement resource cleanup if your backend opens connections or sandbox environments:
Related
Framework Adapter Plugins
Add new execution frameworks via entry points
Hosted Agent
Run agent loops on managed cloud runtimes

