Getting Started
XRTM runs event-forecasting workflows. You'll need an API key for any OpenAI-compatible endpoint.
Install
pip install xrtm
Requires Python 3.11+.
Get an API Key
XRTM works with any provider that speaks the OpenAI Chat Completions API. Sign up for one and get an API key.
Create a .env file in your working directory:
OPENAI_API_KEY=sk-your-key-here
OPENAI_BASE_URL=https://your-endpoint
OPENAI_MODEL=your-model
The only required variable is OPENAI_API_KEY. Set OPENAI_BASE_URL and OPENAI_MODEL if your provider needs them.
Run a Forecast
xrtm start
This loads questions from the built-in corpus, runs forecasts through your provider, scores them, and writes artifacts. You should see something like:
┌─────────────────────────────────┐
│ Forecast Complete │
│ ─────────────────────────────── │
│ 5 forecasts · Brier 0.089 │
│ Duration 12.4s │
│ Artifacts → runs/20260607T... │
└─────────────────────────────────┘
Override defaults with flags:
xrtm start --model your-model --base-url https://your-endpoint --limit 10
Inspect Results
xrtm runs show --latest
What Each Run Produces
Every run writes these files to runs/<run-id>/:
| File | Contents |
|---|---|
run.json | Metadata and status |
run_summary.json | Summary with Brier, ECE, duration |
forecasts.jsonl | Probabilities and reasoning traces |
questions.jsonl | Input questions |
eval.json | Brier score decomposition, calibration bins |
train.json | Backtest summary |
report.html | Human-readable report |
provider.json | Provider and model metadata |
events.jsonl | Pipeline event log |
Check Your Setup
xrtm doctor
Shows Python version, package versions, and import health.
Next Steps
- Framework — use the Python API directly
- CLI Reference — all commands and flags
- Architecture — how the layers fit together