Metadata-Version: 2.4
Name: xrtm
Version: 0.9.1
Summary: The xRtm Framework (Generative Forecasting).
Author-email: XRTM Team <moy@xrtm.org>
License-Expression: Apache-2.0
Project-URL: Repository, https://github.com/xrtm-org/xrtm
Project-URL: Documentation, https://xrtm.org
Project-URL: Issues, https://github.com/xrtm-org/xrtm/issues
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: xrtm-data>=0.2.7
Requires-Dist: xrtm-eval>=0.2.7
Requires-Dist: xrtm-forecast>=0.6.11
Requires-Dist: xrtm-train>=0.2.8
Dynamic: license-file

# XRTM v0.9.0 — AI for Event Forecasting

[![PyPI](https://img.shields.io/pypi/v/xrtm?style=flat-square)](https://pypi.org/project/xrtm/)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](LICENSE)

**XRTM** runs event-forecasting workflows from the command line. It uses a deterministic baseline by default (no API keys needed) and supports any OpenAI-compatible endpoint for real LLM forecasts.

## Install

```bash
pip install xrtm
```

Python >=3.11,<3.14.

## Quick Start

```bash
# Deterministic baseline (no API key)
xrtm start

# With a real LLM via any OpenAI-compatible endpoint
xrtm start --provider openai --model deepseek-v4-pro --base-url https://api.deepseek.com

# Inspect results
xrtm runs show --latest
```

## Commands

| Command | What it does |
|---------|-------------|
| `xrtm start` | Run forecasts (deterministic or real LLM) |
| `xrtm demo` | Quick 2-question deterministic demo |
| `xrtm doctor` | Check Python, packages, imports |
| `xrtm runs show --latest` | Inspect the most recent run |

## Providers

| Provider | API key needed |
|----------|---------------|
| `deterministic` (default) | None |
| `openai` / `openai-compatible` | `OPENAI_API_KEY` |

Set `OPENAI_API_KEY`, `OPENAI_BASE_URL`, and `OPENAI_MODEL` in your environment or `.env` file.

## Run Artifacts

Each run produces 11 artifacts in `runs/<run-id>/`:
`run.json`, `eval.json`, `train.json`, `forecasts.jsonl`, `report.html`, `blueprint.json`, `provider.json`, `questions.jsonl`, `events.jsonl`, `graph_trace.jsonl`, `run_summary.json`

## XRTM Ecosystem

| Package | Role |
|---------|------|
| `xrtm-data` | Schemas & question sources (real-binary corpus, Polymarket, Metaculus) |
| `xrtm-eval` | Scoring (Brier, ECE, LogScore) |
| `xrtm-forecast` | Runtime engine (agents, providers, topologies) |
| `xrtm-train` | Backtesting & optimization |
| `xrtm` | Product CLI (this package) |

## License

Apache 2.0
