Skip to main content

sutra-compiler

The compiler for the Sutra programming language — a purely functional language whose primitives are tensor operations on frozen-LLM embedding vectors.

Install

pip install sutra-dev                     # validator + codegen only
pip install "sutra-dev[runtime]"          # adds torch so --emit / --run can execute the generated module
pip install "sutra-dev[runtime,embed]"    # adds the embedding client for LLM-substrate codebooks

Requires Python 3.11+.

Use

After install, the sutrac command is on your $PATH.

# Validate a .su source file.
sutrac path/to/program.su

# Validate every .su file under a directory.
sutrac path/to/directory

# Compile to self-contained PyTorch Python and print to stdout.
sutrac --emit path/to/program.su

# Compile and execute in one step (requires the [runtime] extra installed).
sutrac --run path/to/program.su

# Step-by-step compilation review (source → AST → inline → simplify → emit).
sutrac --review path/to/program.su

# Cross-file class-name casing check.
sutrac --consistency path/to/directory

sutrac --help lists every flag.

What is Sutra

A .su source file looks like TypeScript — functions, classes, && / ||, string and numeric literals — but every value is a vector in a frozen LLM embedding space, and every operation is a tensor op on those vectors. The compiler emits self-contained Python that calls a small runtime; chains of bind / unbind / bundle / similarity reduce to chains of matrix multiplies that the simplifier folds into cached matrices at compile time.

The result is a program where there are no Python branches, no host-side if / while on data values, and no JIT — just one straight-line tensor expression.

For a full introduction, see sutra.topazcomputing.com. For the language specification and design rationale, see the Sutra repository.

Status

Research-grade. Versions before 1.0 may break source compatibility. The grammar is stable; the codegen and the standard library still move.

Metadata

Release files for sutra-dev 1.1.0

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

Source distribution (sdist)

Source distribution for sutra-dev 1.1.0
File Size Uploaded
sutra_dev-1.1.0.tar.gz 541.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sutra-dev 1.1.0
File Interpreter ABI Platform
sutra_dev-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 931.3 kB

Release files / sutra_dev-1.1.0.tar.gz

Download URL sutra_dev-1.1.0.tar.gz
Size 541.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ec85a4e49814de968f434dde493f80f9f47595ba8e29612e190099cdfb3aee9c
BLAKE2b-256 checksum
How to use checksums
f7de496211aeb37418c4359c619d75c5ea92226c880799b898fe088a04254a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.

Transparency log

Release files / sutra_dev-1.1.0-py3-none-any.whl

Download URL sutra_dev-1.1.0-py3-none-any.whl
Size 389.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dae15eb5e30eaa970393fb3e7e71e12028def60ad8b584f7f08364468de97cad
BLAKE2b-256 checksum
How to use checksums
e9f1c6cfd9f99eb0872d433152a814ac76ee9ebbfeb3ed1fd6e459b03eeba8f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.10.0

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.2.0

2 release files

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