AAnvio
Runtimes & Model Routing

Remote Runtimes

SSH, Daytona, Modal, and Singularity — remote and sandboxed shell execution, distinct from the agent-capable runtime providers.

3 min read

Remote runtimes execute a shell command in a remote or isolated environment. They are not agent runtimes in the same sense as local/claude-code/cursor/codex — none of them implement a working run() agent loop. Each throws AnvioError('VALIDATION_ERROR', ...) if you try to call .run() on it directly; the real entry point is execRemote(), exposed through anvio runtime exec.

Agent streaming on SSH/Daytona/Modal/Singularity is deferred — these are for remote/container shell command execution, not for running a full agent session on a remote host. See docs/47-remote-runtimes.md.

Providers

IDClassBacking mechanismConfigured when
sshSshRuntimeProviderShells out to the local ssh binaryANVIO_SSH_HOST set, or ANVIO_SSH_MOCK=1
daytonaDaytonaRuntimeProviderHTTP POST /exec to Daytona APIDAYTONA_API_KEY set, or ANVIO_DAYTONA_MOCK=1
modalModalRuntimeProviderHTTP POST /exec to Modal APIMODAL_TOKEN_ID + MODAL_TOKEN_SECRET set, or ANVIO_MODAL_MOCK=1
singularitySingularityRuntimeProviderShells out to the local singularity/apptainer binarySINGULARITY_IMAGE set, or ANVIO_SINGULARITY_MOCK=1

All four ship with a mock mode — a dedicated ANVIO_<ID>_MOCK=1 environment variable that runs the command through a local sh -c subprocess instead of the real remote backend, for development and CI without live credentials or infrastructure.

SSH

ANVIO_SSH_MOCK=1 anvio runtime exec ssh -- echo remote-ok
anvio runtime exec ssh -- uname -a       # requires ANVIO_SSH_HOST set
anvio runtime test ssh                    # connectivity check

SshRuntimeProvider.execRemote() shells out to the system ssh binary — ssh -p <port> <user>@<host> <command> — using spawnSync. No SSH library dependency, no persistent connection pooling.

Env varPurposeDefault
ANVIO_SSH_HOSTRemote host—
ANVIO_SSH_USERRemote userroot
ANVIO_SSH_PORTSSH port22
ANVIO_SSH_MOCKSkip real SSH, run locally—

Daytona and Modal

Both are serverless sandbox APIs, wired through a shared RemoteRuntimeStub base class that POSTs { command, runtime } to <apiUrl>/exec with a bearer token, and parses back { stdout, stderr, exitCode }.

ANVIO_DAYTONA_MOCK=1 anvio runtime exec daytona -- echo ok
ANVIO_MODAL_MOCK=1 anvio runtime exec modal -- echo ok
ProviderEnv varsDefault API URL
DaytonaDAYTONA_API_KEY, DAYTONA_API_URLhttps://api.daytona.io
ModalMODAL_TOKEN_ID, MODAL_TOKEN_SECRET, MODAL_API_URLhttps://api.modal.com

Singularity / Apptainer

Unlike Daytona/Modal, Singularity is a local HPC container runtime — Anvio shells out to the singularity/apptainer binary directly, the same pattern DockerRuntimeProvider uses for docker. No cloud API call.

ANVIO_SINGULARITY_MOCK=1 anvio runtime exec singularity -- echo ok

# Real usage: point at a SIF image or a docker:// URI
export SINGULARITY_IMAGE=docker://ubuntu
anvio runtime exec singularity -- uname -a
anvio runtime test singularity
Env varPurposeDefault
SINGULARITY_IMAGESIF path or docker:// URI—
SINGULARITY_BINARYBinary namesingularity
ANVIO_SINGULARITY_MOCKSkip real exec, run locally—

What's genuinely production-ready here

Per docs/69-post-v1.17-gap-register.md (updated 2026-07-02):

  • SSH remote exec, Daytona/Modal serverless exec, and Singularity local container exec are all shipped — execRemote() works end to end against a real backend when credentials/binaries are present, not just mock mode.
  • What genuinely isn't verified yet is a live soak test against real Daytona/Modal accounts in this repo's environment — the HTTP client code path is implemented and unit-tested, but nobody has run it against production Daytona/Modal credentials from this codebase.

Not yet shipped

Full agent execution (tool loop, streaming, subagents) on any remote runtime is not implemented — only single shell-command exec via execRemote(). If you need an agent to run remotely with tools, route it through local/claude-code/etc. on a host reached via one of these exec providers, rather than expecting the remote runtime itself to drive the agent loop.

Edit on GitHub

Last updated on

On this page