.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 raisesValueError with the file path.
Configuration Options
Every top-level key maps onto aComputeConfig field.
ComputeConfig fields
TypeScript / Python
ComputeConfig referencePrecedence
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>thensetup 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.
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
Keep it opt-in
Keep it opt-in
No file means today’s behaviour, byte-identical. Add the file only when you want file-based defaults — nothing else changes.
Prefer file over kwargs
Prefer file over kwargs
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.Set explicit resources
Set explicit resources
State
resources.cpu and resources.memory_mb in CI instead of relying on the 1 CPU / 1024 MB default.Fail-loud setup
Fail-loud setup
Let
setup: commands raise on error. Don’t append || true — you’ll want the failure surfaced, not hidden.Errors
The loader raisesValueError (prefixed with the file path) for malformed files.
env, setup, image, and resources when their nested type is wrong.
Related
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
