Skip to main content

xFermat (v0.6.0) — Apple Silicon Open Inference Runtime

xFermat Open Runtime provides Apple Silicon Metal GPU kernels, native-speed Safetensors loading, fused 2-bit/4-bit KIVI KV-cache decoding (--kv-bits 4|2), 3:1 Mamba-2 SSD + SDPA hybrid layers (FermatModel), and an empirical shape autotuner (FermatEngine) unifying 18 peer-reviewed foundations.

Open-Core Architecture: This public repository and PyPI runtime distribute the transparent, pure-source inference engine (xfermat info, xfermat bench, xfermat run, load_compressed_model, FermatKIVICache, and verified Metal kernels). Proprietary offline weight compression (Clip-GPTQ, 4D VPTQ) and MOHAWK distillation modules remain private commercial tools under aopas software development.


Measured Apple Silicon Summary (Qwen2.5-0.5B & 1.5B)

Full disjoint evaluations, null-result boundaries, and reproducible JSON logs live in WHITEPAPER.md and benchmarks/:

Benchmark (8 GB Apple Silicon GPU, mlx 0.32.4) Strongest Native / Baseline xFermat v0.6.0 Verified Gain
Qwen2.5-0.5B 3-Bit KL & Decode mlx_lm.awq: 0.792 KL (98.3 tok/s) 0.423 KL (144.1 tok/s) -47% KL, 1.47× faster
Qwen2.5-0.5B 4-Bit WikiText-2 PPL mlx_lm.awq: 23.86 PPL (0.132 KL) 23.61 PPL (0.100 KL, 150.4 tok/s) -25% in-dom KL, beats AWQ
Qwen2.5-1.5B 3-Bit Footprint & Reload 2,944.4 MB BF16 (21.3 tok/s swap) 783.9 MB (3.76×), 0.70 s reload, 60.0 tok/s -12% KL vs AWQ (37.36 PPL)
8K KIVI KV Cache (D=128, G=64) FP16 16.0 MB / 2b per-token 0.533 cos 3.16 MB (5.06×), 0.710 ms, 0.923 cos Live mlx_lm KV cut 2.86×–3.66×
8K 3:1 Hybrid SSD State & Decode Flash 65.5 MB (378.7 tok/s) 16.4 MB (3.99×), 457.4 tok/s 1.21× decode / 1.53× prefill

(Honest engineering caveat: 3-bit and 4-bit remain the recommended production PTQ tiers; compact 0.5B 2-bit post-training weights still trail BF16 on open-ended chat until QAT lands in v0.7.0. Under mode="auto", sub-cubic Winograd–Strassen, AlphaEvolve rank-48, ternary LUTs, and 120-bit CRT FP64 stay opt-in where native Apple GEMM/BLAS wins.)


Runtime Modules Included (src/fermat/)

Module Capability
src/fermat/kv_quant.py QuantizedKVCache, FermatKIVICache, fused Metal L_q=1 register-unpack KIVI (--kv-bits 4/2)
src/fermat/persistence.py Sub-second sharded .safetensors serialization & load_compressed_model
src/fermat/engine.py FermatEngine(mode="auto") per-shape median + 10% hysteresis autotuner
src/fermat/io_algebra.py flash_tiled_attention (SDPA auto-routing + Split-KV Metal FlashDecode) & WinogradConv2d
src/fermat/ssd_mamba.py Chunked Q_c=64 Mamba-2 State Space Duality Metal forward + reverse-VJP scan
src/fermat/structured.py HadamardQuantLinear, FermatFinalNorm, MonarchLinear, fused Metal SRAM FWHT (R4)
src/fermat/bilinear.py AlphaEvolve <4,4,4>, AlphaTensor, Gauss 3M, Winograd-Strassen + bundled .npz tables
src/fermat/rns_ozaki.py Explicit 120-bit CRT-Ozaki II GPU FP64 reconstruction (7.56e-16 rel. err.)
src/fermat/ternary.py OzakiHadamardTernaryLinear (T-MAC Metal SRAM LUTs)

Quickstart & Security Verification

# Install runtime (add [llm] to load & stream Hugging Face / mlx-lm models with KIVI)
pip install "xfermat[llm]"

# Verify pure-source package integrity & Metal GPU runtime
xfermat info
xfermat bench --json

# Stream any Hugging Face / mlx-lm model with fused 4-bit KIVI KV cache
xfermat run Qwen/Qwen2.5-0.5B-Instruct --kv-bits 4 --prompt "Explain Fermat's principle."

# Or load a saved compressed xFermat safetensors checkpoint in ~0.7s
xfermat run ./path-to-compressed-model --kv-bits 4 --prompt "Explain Fermat's principle."

# Verify runtime suite
pytest -q
  • Supply-Chain Transparency (SECURITY.md): Pure py3-none-any source Python + runtime-compiled Metal shaders (zero compiled .dylib/.so blobs, zero pickle checkpoint loading, zero telemetry).
  • Licensing (LICENSE): Free (€0) for solo personal & academic use on 1 personal Mac. Commercial redistribution and business fleets (€39/seat Pro, From €750/mo Enterprise) are licensed via xfermat.com/pricing.

Metadata

Release files for xfermat 0.6.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 xfermat 0.6.0
File Size Uploaded Provenance Actions
xfermat-0.6.0.tar.gz 789.1 kB Without provenance Details for xfermat-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.6 MB

Release files / xfermat-0.6.0.tar.gz

Download URL xfermat-0.6.0.tar.gz
Size 789.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3e872b40f04f6e3370d456642838968d10c56e64e02d119e073c5e93092a6546
BLAKE2b-256 checksum
How to use checksums
ccb77c49647171064cd30b08407e006238a030397389ecfc555be89e0d7e69e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / xfermat-0.6.0-py3-none-any.whl

Download URL xfermat-0.6.0-py3-none-any.whl
Size 794.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1dc4bf6e9f46e19c3b599db5ee0df7033781f9dd7e01832b4c5d91e3b9bb8e4c
BLAKE2b-256 checksum
How to use checksums
5719c09e50fc58d2444cbe37ebf2ccc0d4badd2d448d8d022115d49312ef62ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for xfermat 0.6.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.

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