Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Stratum logo

Python CI Rust CI codecov License Python

Stratum is an ML system for efficiently executing large-scale agentic pipeline search. It integrates with MLE agents by representing batches of agent-generated pipelines as lazily evaluated DAGs, applying logical and runtime optimizations, and executing them across heterogeneous backends, including a Rust-based runtime. Stratum builds on skrub's operator abstraction and is under active development.


Design Principles

  • Provide seamless and unrestricted support for arbitrary ML libraries without operator porting.
  • Enable lazy evaluation and provide operator semantics that enable logical rewrites and cost-based optimizations.
  • Implement a runtime with efficient operator kernels (in Rust), scheduling across CPUs, GPUs, and distributed backends, plus runtime optimizations such as buffer pools, reuse of intermediates, and inter- and intra-operator parallelization.

Installation

Install the current development build from PyPI:

python -m pip install "stratum-ai==0.0.0.dev1"

Pre-built Rust wheels are provided for the supported CPython 3.11+ platforms, so a Rust toolchain is not required for a normal installation. The source-build instructions below are for contributors developing Stratum itself.

For source development, you need Python 3.11+, a Rust toolchain (nightly not required; stable is fine), and maturin (python -m pip install maturin).

From the repository root, install the extension in editable (development) mode:

maturin develop --release

For more details (including building wheels), see the Developer Instructions section below.


Usage

To leverage stratum, agent prompts or pipelines need minor changes. Prompts should be modified to generate code following skrub DataOps syntax.

Stratum can also significantly speed up human-written skrub code.

The following flags enable different features of Stratum. These flags can be set via environment variables or directly in code:

import stratum

stratum.set_config(
    rust_backend=True,
    scheduler=True,
    stats=True,
    debug_timing=False,
)

Example Code

import stratum as skrub #drop-in replacement
from sklearn.preprocessing import OneHotEncoder
from sklearn.linear_model import LinearRegression

def main():
    dataset = skrub.datasets.fetch_employee_salaries()
    df = skrub.as_data_op(dataset.employee_salaries).skb.subsample()
    df_clean = df.dropna()
    y = df_clean["current_annual_salary"].skb.mark_as_y()
    X = df_clean.drop(columns=["current_annual_salary"]).skb.mark_as_X()

    skrub.set_config(rust_backend=True, debug_timing=True, scheduler=True, stats=True)
    tv = skrub.TableVectorizer(high_cardinality=skrub.StringEncoder(), low_cardinality=OneHotEncoder(sparse_output=False))
    X_enc = X.skb.apply(tv)
    print(f"Encoded data shape: {X_enc.shape.skb.preview()}")

    pred = X_enc.skb.apply(LinearRegression(), y=y)
    search = pred.skb.make_grid_search(cv=3, fitted=True, scoring="r2", refit=False)
    print(search.results_)

if __name__ == "__main__":
    main()

Repository Layout

stratum/
├─ pyproject.toml           # Project metadata + Python/Rust build config (maturin)
├─ README.md
├─ LICENSE
├─ _rust/                   # Rust crate (PyO3 extension)
│  ├─ Cargo.toml
│  └─ src/lib.rs            # Defines #[pymodule] fn _rust_backend_native(...)
└─ stratum/                 # Python package
   ├─ __init__.py           # Façade over skrub + automatic patching
   ├─ _config.py            # set_config/get_config + runtime/env sync
   ├─ _api.py               # High-level grid search / evaluate helpers
   ├─ _rust_backend.py      # Python <-> Rust shim (re-exports native fns)
   ├─ adapters/             # Public API (dispatch to Rust or fall back to skrub)
   │  ├─ string_encoder.py  # RustyStringEncoder
   │  └─ one_hot_encoder.py # RustyOneHotEncoder
   ├─ optimizer/
   │  ├─ ir/                # DAG representation 
   │  └─ _optimize.py       # logical rewrites
   ├─ runtime/              # Schedulers and runtime execution
   ├─ patching/             # Hooks that patch upstream skrub
   └─ tests/                # Test suite

Developer Instructions

Running the Tests

Install all extras and run the full test suite:

uv sync --all-extras
pytest -v stratum/tests

Or, more concisely:

uv run pytest

Local Dev Install (Editable, without uv)

maturin develop				# Debug mode
maturin develop --release	# Optimized dev build

Building Wheels

This produces redistributable .whl files under dist/.

# Linux / macOS
maturin build --release -o dist --interpreter python3.11 --compatibility linux

# Windows
maturin build --release -o dist

Then install with:

python -m pip install ./dist/stratum_ai-*.whl

License

Apache License 2.0. See LICENSE for details.

Metadata

Release files for stratum-ai 0.0.0.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stratum-ai 0.0.0.dev1
File Size Uploaded
stratum_ai-0.0.0.dev1.tar.gz 205.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for stratum-ai 0.0.0.dev1
File
stratum_ai-0.0.0.dev1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
stratum_ai-0.0.0.dev1-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
stratum_ai-0.0.0.dev1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details
stratum_ai-0.0.0.dev1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
stratum_ai-0.0.0.dev1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 29.7 MB

Release files / stratum_ai-0.0.0.dev1.tar.gz

Download URL stratum_ai-0.0.0.dev1.tar.gz
Size 205.3 kB
Tags Source
SHA-256 checksum
How to use checksums
037bbac88aa833f5a82a3541e2f34aa89f8068c3e516fa0419792880376b998c
BLAKE2b-256 checksum
How to use checksums
89b8ed070faf79b94861a48796cd729f04e73b6ed2712cccebaf7994671ed0fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / stratum_ai-0.0.0.dev1-cp311-abi3-win_amd64.whl

Download URL stratum_ai-0.0.0.dev1-cp311-abi3-win_amd64.whl
Size 17.7 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
457ba05395acd70aaadb05458d1b6d75f2030cbad91688f7d173e9a43996fef9
BLAKE2b-256 checksum
How to use checksums
1021756c52d7a7e910f324dc9cc0998539f7eefabd18c30af7584ea4058e5cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / stratum_ai-0.0.0.dev1-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL stratum_ai-0.0.0.dev1-cp311-abi3-musllinux_1_2_x86_64.whl
Size 4.9 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
af11c62423fa433010c4c0b02d8010e52876fc55f7c1b5fba53155027801a93d
BLAKE2b-256 checksum
How to use checksums
b50c87d0829d57d0a41c1c0b9c1fd129e8594f715c2bf1a60167320c761a1a7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / stratum_ai-0.0.0.dev1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL stratum_ai-0.0.0.dev1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.7 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
644570b73a5724a6cbd6091a418f45bdeaea20b0b1744d573572248ce0349d11
BLAKE2b-256 checksum
How to use checksums
c49992d1d1434632759fd603a0a80ba1444136af3bf33a9f21ddec5fcd5d63c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / stratum_ai-0.0.0.dev1-cp311-abi3-macosx_11_0_arm64.whl

Download URL stratum_ai-0.0.0.dev1-cp311-abi3-macosx_11_0_arm64.whl
Size 1.0 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4e9f0f82b1006aab54b3f16a41c742d59002c37ec126b4ce985e944839a0f38d
BLAKE2b-256 checksum
How to use checksums
58070d2f095a08b57606eccbcab268754eeca4eff559a34bf579dfc033963a45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / stratum_ai-0.0.0.dev1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL stratum_ai-0.0.0.dev1-cp311-abi3-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
87ec20e8990d9c511816cbe385b005da7118b96866c06033e74506d26991b916
BLAKE2b-256 checksum
How to use checksums
00dd9afbc8aa1327cd2ed784382887f67f98e1b1a627c03501b50a274d502d4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page