Skip to content

Releases: t81dev/t81lib

v0.1.0

11 Dec 20:41

Choose a tag to compare

t81lib v0.1.0 – Balanced Ternary Arithmetic for the AI Era

The first public release of t81lib — a header-only, C++20 balanced-ternary arithmetic library with full, high-performance Python bindings via pybind11.

Highlights

  • Arbitrary-precision balanced ternary (±1, 0) integers via t81::BigInt
  • Theoretical maximum density: ~2.63 bits per digit
  • Full operator support: arithmetic, comparison, bitwise, shifts, serialization
  • Zero-allocation, fully constexpr-friendly core
  • Pure header-only C++ implementation (include/t81/)
  • Native Python wheel built from sdist — zero compiler required at install time
  • Apple Silicon (arm64) + macOS universal binary included
  • Modern pybind11 bindings (C++20, no legacy py::self)

Why it matters

Balanced ternary is the most information-dense integer representation possible.
This is the foundational layer for the upcoming T81Q (ternary GGUF quantization), ternary-native transformers, and the entire T81 Ecosystem.

Installation

pip install t81lib

Quick test

from t81 import BigInt

a = BigInt("999999999999999999999999999999999999999999")
b = BigInt("-170141183460469231731687303715884105727")

print(a + b)
print(a * a)
print(f"Bit length: {a.bit_length()} bits")

Roadmap

  • v0.2.0 – Ternary GGUF reader/writer + fast dequant kernels
  • v0.3.0 – T81Q (2.63-bit) quantization support for llama.cpp-style models
  • v1.0.0 – Full ternary transformer inference engine

The future is ternary.

t81dev – December 2025