The Learning/Optimization layer for XRTM.
Project description
xrtm-train
The Optimization Layer for XRTM.
xrtm-train is the engine that closes the loop. It simulates history by replaying agents against past "Ground Truth" snapshots stored in xrtm-data, scoring them with xrtm-eval, and optimizing their reasoning parameters.
Part of the XRTM Ecosystem
Layer 4: xrtm-train → (imports all) ← YOU ARE HERE
Layer 3: xrtm-forecast → (imports eval, data)
Layer 2: xrtm-eval → (imports data)
Layer 1: xrtm-data → (zero dependencies)
xrtm-train sits at the top of the stack and can import from ALL other packages. Installing xrtm-train gives you the full XRTM stack.
Installation
pip install xrtm-train
This automatically installs
xrtm-forecast,xrtm-eval, andxrtm-data.
Core Primitives
The Simulation Loop
The Backtester orchestrates the simulation. It ensures strict temporal isolation—agents are never exposed to data from the future.
from xrtm.train import Backtester
# Initialize components
backtester = Backtester(agent=my_agent, evaluator=my_evaluator)
# Run simulation
results = await backtester.run(dataset=historical_questions)
print(f"Mean Brier Score: {results.mean_score}")
Examples (v0.1.2+)
With the v0.6.0 architecture split, calibration and replay examples now live here:
- Calibration Demo: Adjusting confidence intervals to match reality.
- Trace Replay: Re-running a saved execution for debugging.
- Evaluation Harness: End-to-end backtest with metrics.
Project Structure
src/xrtm/train/
├── core/ # Interfaces & Schemas
│ └── eval/ # Calibration (PlattScaler, BetaScaler)
├── kit/ # Training utilities
│ ├── memory/ # Replay buffers
│ └── optimization/ # Training strategies
├── simulation/ # Backtester, TraceReplayer
└── providers/ # Remote training backends (future)
Development
Prerequisites:
# Install dependencies
uv sync
# Run tests
uv run pytest
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
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_train-0.2.1.tar.gz.
File metadata
- Download URL: xrtm_train-0.2.1.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b96a0246a9d4b6bf56fcf3d4f3845e981466b14acc0a705a1c1273c1ff41f1c
|
|
| MD5 |
9355a8687be47b0722632cee01be4933
|
|
| BLAKE2b-256 |
aff7a3b7a15dfa518c012603717b42c236b337add91ea236a321e29593f9d8d7
|
Provenance
The following attestation bundles were made for xrtm_train-0.2.1.tar.gz:
Publisher:
publish.yml on xrtm-org/train
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrtm_train-0.2.1.tar.gz -
Subject digest:
8b96a0246a9d4b6bf56fcf3d4f3845e981466b14acc0a705a1c1273c1ff41f1c - Sigstore transparency entry: 957956216
- Sigstore integration time:
-
Permalink:
xrtm-org/train@8b51634a7baf162a98fb1d43a0803340c683012c -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/xrtm-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b51634a7baf162a98fb1d43a0803340c683012c -
Trigger Event:
release
-
Statement type:
File details
Details for the file xrtm_train-0.2.1-py3-none-any.whl.
File metadata
- Download URL: xrtm_train-0.2.1-py3-none-any.whl
- Upload date:
- Size: 38.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a09bf8f5ee009e42feee1483284e23b93df2c04fbc46fdcdee83bd4d6370c8ab
|
|
| MD5 |
b71b2f46910d79f215e09d834ea77ff8
|
|
| BLAKE2b-256 |
8c2838cbe3cbd7ff342cb0a941bfc348864532eb57901028a5a13d91dd9afef7
|
Provenance
The following attestation bundles were made for xrtm_train-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on xrtm-org/train
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrtm_train-0.2.1-py3-none-any.whl -
Subject digest:
a09bf8f5ee009e42feee1483284e23b93df2c04fbc46fdcdee83bd4d6370c8ab - Sigstore transparency entry: 957956244
- Sigstore integration time:
-
Permalink:
xrtm-org/train@8b51634a7baf162a98fb1d43a0803340c683012c -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/xrtm-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b51634a7baf162a98fb1d43a0803340c683012c -
Trigger Event:
release
-
Statement type: