Skip to main content
Modal is a remote environment provider for task images that can run in cloud sandboxes. It is a good fit for SWE-bench and Terminal-Bench style workloads where the task metadata already identifies a compatible registry image.
NeedLink
Create a Modal accountModal signup
User account setup docsModal user account setup
Create automation tokensModal service users
Token configuration referenceModal token config
Token settings pageWorkspace token settings

First-Time Setup

  1. Create a Modal account from the official signup page.
  2. Configure Modal credentials for the machine that runs AgentCompass.
  3. Export MODAL_TOKEN_ID and MODAL_TOKEN_SECRET, or let the Modal CLI write credentials to ~/.modal.toml.
  4. Run a single AgentCompass task before increasing concurrency.
For local development, the Modal CLI setup flow is usually enough:
modal setup
For automated runners or shared workspaces, create a service user token in Modal and export it in the shell or CI secret store:
export MODAL_TOKEN_ID="..."
export MODAL_TOKEN_SECRET="..."
AgentCompass authentication precedence is:
SourceUse when
environments.modal.token_id and token_secretYou intentionally keep credentials in a private --config file.
MODAL_TOKEN_ID and MODAL_TOKEN_SECRETRecommended for shell sessions, CI, and shared scripts.
~/.modal.tomlConvenient for local development after modal setup or modal token set.
Do not commit Modal tokens to config/defaults.yaml. Use environment variables or a private config file passed with --config.

Verify Credentials

Use the Modal CLI to verify the active credentials:
modal token info
Then run one recipe-backed task with AgentCompass:

SWE-bench Verified

agentcompass run \
  swebench_verified \
  mini_swe_agent \
  your-model \
  --env modal \
  --benchmark-params '{"sample_ids":["astropy__astropy-12907"]}' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY"
The SWE-bench Modal recipe selects the task image from SWE-bench metadata and sets the workspace root to /testbed. You normally do not need to pass image or memory.

Full Benchmark With Concurrency

agentcompass run \
  swebench_verified \
  mini_swe_agent \
  your-model \
  --env modal \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY" \
  --task-concurrency 32
Use lower concurrency when your model endpoint, Modal account limits, or benchmark image startup time becomes the bottleneck.

Provider Params

Common Modal overrides live under environments.modal or --env-params:
FieldUse
app_nameGroup AgentCompass sandboxes under a Modal App.
environment_nameRoute sandboxes to a Modal Environment when your workspace uses environments.
imageUse a registry image when no recipe should select the image.
named_imageUse a published Modal named image.
timeout / idle_timeoutControl sandbox lifetime and idle shutdown.
cpu, memory, gpu, regionRequest resources or placement for heavy tasks.
env_variablesInject non-secret environment variables into the sandbox.

Image Overrides

Use image for a registry image or named_image for a Modal named image only when intentionally overriding recipe behavior.
agentcompass run <benchmark> <harness> <model> --env modal --env-params '{"image":"python:3.13-slim"}'