Quick Start Guide

July 4, 2026 · View on GitHub

Get Dressage Up and Running in Minutes

← Back to Main README · Prerequisites · Installation · Verify · Agent Modes · First Training · Configuration · Troubleshooting

📖 Overview

This guide walks you through installing Dressage, configuring your environment, and running your first agentic RL training job. By the end, you'll have a working training pipeline — either a whitebox agent (Python tool loop) or a blackbox agent (HTTP agent like opencode or codex) — producing real RL gradients from agent trajectories.

Dressage is designed to get you from zero to training with minimal configuration. The framework uses environment variables and dotted Python import paths for all slime hooks, so there's no config file authoring required.

📋 Prerequisites

RequirementVersionPurposeNotes
Python≥ 3.10Runtime3.11+ recommended for performance
pipLatestPackage installationpip install --upgrade pip
GitAnyClone with submodulesNeeds --recurse-submodules support
SGLangCompatible with slimeInference routerMust be running before training starts
GPUCUDA-capableModel inference and trainingAt least 1 GPU for inference, more for training
Optional Requirements
RequirementPurposeWhen Needed
bubblewrapLocal sandbox isolation via Linux namespacesDRESSAGE_SANDBOX_PROVIDER=local_bwrap
opencodeBlackbox code-editing agentDRESSAGE_BLACKBOX_TYPE=opencode
openclawBlackbox OpenClaw agentDRESSAGE_BLACKBOX_TYPE=openclaw
Codex CLIBlackbox Codex coding agentDRESSAGE_BLACKBOX_TYPE=codex
E2B accountRemote cloud sandboxesDRESSAGE_SANDBOX_PROVIDER=e2b
DockerReproducible local environmentOptional — for containerized setup
faiss-cpuFAISS similarity searchHotpotQA recipe only
sentence-transformersBGE embeddingsHotpotQA recipe only

1️⃣ Installation

Use the slime Base Image

slimerl/slime:nightly-dev-20260430b

Clone the Repository

git clone --recurse-submodules https://github.com/Accio-Lab/Dressage.git
cd Dressage

Tip

The --recurse-submodules flag automatically pulls the slime submodule. If you cloned without it, run git submodule update --init --recursive afterwards.

Install Dressage

# Install Dressage (core package)
pip install --no-build-isolation -e .

# Install BlackboxServer if you use blackbox agents
pip install --no-build-isolation blackbox_server/

# Install slime (upstream RL framework)
pip install --no-build-isolation -e slime/

Install Optional Dependencies

# 🧪 For running tests
pip install -e ".[test]"

# 🔍 For HotpotQA recipe (retrieval dependencies)
pip install faiss-cpu sentence-transformers numpy

Note

The root package currently defines only the test extra. Ray and E2B support are installed as core dependencies; BlackboxServer is installed from blackbox_server/ without editable mode because local bwrap sandboxes do not mount the BlackboxServer source directory.

2️⃣ Verify Installation

After installation, verify that the CLI entry points and test suite work:

# ✅ Check CLI entry points
dressage-proxy --help          # Proxy server
blackbox-server --help         # BlackboxServer, if blackbox_server/ was installed

# ✅ Check bwrap and local blackbox CLIs
dressage-local-bwrap-start --help
dressage-local-bwrap-status --help
dressage-local-bwrap-stop --help
dressage-local-blackbox-start --help
dressage-local-blackbox-status --help
dressage-local-blackbox-stop --help
dressage-blackbox-start --help
dressage-blackbox-status --help
dressage-blackbox-stop --help

# ✅ Run tests
pytest tests/ -x -q

Note

If dressage-proxy is not found, ensure that your Python environment's bin/ directory is in your PATH. For virtual environments: source venv/bin/activate.

To start the proxy manually, provide a tokenizer path:

dressage-proxy \
  --tokenizer-path /path/to/Qwen3.5-4B \
  --sglang-router-url http://<router-host>:8000

Important

For blackbox rollouts, DRESSAGE_PROXY_URL must be reachable from the sandbox. Avoid local-only URLs such as http://localhost:8800 unless the sandbox shares the same network namespace; set PROXY_PUBLIC_HOST or DRESSAGE_PROXY_URL to a sandbox-reachable host.

3️⃣ Choose Your Agent Mode

Dressage supports two agent paradigms. Choose based on your use case:

Whitebox — Python Tool Agents

Best for: custom tools, retrieval, API calls, lightweight environments. You write the agent logic in Python.

Your Python Agent
  └── self.chat(messages)          → Proxy → SGLang
  └── self.paddock.tool_call(...)  → Sandbox (shell, files)

Advantages:

  • Full control over agent prompting and tool logic
  • Easier to debug (Python stack traces)
  • Lower latency (no HTTP agent subprocess)
  • Direct access to LLM responses for custom processing

Get started:

# ALFWorld recipe (TextWorld navigation)
bash examples/scripts/run_alfworld_whitebox_agent_qwen3.5_4b.sh

# HotpotQA recipe (multi-hop retrieval)
bash examples/scripts/run_hotpotqa_whitebox_agent_qwen3.5_4b.sh

Blackbox — HTTP Agent Rollouts

Best for: real-world coding agents, complex environments, production agent frameworks like opencode/openclaw/claude_code/codex.

BlackboxServer (in sandbox)
  └── Backend Agent (opencode/openclaw/claude_code/codex)
      └── Agent's LLM calls → In-process Proxy → Dressage Proxy → SGLang
      └── Agent's tools → execution inside sandbox

For Codex rollouts, BlackboxServer creates an isolated sandbox-local CODEX_HOME and points Codex at the in-process proxy with a custom provider. Do not mount host ~/.codex into the sandbox; it may contain real auth tokens.

Advantages:

  • Use real-world agent frameworks without modification
  • Agent complexity is handled by the backend (no Python coding needed)
  • Full sandbox isolation (agent can't affect the host)
  • Closer to production behavior

Get started:

# Local bubblewrap sandbox
bash examples/scripts/run_blackbox_qwen3.5_4b_async_local.sh

# E2B remote sandbox
bash examples/scripts/run_blackbox_qwen3.5_4b_async_remote.sh

4️⃣ Run Your First Training

Option A: Whitebox Agent (ALFWorld)

The simplest way to start — no sandbox infrastructure needed:

# 1️⃣ Set agent mode
export DRESSAGE_PADDOCK_MODE=whitebox
export DRESSAGE_SANDBOX_PROVIDER=local_bwrap
export DRESSAGE_LOCAL_BWRAP_POOL_MODE=command_only

# 2️⃣ Run training
# The example script sources examples/scripts/default/dressage_env_defaults.sh
# and applies its helper defaults internally.
bash examples/scripts/run_alfworld_whitebox_agent_qwen3.5_4b.sh

Option B: Blackbox Agent (Local Bubblewrap)

For real-world coding agents with full sandbox isolation:

# 1️⃣ Set agent mode
export DRESSAGE_PADDOCK_MODE=blackbox
export DRESSAGE_SANDBOX_PROVIDER=local_bwrap
export DRESSAGE_LOCAL_BWRAP_POOL_MODE=blackbox
export DRESSAGE_BLACKBOX_TYPE=opencode
# Or use Codex CLI:
# export DRESSAGE_BLACKBOX_TYPE=codex

# 2️⃣ Start the bubblewrap sandbox pool
dressage-local-bwrap-start

# 3️⃣ Verify pool is healthy
dressage-local-bwrap-status

# 4️⃣ Run training
# The example script sources examples/scripts/default/dressage_env_defaults.sh
# and applies its helper defaults internally.
bash examples/scripts/run_blackbox_qwen3.5_4b_async_local.sh

# 5️⃣ Stop pool when done
dressage-local-bwrap-stop

Option C: Docker (All-in-One)

For a reproducible environment with all dependencies pre-installed:

# Build the Docker image
docker/build.sh

# Run with GPU access
docker/run.sh
# Starts with: --gpus all --network host --ipc host --privileged

Note

--privileged is required for bubblewrap inside Docker containers. The image includes bubblewrap, opencode, openclaw, Claude Code, Codex CLI, Dressage, BlackboxServer, and all dependencies. See docker/README.md for details.

⚙️ Configuration Reference

All Dressage configuration is via environment variables. Here's the complete reference organized by component:

Agent & Paddock
VariableValuesDefaultDescription
DRESSAGE_PADDOCK_MODEblackbox | whiteboxblackboxAgent interaction paradigm. Determines paddock subclass.
DRESSAGE_PADDOCK_CLASSmodule.ClassCustom paddock class override for specialized lifecycle logic.
Sandbox
VariableValuesDefaultDescription
DRESSAGE_SANDBOX_PROVIDERlocal_bwrap | e2blocal_bwrapSandbox backend. Determines where agent code runs.
DRESSAGE_LOCAL_BWRAP_POOL_MODEblackbox | command_onlyAuto: command_only for whitebox, otherwise blackboxBwrap pool mode. Must match paddock mode.
DRESSAGE_LOCAL_BWRAP_AUTO_START0 | 11 in example scriptsAuto-start the local bwrap pool from run scripts.
DRESSAGE_LOCAL_BWRAP_RAY_NAMESPACEstringdressageRay namespace for local bwrap actors.
DRESSAGE_LOCAL_BWRAP_MANAGER_NAMEstringdressage_local_bwrap_managerRay actor name for the bwrap pool manager.
DRESSAGE_LOCAL_BWRAP_TOTAL_SERVERSintcomputed by scriptsTotal bwrap slots across the Ray cluster.
DRESSAGE_LOCAL_BWRAP_BASE_PORTint31000Base port for local BlackboxServer slots.
DRESSAGE_BLACKBOX_SLOTS_PER_NODEintscript-specificLocal bwrap slot count per Ray node.
DRESSAGE_BLACKBOX_RUNNER_MODEbwrap | bubblewrapbwrapLocal blackbox runner mode.
DRESSAGE_BLACKBOX_BWRAP_BINpathbwrapBubblewrap binary used by local slots.
DRESSAGE_LOCAL_BWRAP_DESTROY_ACTORS_ON_STOP0 | 11Destroy Ray actors when stopping the pool.
DRESSAGE_LOCAL_BWRAP_CLEANUP_ON_EXIT0 | 11Stop the local bwrap pool on example-script exit.
DRESSAGE_BLACKBOX_PRESERVE_SESSION_ARTIFACTS0 | 10Preserve sandbox filesystem after sessions for debugging.
Proxy
VariableValuesDefaultDescription
DRESSAGE_PROXY_URLURLhttp://${PROXY_PUBLIC_HOST}:${PROXY_PORT} in scriptsProxy server endpoint. Must be reachable from sandboxes.
TRAJECTORY_BUILD_MODEconcat | last_stepconcat in scriptsScript helper passed to proxy --trajectory-build-mode.
TITO_MODELstringqwen3_5 in scriptsScript helper passed to proxy --tito-model.
DRESSAGE_PROXY_MAX_STEPS_PER_SESSIONint0 (unlimited)Returns HTTP 400 before the next proxy generation once the session already has this many steps.
Partial Rollout
VariableValuesDefaultDescription
DRESSAGE_PROXY_PAUSE_AROUND_WEIGHT_UPDATE0 | 11Enable proxy pause/resume around weight updates.
DRESSAGE_PROXY_PAUSE_REQUIRED0 | 1Require pause to succeed (fail if proxy unreachable).
DRESSAGE_PROXY_PAUSE_TIMEOUT_SECint300Timeout for pause confirmation in seconds.
Blackbox & BlackboxServer
VariableValuesDefaultDescription
DRESSAGE_BLACKBOX_TYPEopencode | openclaw | claude_code | codexopencodeBackend agent type.
DRESSAGE_BLACKBOX_MAX_STEPSintPositive int forwarded to backend_options.proxy.max_steps; set 0 to disable the backend proxy step limit.
DRESSAGE_BLACKBOX_COMPACT_THRESHOLDintPositive value no greater than the context window; controls backend compaction reserve sizing.
BBS_HOSThost0.0.0.0BlackboxServer bind host.
BBS_PORTport23456BlackboxServer bind port.
BBS_BACKEND_TIMEOUTfloat960.0Agent call timeout in seconds (16 min).
BBS_EXECUTE_CMD_TIMEOUTfloat600.0Shell command timeout in seconds (10 min).
BBS_ROUTER_TIMEOUTint600000Timeout for requests from BlackboxServer's in-process proxy to the upstream router.
BBS_SHUTDOWN_TIMEOUTfloat30.0Shutdown grace period in seconds.
BBS_RUNTIME_HEALTH_CHECK_INTERVALfloat10.0Interval between backend runtime health checks.
BBS_RUNTIME_HEALTH_CHECK_RETRIESint3Runtime health-check retry count.
BBS_RUNTIME_HEALTH_CHECK_RETRY_DELAYfloat0.5Delay between runtime health-check retries.
OPENCODE_BINpathopencodePath to the opencode binary.
OPENCLAW_BINpathopenclawPath to the openclaw binary.
CLAUDE_CODE_BINpathclaudePath to the Claude Code binary.
CODEX_BINpathcodexPath to the Codex CLI binary.
Reward
VariableValuesDefaultDescription
DRESSAGE_REWARD_MODULEScomma-separatedReward function modules to load (e.g., my_project.rewards).
Async Rollout
VariableValuesDefaultDescription
DRESSAGE_PARTIAL_ROLLOUT_TARGET_GROUPSintOverride target groups for partial async mode.
DRESSAGE_PARTIAL_ROLLOUT_TARGET_SAMPLESintOverride partial async readiness by sample count.
DRESSAGE_ASYNC_MAX_ACTIVE_GROUPSintCap active async prompt groups.
DRESSAGE_ASYNC_OUTPUT_QUEUE_SIZEint1000Async worker output queue size.
DRESSAGE_ASYNC_WORKER_STOP_TIMEOUT_SECfloat300Timeout for stopping async workers.
DRESSAGE_ROLLOUT_MAX_RETRIESint2Per-group rollout retry limit.
DRESSAGE_ASYNC_NO_PROGRESS_WARN_SECfloat600No-progress warning threshold.
DRESSAGE_ASYNC_MAX_DROPPED_FAILED_GROUPSintMaximum failed groups that can be dropped by async rollout.
DRESSAGE_ALLOW_EMPTY_TRAIN_BATCH0 | 10Allow empty train batches after failures.
Logging & Debugging
VariableValuesDefaultDescription
DRESSAGE_TRAJECTORY_PAYLOAD_LOG_DIRpathDirectory for trajectory payload logs.
DRESSAGE_TRAJECTORY_ERROR_LOG_DIRpathDirectory for trajectory error logs.
DRESSAGE_LOG_WRITE_MODEbackground | awaitbackgroundLog write mode. background is faster; await ensures logs are flushed before proceeding.

🔧 Slime Wiring Cheatsheet

Quick-reference examples for common training configurations:

Blackbox + Sync + GRPO

The simplest blackbox configuration: synchronous rollout with GRPO advantage estimation.

python3 -m slime.train \
  --custom-generate-function-path \
    dressage.rollout.generate.blackbox_dispatch.generate \
  --rollout-function-path \
    dressage.rollout.sync_rollout.generate_rollout_sync \
  --custom-convert-samples-to-train-data-path \
    dressage.rollout.convert_samples.convert_samples_to_train_data \
  --custom-reward-post-process-path \
    dressage.training.reward_post_process.reward_post_process \
  --custom-rm-path \
    dressage.reward.custom_rm.custom_rm \
  --data-source-path \
    dressage.rollout.data_source.DressageDataSource \
  --custom-rollout-log-function-path \
    dressage.rollout.log_rollout.log_rollout_data \
  --advantage-estimator grpo
Whitebox + Fully Async

Whitebox agents with fully async scheduling use slime's async entry point.

export DRESSAGE_REWARD_MODULES=my_recipe.reward

cd slime
python3 train_async.py \
  --custom-generate-function-path \
    my_recipe.agent.generate \
  --rollout-function-path \
    dressage.rollout.fully_async_rollout.generate_rollout_fully_async \
  --custom-convert-samples-to-train-data-path \
    dressage.rollout.convert_samples.convert_samples_to_train_data \
  --custom-reward-post-process-path \
    dressage.training.reward_post_process.reward_post_process \
  --custom-rm-path \
    dressage.reward.custom_rm.custom_rm \
  --data-source-path \
    dressage.rollout.data_source.DressageDataSource \
  --advantage-estimator grpo

Select a registered reward with sample.metadata["reward_fn"]; omitted values fall back to default.

Whitebox + Sync (Simplest)

The simplest configuration for development and debugging. Synchronous rollout — all samples complete before training.

cd slime
python3 train.py \
  --custom-generate-function-path \
    dressage.recipes.alfworld.agent_whitebox.generate \
  --rollout-function-path \
    dressage.rollout.sync_rollout.generate_rollout_sync \
  --custom-convert-samples-to-train-data-path \
    dressage.rollout.convert_samples.convert_samples_to_train_data \
  --custom-rm-path \
    dressage.reward.custom_rm.custom_rm \
  --advantage-estimator grpo

For example, set DRESSAGE_REWARD_MODULES=dressage.recipes.alfworld.reward so the custom reward registry loads the ALFWorld reward.

🆘 Troubleshooting

Common issues and their solutions:

IssueSymptomsSolution
Proxy connection refusedConnectionRefusedError on chat completionsCheck DRESSAGE_PROXY_URL and ensure the proxy server is running (dressage-proxy).
Bwrap slot unavailableRollout hangs waiting for sandboxRun dressage-local-bwrap-status to check pool health. Ensure enough slots are provisioned.
Mode mismatch errorValueError at startup about paddock/pool modeEnsure DRESSAGE_PADDOCK_MODE matches DRESSAGE_LOCAL_BWRAP_POOL_MODE (blackbox↔blackbox, whitebox↔command_only).
Backend not foundFileNotFoundError for opencode/openclaw/claude binarySet OPENCODE_BIN, OPENCLAW_BIN, or CLAUDE_CODE_BIN to the full path of the binary.
TITO failureWarning about concat_incremental_tokenization_failedCheck model compatibility — TITO currently supports qwen3_5 only. Failure triggers safe segment boundary.
Pause timeoutTimeoutError during weight updateIncrease DRESSAGE_PROXY_PAUSE_TIMEOUT_SEC. Default 300s may not be enough for large batches.
Session desyncBlackboxServer reports desynced stateAgent process may have crashed. Check sandbox logs. Session will be aborted and retried automatically.
Docker bwrap failsBubblewrap errors inside containerEnsure Docker is running with --privileged flag. Required for Linux namespace operations inside containers.
Zero rewardAll trajectories get reward=0.0Check reward function registration. Ensure DRESSAGE_REWARD_MODULES includes your module and @register_reward decorator is applied.

Tip

Enable trajectory payload logging for debugging: export DRESSAGE_TRAJECTORY_PAYLOAD_LOG_DIR=/tmp/dressage_logs. This saves full trajectory data to disk for offline inspection.

📚 Next Steps

After your first successful training run, explore these resources to go deeper:

ResourceDescription
ProxyDeep dive into trajectory recording, TITO, segment boundaries, and routing replay
PaddockUnderstand environment interaction, blackbox vs whitebox, factory pattern
SandboxConfigure isolation backends — bwrap pools and E2B cloud
BlackboxServerSet up blackbox agent rollouts, understand the adapter protocol
RolloutCustomize slime integration, async modes, reward registry
TrainingMulti-segment training, prompt-equal scaling, partial rollout
RecipesBuild your own agents with ALFWorld and HotpotQA as templates

← Recipes · Back to Main README