Skip to main content

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>/:

FileContents
run.jsonMetadata and status
run_summary.jsonSummary with Brier, ECE, duration
forecasts.jsonlProbabilities and reasoning traces
questions.jsonlInput questions
eval.jsonBrier score decomposition, calibration bins
train.jsonBacktest summary
report.htmlHuman-readable report
provider.jsonProvider and model metadata
events.jsonlPipeline event log

Check Your Setup

xrtm doctor

Shows Python version, package versions, and import health.

Next Steps