Institutional-grade modular engine for generative forecasting and agentic reasoning.
Project description
xrtm-forecast v0.7.0
The Runtime Engine for XRTM.
xrtm-forecast provides the agents, providers, topologies, and orchestration to build AI forecasting systems. It's a composable framework — import the pieces you need and wire them together.
Installation
pip install xrtm-forecast
Quick Start
from xrtm.forecast.kit.agents.specialists.analyst import ForecastingAnalyst
from xrtm.forecast.core.config.inference import OpenAIConfig
from xrtm.forecast.providers.inference.factory import ModelFactory
# Use any OpenAI-compatible endpoint
config = OpenAIConfig(
model_id="your-model",
base_url="$OPENAI_BASE_URL",
api_key="your-api-key",
)
provider = ModelFactory.get_provider(config)
analyst = ForecastingAnalyst(model=provider, name="forecaster")
# Ask a forecasting question
from xrtm.data import ForecastQuestion
question = ForecastQuestion(
id="fed-march-2025",
title="Will the Fed raise rates in March 2025?",
)
forecast = await analyst.run(question)
print(f"Probability: {forecast.probability:.2f}")
What's Included
OpenAI-compatible Provider
One provider that works with any OpenAI-compatible API: any OpenAI-compatible endpoint. Set base_url to point anywhere.
Agents
ForecastingAnalyst— Full forecast agent: structured prompts, causal reasoning traces, JSON output parsingLLMAgent— Base agent with tool retrieval, output parsingRoutingAgent— FAST/SMART tiered routing for cost optimizationToolAgent/GraphAgent— Wrap functions or sub-graphs as agents
Topologies
Composable multi-agent patterns in kit/topologies/:
RecursiveConsensus— Parallel analysts → aggregate → supervisor → loopcreate_debate_graph()— Pro/Con/Judge debate patterncreate_fanout_graph()— Parallel workers → aggregator
Orchestration
Orchestrator— DAG state machine for workflow graphsAsyncRuntime— Chronos-aware async runtime
Infrastructure
InferenceCache— SQLite cache for LLM responses (enabled by default)- Retry with backoff — 2 retries on API errors
LeakageGuardian— Temporal leakage prevention for backtests
XRTM Ecosystem
Part of the XRTM forecasting stack:
| Package | Role | Version |
|---|---|---|
xrtm-data |
Schemas & question sources | 0.3.0 |
xrtm-eval |
Scoring (Brier, ECE, LogScore) | 0.3.0 |
xrtm-forecast |
Runtime engine (this package) | 0.7.0 |
xrtm-train |
Backtesting & optimization | 0.3.0 |
xrtm |
Product CLI | 0.9.0 |
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xrtm_forecast-0.8.0.tar.gz.
File metadata
- Download URL: xrtm_forecast-0.8.0.tar.gz
- Upload date:
- Size: 64.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d48b537b4dce305d8483cfbc74222db2be783e4c52b86bb0fb74d1aa02c2eea5
|
|
| MD5 |
003dc3290d5f86e652c4e376dde840e6
|
|
| BLAKE2b-256 |
8c9678cc94828205c6fc8ba381571449447c04735a44a6a58dc4a54ef721794f
|
Provenance
The following attestation bundles were made for xrtm_forecast-0.8.0.tar.gz:
Publisher:
publish.yml on xrtm-org/forecast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrtm_forecast-0.8.0.tar.gz -
Subject digest:
d48b537b4dce305d8483cfbc74222db2be783e4c52b86bb0fb74d1aa02c2eea5 - Sigstore transparency entry: 1874711123
- Sigstore integration time:
-
Permalink:
xrtm-org/forecast@9e8fe051a9a8bb11b879dd497ad2bb418ba5ed4b -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/xrtm-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9e8fe051a9a8bb11b879dd497ad2bb418ba5ed4b -
Trigger Event:
release
-
Statement type:
File details
Details for the file xrtm_forecast-0.8.0-py3-none-any.whl.
File metadata
- Download URL: xrtm_forecast-0.8.0-py3-none-any.whl
- Upload date:
- Size: 101.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
add53faf731d03d6919ef0cf8730157a769cdca729558fa0625d907915806492
|
|
| MD5 |
7cc7e08ce0bf7acabdca9af819ff5fb5
|
|
| BLAKE2b-256 |
fa491695aa5a6f20e14b38da652dbf1ef3bb06b39d3fa60864837e1800eeb5dc
|
Provenance
The following attestation bundles were made for xrtm_forecast-0.8.0-py3-none-any.whl:
Publisher:
publish.yml on xrtm-org/forecast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrtm_forecast-0.8.0-py3-none-any.whl -
Subject digest:
add53faf731d03d6919ef0cf8730157a769cdca729558fa0625d907915806492 - Sigstore transparency entry: 1874711293
- Sigstore integration time:
-
Permalink:
xrtm-org/forecast@9e8fe051a9a8bb11b879dd497ad2bb418ba5ed4b -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/xrtm-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9e8fe051a9a8bb11b879dd497ad2bb418ba5ed4b -
Trigger Event:
release
-
Statement type: