Skip to main content

Institutional-grade modular engine for generative forecasting and agentic reasoning.

Project description

xrtm-forecast v0.7.0

PyPI

License Python

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 parsing
  • LLMAgent — Base agent with tool retrieval, output parsing
  • RoutingAgent — FAST/SMART tiered routing for cost optimization
  • ToolAgent / GraphAgent — Wrap functions or sub-graphs as agents

Topologies

Composable multi-agent patterns in kit/topologies/:

  • RecursiveConsensus — Parallel analysts → aggregate → supervisor → loop
  • create_debate_graph() — Pro/Con/Judge debate pattern
  • create_fanout_graph() — Parallel workers → aggregator

Orchestration

  • Orchestrator — DAG state machine for workflow graphs
  • AsyncRuntime — 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xrtm_forecast-0.8.0.tar.gz (64.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xrtm_forecast-0.8.0-py3-none-any.whl (101.5 kB view details)

Uploaded Python 3

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

Hashes for xrtm_forecast-0.8.0.tar.gz
Algorithm Hash digest
SHA256 d48b537b4dce305d8483cfbc74222db2be783e4c52b86bb0fb74d1aa02c2eea5
MD5 003dc3290d5f86e652c4e376dde840e6
BLAKE2b-256 8c9678cc94828205c6fc8ba381571449447c04735a44a6a58dc4a54ef721794f

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrtm_forecast-0.8.0.tar.gz:

Publisher: publish.yml on xrtm-org/forecast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for xrtm_forecast-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 add53faf731d03d6919ef0cf8730157a769cdca729558fa0625d907915806492
MD5 7cc7e08ce0bf7acabdca9af819ff5fb5
BLAKE2b-256 fa491695aa5a6f20e14b38da652dbf1ef3bb06b39d3fa60864837e1800eeb5dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrtm_forecast-0.8.0-py3-none-any.whl:

Publisher: publish.yml on xrtm-org/forecast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page