Skip to main content
One .praisonai/environment.yaml file declares your project’s execution environment; every compute= backend reads it automatically.

Quick Start

1

Create the file

Commit .praisonai/environment.yaml at your repo root with an image and one package:
2

Enable compute — the file is picked up automatically

Add compute="docker". No image or packages kwargs; the file supplies them.

How It Works

provision_compute() walks up from the current directory, loads the file into a ComputeConfig, then provisions the backend.

The Full File

Exactly these top-level keys are accepted; anything else raises ValueError with the file path.

Configuration Options

Every top-level key maps onto a ComputeConfig field.

ComputeConfig fields

TypeScript / Python ComputeConfig reference

Precedence

Explicit kwargs win, then the instance config, then the file, then hard-coded defaults — so no file means today’s behaviour, byte-identical. Pick the surface that matches where your config should live:

setup: Commands

setup: runs once, post-provision, before any agent work — perfect for bootstrapping the repo.
  • Runs once, after packages install, before the agent starts.
  • Output is streamed to logs ([docker_compute] setup: <cmd> then setup output: <stdout>).
  • A failing command raises RuntimeError — it is not silently swallowed.
  • On failure during packages or setup, the just-started container is torn down so no orphan is leaked; the caller never receives an instance_id.
Do not wrap setup commands in || true. A silent failure leaves a half-built environment; fail-loud surfaces the error immediately.

Common Patterns

Pin the image

Lock the base image so every teammate and CI run starts identical.

Bootstrap the repo

Install the current project in editable mode before the agent runs.

Per-CI vs per-dev env

Set project variables in the file so they travel with the repo.

Loader used directly

Read the file yourself when you need the resolved config in code.

Best Practices

No file means today’s behaviour, byte-identical. Add the file only when you want file-based defaults — nothing else changes.
Commit .praisonai/environment.yaml so the environment is reviewable in PRs and reproducible across CI and dev. kwargs still win when you need a one-off override.
State resources.cpu and resources.memory_mb in CI instead of relying on the 1 CPU / 1024 MB default.
Let setup: commands raise on error. Don’t append || true — you’ll want the failure surfaced, not hidden.

Errors

The loader raises ValueError (prefixed with the file path) for malformed files.
The last shape also applies to env, setup, image, and resources when their nested type is wrong.

Local Agent

Run the agent loop locally with any LLM and cloud-sandboxed tools

Sandbox

Tool execution sandboxing options

ComputeConfig reference

Full ComputeConfig field reference