Skip to main content

A Rust-accelerated, scikit-learn-compatible machine learning library — drop-in replacement with 2-18x speedups

Project description

Thermite ML

A blazing-fast, Rust-accelerated machine learning library for Python — drop-in compatible with scikit-learn.

Thermite: an exothermic reaction that burns at 2500°C. Your ML training should be just as fast.

License: MIT Python 3.8+ Rust PyPI


Why Thermite?

scikit-learn is the most widely-used ML library in the world (40M+ monthly downloads), but its internals are built on NumPy/SciPy/Cython — fast for 2010, but bottlenecked by 2026 standards.

Thermite rewrites the compute-heavy core natively in Rust using explicit SIMD, Rayon multithreading, and matrixmultiply optimizations. We expose the exact same Python API you already know. No new syntax. No migration guide. Just import thermite instead of import sklearn.

Unmatched Capabilities

  • Zero-Copy Polars Integration: Feed Apache Arrow polars DataFrames directly into Thermite's Rust core without any conversion or data duplication.
  • GPU Acceleration (wgpu): Native WebGPU/CUDA hardware acceleration backend thermite-gpu. Dispatch compute shaders for massive ensemble aggregations and matrix multiplications instantly by simply adding device='gpu'.
  • True Parallelism (No GIL): Unlike Scikit-Learn which relies on heavy multiprocess pickling via joblib, Thermite releases the Python GIL during heavy computation. GridSearchCV and RandomizedSearchCV effortlessly scale across all your cores with zero IPC overhead.
  • Native Categorical & Sparse Support: Decision Trees handle categorical features natively (bypassing One-Hot Encoding overhead). LinearRegression and KMeans natively ingest and optimize scipy.sparse matrices.
  • Enterprise Capabilities Built-in: Includes save_checkpoint for distributed resumable training and generate_model_card=True for automated documentation and audit generation.
  • Drop-In Compatibility Trap: If you import a function that Thermite hasn't natively ported yet, it will automatically fall back and import it from sklearn seamlessly.

The Numbers (Performance Superiority)

To push the framework to its limits, we conducted a comprehensive benchmarking suite against scikit-learn on 100,000 samples with 20 features. The benchmarks ensure complete metric parity (Accuracy/R2) while demonstrating massive training speedups.

Model SK Train (s) TH Train (s) Train Speedup
LinearRegression 0.015 0.003 4.65x
LogisticRegression 0.012 0.008 1.63x
RandomForestClassifier 7.532 2.368 3.18x
GradientBoostingRegressor 28.437 11.798 2.41x
KMeans 0.017 0.007 2.41x
MiniBatchKMeans 0.013 0.005 2.64x

Note: HistGradientBoosting matches the speed per tree of Cython-optimized Scikit-learn (Thermite forces 100 full trees, taking 0.75s, ~7.5ms per iteration). Test environment: M2 Apple Silicon.


Installation

pip install thermite-ml==2.6.6

Quick Start: scikit-learn Drop-In

# The API is 100% identical to scikit-learn
from thermite.ensemble import RandomForestClassifier
from thermite.model_selection import train_test_split
from thermite.preprocessing import StandardScaler

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test)

# Opt-in to Hardware Acceleration with `device='gpu'`
# Automatically generate a markdown Model Card for audits
clf = RandomForestClassifier(n_estimators=100, n_jobs=-1, device='gpu')
clf.fit(X_train, y_train, generate_model_card=True)

print(f"Accuracy: {clf.score(X_test, y_test):.4f}")

# Save state directly to disk without pickling overhead
clf.save_checkpoint("model_checkpoint.bin")

Zero-Copy Polars Integration

Traditional scikit-learn forces you to convert polars DataFrames to pandas or numpy, triggering a massive memory copy. Thermite natively ingests the underlying Apache Arrow memory buffers:

import polars as pl
from thermite.linear_model import LogisticRegression
from thermite.polars_compat import make_polars_pipeline

df = pl.read_csv("100GB_dataset.csv")

# Instantly train directly on the Polars DataFrame
model = make_polars_pipeline(LogisticRegression())
model.fit(df.select(pl.exclude("target")), df["target"])

Supported Algorithms

  • Linear Models: LinearRegression, Ridge, Lasso, LogisticRegression (Binary & Multinomial OvR), LinearSVC.
  • Ensembles: RandomForestClassifier, RandomForestRegressor, GradientBoostingClassifier, GradientBoostingRegressor, HistGradientBoostingClassifier, HistGradientBoostingRegressor, IsolationForest.
  • Support Vector Machines: SVC (Kernel SVMs via direct C-bindings for maximal speed).
  • Trees: DecisionTreeClassifier, DecisionTreeRegressor.
  • Clustering: KMeans, MiniBatchKMeans, DBSCAN, SpectralClustering.
  • Decomposition: PCA.
  • Probabilistic: GaussianNB.
  • Preprocessing: StandardScaler, MinMaxScaler, OneHotEncoder, LabelEncoder.
  • Pipelines: Pipeline, ColumnTransformer, GridSearchCV, RandomizedSearchCV, SuccessiveHalvingSearchCV.
  • Next-Gen Extensions: TLearner (Causal Inference), VectorStore (RAG Retrieval), ParameterServer (Federated Learning), QSVC (Quantum SVM).
  • Deep Learning Connectivity: Native __dlpack__ integrations for PyTorch/JAX from_dlpack zero-copy tensor passing.
  • NLP & Text: CountVectorizer, TfidfVectorizer, Word2Vec.
  • AutoML: Rust native BayesianOptimizer utilizing Ridge surrogates.
  • Manifold Learning: TSNE, UMAP.

What Sets Thermite Apart

  1. Rust-Native & Zero-Copy: While similar projects like Intel(R) Extension for Scikit-learn try to accelerate operations by monkey-patching Cython with daal4py, Thermite is rewritten ground-up in Rust. We achieve true zero-copy data transmission for Apache Arrow/Polars AND Deep Learning frameworks (PyTorch/JAX via DLPack).
  2. GPU Native without Heavy Dependencies: Unlike RAPIDS cuML which requires a massive CUDA toolkit installation and strict version matching, Thermite utilizes wgpu to compile compute shaders on-the-fly, allowing it to seamlessly run GPU-accelerated code across Apple Metal, Vulkan, and DirectX 12 hardware without gigabytes of CUDA bloat.
  3. Distributed Computing Preparedness: Thermite's Rust estimators derive Serde enabling high-speed bincode serialization out-of-the-box. This natively plugs into distributed execution engines like Ray and Dask without the heavy overhead of Python's standard pickle.
  4. Federated Learning Ready: Utilize the built-in ParameterServer class to securely aggregate model gradients (like SGD) from distributed client nodes.
  5. Rust AutoML: Instead of looping cross-validation in Python, Thermite provides a fast native BayesianOptimizer.
  6. Native ONNX Export: Export trained core models directly to ONNX binaries with .to_onnx() without overhead.
  7. Advanced Data Imputation: IterativeImputer handles missing values dynamically via Ridge regression.

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

thermite_ml-2.6.6.tar.gz (124.8 kB view details)

Uploaded Source

Built Distributions

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

thermite_ml-2.6.6-cp38-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8+Windows x86-64

thermite_ml-2.6.6-cp38-abi3-win32.whl (972.8 kB view details)

Uploaded CPython 3.8+Windows x86

thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (1.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ i686

thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

thermite_ml-2.6.6-cp38-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

thermite_ml-2.6.6-cp38-abi3-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file thermite_ml-2.6.6.tar.gz.

File metadata

  • Download URL: thermite_ml-2.6.6.tar.gz
  • Upload date:
  • Size: 124.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thermite_ml-2.6.6.tar.gz
Algorithm Hash digest
SHA256 21f2a00023388acfa794ac7d2bdf6ee7584de35ba5afefbebcfe4d3bc92cba78
MD5 3ebacd0e03bf6228b6849f65738023cc
BLAKE2b-256 6b046e030b26cc5f41dd5e9c4aaa7fc672ec20e3ad7dbefc5f8cf4db8b953b6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-2.6.6.tar.gz:

Publisher: release.yml on KartavyaDikshit/Thermite

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

File details

Details for the file thermite_ml-2.6.6-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: thermite_ml-2.6.6-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thermite_ml-2.6.6-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 386c081ff6484ecdf4209b28affd38f7d7847aa0c8599fe913d4f3c2a154e837
MD5 3e0898149df46c1a8250cda928b7a5c5
BLAKE2b-256 eea280f191976655c9f55fd0c5626391c1aa8746e8a90c97e1c32e80e7cfc302

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-2.6.6-cp38-abi3-win_amd64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

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

File details

Details for the file thermite_ml-2.6.6-cp38-abi3-win32.whl.

File metadata

  • Download URL: thermite_ml-2.6.6-cp38-abi3-win32.whl
  • Upload date:
  • Size: 972.8 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thermite_ml-2.6.6-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 053c96a72714c3af88a815b33bb8a67a6a4f0d44e30184500e228ade63a3db8a
MD5 c297fdeca811f626b7ab4b2a798241ba
BLAKE2b-256 21a32345575e4ddaa64acb5e548da52874ee672cf6b2e365eb6b713691bd0f7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-2.6.6-cp38-abi3-win32.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

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

File details

Details for the file thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fabd6de36a5721a15a03dcfd81602aecd19dfae96d681c18d8bbfcbd7e1af0cc
MD5 a37e45835d4e4a528d912b8a450a307a
BLAKE2b-256 5d41951f621dad81cb26d139cad14b06d672679fe7b8cf7b4699608d8e12e179

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

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

File details

Details for the file thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 899c7a6a35e55455c858cbb6de028496dac03d8230d20ba01ae7fbf8036ffde5
MD5 f57655b24a11a292736b263b397beefa
BLAKE2b-256 6f59b4feb6f1ed858623cb83f90fd0218a3257b2c3cc32cc4f860e5e9e1736a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

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

File details

Details for the file thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c5648b22a49114a2c0f68ef09b484bc41d70dcd4c1a9ac235085337d50477403
MD5 a0eaa4b10f95d2cc1b463708d8614641
BLAKE2b-256 4fac8413bebf181a074c995ffa2497b84963f587dbd7b917997ec224b63e26db

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-2.6.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

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

File details

Details for the file thermite_ml-2.6.6-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for thermite_ml-2.6.6-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b1d36a235fd8e70f2c47fb0e5e0548b7e3f7d6b4e5bd09e804b9a389b8df9487
MD5 fd83db2f83d742486b067b17f32e734b
BLAKE2b-256 57f7345a60379897004f6c1fe22e8d63d61b50071ece96a55cf4fff2530a2d23

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-2.6.6-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

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

File details

Details for the file thermite_ml-2.6.6-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for thermite_ml-2.6.6-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 135e612ad1618af674c0595b8e7539432ba9fbf964b5f571a09d655e4fde356c
MD5 96e3707489910a0ebe925e030070b14a
BLAKE2b-256 35ff3e06897424f4c8947b333a8a672f19bf389e93356568b0d437da57fc1e39

See more details on using hashes here.

Provenance

The following attestation bundles were made for thermite_ml-2.6.6-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on KartavyaDikshit/Thermite

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