WMO optimizes agent workflows from traces through a three-step process:
- Build a simulation using text world models grounded on your traces.
- Fit a router that determines which model every request should be sent to.
- Train custom open source models just for your agent.
First, collect OpenTelemetry traces from your current agent. If you just want to try it out, grab the public terminal-tasks OTLP dataset:
curl -L -o traces.otel.jsonl \
https://huggingface.co/datasets/experiential-labs/wmo-terminal-tasks-traces/resolve/540883e451dc13d34fb50fdd36b143cb0f1fb0db/traces.otel.jsonlThen install the package and build a project. The build command walks you through providers, models, and budget, and asks for your trace file:
pip install world-model-optimizer
# Build simulation from your agent traces and optimize a router against it
wmo build support-agent
# Run your router as an OpenAI compatible endpoint
wmo run support-agent
# Send a request to your endpoint
curl http://127.0.0.1:8000/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"model":"support-agent","messages":[{"role":"user","content":"Help me"}]}'After collecting traces from your router, fine-tune an open source model you own using Tinker.
wmo optimize model support-agentCall an optimized router programmatically:
from pathlib import Path
from wmo import load_project_router
from wmo.common.models import ModelMessage, ModelRequest
router = load_project_router("support-agent", Path(".wmo"))
result = router.complete(
ModelRequest(
messages=(
ModelMessage(role="user", content="Help me reset my password"),
),
)
)Anonymous aggregate PostHog product telemetry is enabled by default. It never includes prompts, traces, actions, observations, paths, model names, credentials, or raw customer content.
wmo config telemetry status
wmo config telemetry disable
wmo config telemetry enableThe preference is stored locally in .wmo/settings.toml.
uv sync --extra dev
uv run ruff format --check .
uv run ruff check .
uv run ty check
uv run pytest -qRepository and documentation conventions live in AGENTS.md.
