Skip to main content
HostedAgent hosts the whole agent loop in any registered compute runtime — pick one with a single string.

Quick Start

1

Anthropic-hosted loop

2

Daytona-hosted loop


Which provider should I pick?

The scenario picks the string.

How it resolves — the backend registry

HostedAgent(provider=...) is a factory: it looks the provider up in ManagedBackendRegistry and returns the resolved backend. anthropic is a builtin; every registered compute runtime — docker included as of PR #4077 — resolves through the same registry and runs on one generic backend.

Provider matrix


Custom image / template

Since PR #4077 the generic backend honours image= — one string maps to each provider’s native concept.
The default image is python:3.12-slim; image= is honoured only when set to something other than that default.

Daytona notes

Two Daytona defects were fixed in PR #4074.
Memory unit. ComputeConfig takes memory_mb (megabytes). Daytona’s native unit is GiB, so the provider converts automatically — memory_gib = max(1, round((memory_mb or 1024) / 1024)). The default ComputeConfig() now provisions 1 GiB instead of asking for 1024 GiB. Sub-1024 MB requests floor to 1 GiB (never 0).
File uploads. Uploading a local file copies the file’s contents to the remote destination (upload_file(content, remote_path)). Earlier versions swapped the arguments and wrote the path string into a file named after the content.

What HostedAgent will NOT accept

openai, gemini, ollama, and local are LLM routing names, not runtimes. HostedAgent raises ValueError("... not yet available. Use LocalAgent ...").

Common Patterns

Swap the provider without touching agent code

The provider is one string; the agent stays the same.

Pick the provider per environment

Read the provider from an env var to switch cloud vs local.

Best Practices

provider="anthropic" needs only ANTHROPIC_API_KEY — no extra install, no daemon. Reach for a compute runtime when you need your own isolation, persistence, or a specific cloud.
Pass the provider as a plain string from config or an env var. Every registered runtime shares the same HostedAgent(provider=..., config=...) shape, so switching clouds never touches agent code.
openai, gemini, ollama, and local are not runtimes. Use LocalAgent(config=LocalAgentConfig(model="...")) for those, and add compute="..." when you want cloud-sandboxed tools with a local loop.
daytona is the only runtime in the matrix that persists between runs — pick it when you want a dev workspace to survive across sessions. Remember memory_mb is megabytes; the provider converts to GiB.

Hosted Agent

The base class and its Anthropic path.

Placement — where does my agent run?

Short form: Agent(run_on="daytona").

Managed Backend Plugins

Register your own runtime via entry points.

Self-Hosted Agent (Docker)

provider="docker" runs the whole loop in a container you own.