template, sandboxes use base — a minimal Ubuntu 22.04 image with shell utilities only.
Built-in templates
| Template | What’s preinstalled | Use it for |
|---|---|---|
base | Ubuntu 22.04, git, curl, wget, jq, build-essential | Shell-only workflows, custom toolchains |
python | base + Python 3.10, pip, numpy, pandas, requests, httpx, pydantic | Python scripts, data processing, REST clients |
node | base + Node.js 20 LTS, npm, typescript, yarn | TypeScript / Node scripts, npm packages |
ai-agent | base + Python 3.10 + Node.js 20 + LLM/agent SDKs (full list) | Agent workloads — LangChain, CrewAI, AutoGen, LlamaIndex, MCP |
Built-in templates are versioned with the platform — you don’t need to build
them. They are referenced by name (
template="python", etc.) and pull a
pre-published rootfs image from the Declaw blob store.How to choose
- Need to run a one-off shell command or your own statically-linked binary? →
base - Running Python code, especially with
requests/pandas/numpy? →python - Running a TypeScript or Node.js script? →
node - Running an LLM-driven agent (LangChain, CrewAI, AutoGen, LlamaIndex, OpenAI Agents, MCP)? →
ai-agent
torch, project files baked in, etc.) —
build a custom template. See Build a custom template
below.
Worked examples
Each built-in template has a runnable cookbook example you can copy:base — shell tools
Run
git, curl, and jq end-to-end inside a fresh sandbox.python — pandas analysis
Pipe a CSV through
pandas and read back JSON results.node — TypeScript script
Compile a
.ts file with tsc and run the output with Node.js 20.ai-agent — frameworks check
Boot an agent sandbox and verify the major LLM-framework SDKs import.
ai-agent — KYC with CrewAI
Fintech: four-agent CrewAI KYC pipeline with PII + injection defense.
ai-agent — prior auth with LangGraph
Health-tech: LangGraph workflow with PHI redact + rehydrate around GPT-4.1.
Build a custom template
UseTemplate.build() when none of the built-ins fit — most commonly when
you need additional Python packages, project files copied in, or a different
base image.
- Python
- TypeScript
Build with options
- Python
- TypeScript
TemplateBase model
TemplateBase describes a template configuration before it is built.
| Field | Type | Description |
|---|---|---|
template | str | Dockerfile content for the template image |
alias | str | None | Human-readable name for the template |
cpu_count | int | Default vCPUs for sandboxes from this template (1–8) |
memory_mb | int | Default RAM for sandboxes from this template (128–8192) |
copy_files | list[CopyItem] | Files to copy into the template at build time |
Copy files into a template
UseCopyItem to embed files from the host into the template image at build time.
CopyItem model
| Field | Type | Description |
|---|---|---|
source_path | str | Path on the host machine |
dest_path | str | Destination path inside the template image |
Start background build
Usebuild_in_background() to start a build without waiting, then poll the status.
- Python
Check build status
- Python
BuildInfo model
| Field | Type | Description |
|---|---|---|
build_id | str | Unique build identifier |
template_id | str | None | Set once build completes successfully |
status | TemplateBuildStatus | pending, building, done, or error |
progress | float | Build progress 0.0–1.0 |
error | str | None | Error message if status is error |
logs | list[str] | Build log lines streamed during build |
TemplateBuildStatus enum
| Value | Description |
|---|---|
pending | Build queued, not yet started |
building | Build is in progress |
done | Build succeeded — template_id is set |
error | Build failed — error contains the reason |
Use a custom template
Async template operations
Template builds run on the server. Build time depends on the packages being installed and typically takes 1–5 minutes. Use
build_in_background() for large builds to avoid blocking your process.