Skip to main content

xeno_py

PyPI distribution: xenocodec (pip install xenocodec, then import xeno_py).

Python bindings for the XENO v7 BF16 codec (core/xeno_cross.h), plus a small compressed tensor container and a vector index.

import numpy as np, xeno_py
w = np.random.randn(16384 * 4).astype(np.float32)   # any float32 tensor
xeno_py.save("w.xn16", w)                            # BF16 + XENO v7, bit-exact
back = xeno_py.load("w.xn16")                        # float32 (BF16 projection)

What it is, honestly:

  • compress_bf16 / decompress_bf16 are lossless on the BF16 payload: the roundtrip is memcmp == 0 on uint16 BF16 values.
  • save / load convert float32 to BF16 first (round-to-nearest-even), so a float32 tensor comes back as its BF16 projection, not bit-identical float32. That projection is the only loss, and it is the same bijection the C core uses.
  • The ratio (~75% of raw BF16 on weight-like data) depends on the exponent distribution; random uniform BF16 compresses poorly, as it should.
  • Measured here (2 MiB, best of 3): gaussian weights XENO 75.13% vs zlib -9 79.46% / lzma 71.76%; uniform random BF16 XENO 216.21% vs zlib 100.03%. v7 is a weight format with no raw-block escape, so it expands incompressible input: it is not a general-purpose compressor. Use the XN27 auto codec (bin/xeno.exe) for arbitrary files.
  • VectorDB keeps normalized vectors compressed on disk and materializes them for the search pass. The GEMV-on-compressed path is not wired here yet.

The package loads a prebuilt xeno_core.dll shipped inside xeno_py/ on Windows. On Linux it compiles the bundled header-only xeno_cross.h with gcc on first import (AVX2 + OpenMP required), caching the .so next to the package or in the system temp dir. In the repo it also falls back to core/.

Install from the repo: pip install ./xeno_py (needs numpy for the tensor API).

Benchmark (bit-exactness is asserted, ratio is compared to zlib -9 and lzma):

python xeno_py/benchmarks/bench.py

Metadata

Release files for xenocodec 0.3.0

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

Built distribution (wheel)

Table of built distributions (wheels) for xenocodec 0.3.0
File Interpreter ABI Platform Actions
xenocodec-0.3.0-py3-none-any.whl Python 3 none any Details for xenocodec-0.3.0-py3-none-any.whl

Release files / xenocodec-0.3.0-py3-none-any.whl

Download URL xenocodec-0.3.0-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f96acd260841ed91e52947088a9137ef8a77c35a19d33620038f31c4b46d3cf
BLAKE2b-256 checksum
How to use checksums
1c0a3ae6610981c2b3b1094cb8d336e05dbcfbd266b1eb3729a1f7bf26e5eb15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.4

Security for xenocodec 0.3.0

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.3.0 This release

1 release file 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