SpiralTorch Python bindings
A Rust-first learning stack, with a Python door into Z-space.
Native tensors, autograd, neural modules, geometry, and runtime contracts live in Rust. Python connects them to experiments and other ML libraries without making NumPy, PyTorch, Transformers, or provider SDKs mandatory dependencies.
Install
python -m pip install -U spiraltorch
Package version: Version 0.4.29. Wheels target CPython 3.8+, Linux x86_64, Windows x86_64, and macOS 14+ universal2. The default wheel includes WGPU with CPU fallback; a compatible GPU and the appropriate execution route are still required for GPU use.
Source version metadata does not prove publication; check the PyPI release history for available wheels. This source tree can be ahead of PyPI. The documentation links below follow main and identify source-only paths where applicable. Check the package changelog and your installed version before using a new API.
First Model
import spiraltorch as st
from spiraltorch.nn import Linear, Sequential
print("CPU:", st.describe_device("cpu")["backend"])
model = Sequential()
model.add(Linear(2, 2, name="head"))
print(model(st.Tensor(1, 2, [0.25, 0.75])).tolist())
Native Gradients
Differentiate a squared norm with Rust-owned autograd, without NumPy or PyTorch:
import spiraltorch as st
x = st.AutogradTensor.variable(st.Tensor(1, 2, [1.0, -2.0]))
x.hadamard(x).sum().backward()
assert x.grad().tolist() == [[2.0, -4.0]]
print(x.grad().tolist())
This uses host tensors. Continue with learning recipes, geometric learning, or direct Rust use.
Find Your Entry Point
| Surface | Purpose |
|---|---|
Tensor, AutogradTensor |
Native tensors and Rust-owned reverse-mode differentiation |
nn, optim, SpiralSession |
Modules, training, optimization, and runtime planning |
ecosystem |
Explicit tensor exchange with other ML libraries |
ApiLLMZSpaceRuntime |
Connect hosted-model responses to Z-space runtime traces |
runtime_import_preflight_report |
Check optional HF/Torch/PEFT dependencies before a larger run |
- Getting started: tensors, models, and learning loops.
- Python recipes: sessions, trainers, geometry, API inference, and ecosystem bridges.
- Capability reference: runtime contracts, numerical APIs, optional surfaces, and source-only additions.
- Model zoo: runnable language-model and other learning examples.
- Resident NN training: explicit GPU-resident execution and weight handoff.
- DLPack interoperability: ownership and copy policies for tensor exchange.
Optional HF Integration
python -m pip install 'spiraltorch[hf-runtime]'
Optional runtime packages do not download a model or start training. See the HF optimizer study for matched experiments, supported routes, and limitations. Geometric interventions and conventional backend speed are separate evaluation questions.
Build, Test, and Release
Use the wheel build and validation guide for source builds, an explicit CPU-only feature set, and smoke commands. The release runbook keeps immutable tags, signed wheels, and verified PyPI publication together.
Full documentation · Z-space introduction · GNU AGPL-3.0-or-later
Metadata
Release files for spiraltorch 0.4.29
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spiraltorch-0.4.29-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details for spiraltorch-0.4.29-cp38-abi3-win_amd64.whl |
| spiraltorch-0.4.29-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details for spiraltorch-0.4.29-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| spiraltorch-0.4.29-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl | CPython 3.8 | abi3 | macOS 14.0+ ARM64, macOS 14.0+ universal2 (ARM64, x86-64), macOS 14.0+ x86-64 | Details for spiraltorch-0.4.29-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl |
Total release size: 46.4 MB
Release files / spiraltorch-0.4.29-cp38-abi3-win_amd64.whl
| Download URL | spiraltorch-0.4.29-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2a76b8a0ee62fc8be1e83fecc102e68cf0a8295187b298a8e244b1df0ff8df83
|
|
BLAKE2b-256 checksum How to use checksums |
bb14c93022e31d68b5dcb5ed77d43a2bdbb88fe9372e409a975241af9ccf7886
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / spiraltorch-0.4.29-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | spiraltorch-0.4.29-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 11.9 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c1aa2c140e47d216125588da50a9568224d80722fbb9cb6807f6aed7b8a46891
|
|
BLAKE2b-256 checksum How to use checksums |
36ad951b91f28c10eef988a6207425ea0bc8b2dce98cacdf4079f783fbc16d95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / spiraltorch-0.4.29-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl
| Download URL | spiraltorch-0.4.29-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl |
|---|---|
| Size | 21.8 MB |
| Tags | CPython 3.8 abi3 macOS 14.0+ ARM64 macOS 14.0+ universal2 (ARM64, x86-64) macOS 14.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
23b3640588b51ecb8fee842b841f832098dcbcaba89c65f56d26bd8314181e46
|
|
BLAKE2b-256 checksum How to use checksums |
6c684e4ad38a5eb429172dd08d20b511feb741f68b7e221660c1e247307a85cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for spiraltorch 0.4.29
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.