Skip to main content

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.32. 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
nn.ByteDecoderPlan, nn.ByteDecoderGeometryPlan Explicit resident byte-LM learning, geometry mixtures, and model checkpoints
nn.ByteCorpusStudy Shared Rust/WASM paired studies, geometry controls, and request-bound pause/resume
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

Optional HF Integration

Portable affine/WaveGate adapters can also execute and learn directly through NativeGeometryRuntime, without Torch, Transformers or NumPy. See native geometry training for saved-state reuse, Rust-owned updates and the still-optional HF boundary.

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.32

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

Built distributions (wheels)

Table of built distributions (wheels) for spiraltorch 0.4.32
File Interpreter ABI Platform Actions
spiraltorch-0.4.32-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for spiraltorch-0.4.32-cp38-abi3-win_amd64.whl
spiraltorch-0.4.32-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.32-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
spiraltorch-0.4.32-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl CPython 3.8 abi3 macOS 14.0+ x86-64, macOS 14.0+ ARM64, macOS 14.0+ universal2 (ARM64, x86-64) Details for spiraltorch-0.4.32-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl

Total release size: 50.2 MB

Release files / spiraltorch-0.4.32-cp38-abi3-win_amd64.whl

Download URL spiraltorch-0.4.32-cp38-abi3-win_amd64.whl
Size 13.6 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b26e26489286f2186d665ce403cf4571014332699e384cc8019a0d0e9fb9c9cc
BLAKE2b-256 checksum
How to use checksums
f1c177fcd69e0cff86481d32bb23b8066dadbd871b5e030f446a8b1f6e2e8704
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.32-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL spiraltorch-0.4.32-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 12.8 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
6db2ad1ff569807110be78234dbbd78b052f6910966180b685139a241b419e1d
BLAKE2b-256 checksum
How to use checksums
8f184cd895dbbc97f10ffcf0aed760a618701aaaed05195490975ab4ddc9cd4c
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.32-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl

Download URL spiraltorch-0.4.32-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl
Size 23.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
fd30adf82fdb0b7bf65ee1f4685728fffd0d03ae3be1f6c764666ded8217f952
BLAKE2b-256 checksum
How to use checksums
fc2b1cf7004317c59fc1a551c507479c990b40720797c75c130dd6b3ddbbdf5a
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.32

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.

Release history Release notifications | RSS feed

This release

0.4.32 This release

3 release files No provenance

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