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

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

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.30
File Interpreter ABI Platform Actions
spiraltorch-0.4.30-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for spiraltorch-0.4.30-cp38-abi3-win_amd64.whl
spiraltorch-0.4.30-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.30-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
spiraltorch-0.4.30-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.30-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl

Total release size: 47.8 MB

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

Download URL spiraltorch-0.4.30-cp38-abi3-win_amd64.whl
Size 13.0 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f122d2d4d2f46dc0413f60349839dc757409b5d453ee864f78e6da8972d91dba
BLAKE2b-256 checksum
How to use checksums
6b6c4084d458aeece679a8fd1fda5906de7f6764dfe269321b9f57955430166e
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.30-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL spiraltorch-0.4.30-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 12.2 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a3cfe817c5ab3e8bed55c912cbd6c51b5bd3111ce59575292e8b2904b9073752
BLAKE2b-256 checksum
How to use checksums
d305cdfbf658e0745f7024b9a2471b5aade3bd7d75afbf9d9b2497fa3952f4db
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.30-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl

Download URL spiraltorch-0.4.30-cp38-abi3-macosx_14_0_x86_64.macosx_14_0_arm64.macosx_14_0_universal2.whl
Size 22.5 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
639746fd7852d81a89bfd81c952047fa89418561ac633b4bdf0d035d0c5fab8c
BLAKE2b-256 checksum
How to use checksums
a430909cb417e53be98b3b07c396b8e2207d7e6c9135835518b7cf340129de56
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.30

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