Skip to main content

winnex-nano

Native Winnex inference engine — deterministic spectral tokenizer, multimodel weight balancing, and chunk streaming via the Madhava fast build.

Model-agnostic (Qwen / BERT / DeepSeek / GPT), C++20/OpenCL, no CUDA. Reuses the winnex-madhava engine kernels (QKᵀ matmul, selective-top-K with Cauchy-Schwarz bounds) — no code duplication.

Components

Module Purpose
SpectralTokenizer Character → quaternion spectrum (deterministic, no BPE, no vocabulary)
WeightBalancer Multimodel fusion: W' = Σᵢ αᵢ·R(qᵢ)·Wᵢ
StreamEngine Chunk generation via the Madhava fast build (working memory)
server_sse OpenAI-compatible /v1/chat/completions (stream + non-stream)

Installation

pip install winnex-nano

Requires winnex-madhava>=1.8.1 (the engine), numpy. Optional: winnex-nano[server] for the SSE server (fastapi, uvicorn, httpx).

Quick start

import winnex_nano as wn

# 1. Deterministic spectral tokenizer (no BPE, no vocabulary)
tok = wn.SpectralTokenizer(embed_dim=64)
states = tok.encode("Winnex AI")       # list of quaternions
text = tok.decode(states)              # round-trip: "Winnex AI"

# 2. Multimodel weight balancing: W' = Σ αᵢ·R(qᵢ)·Wᵢ
bal = wn.WeightBalancer()
model_a = {"layer.0.weight": [1, 2, 3, 4]}
model_b = {"layer.0.weight": [10, 20, 30, 40]}
a = wn.BlendWeight(); a.alpha = 0.5
b = wn.BlendWeight(); b.alpha = 0.5
fused = bal.blend([model_a, model_b], [a, b])   # [5.5, 11, 16.5, 22]

# 3. Streaming via the Madhava fast build
engine = wn.StreamEngine()
chunks = []
engine.stream(
    "O Madhava e deterministico.",
    lambda ctx, top: " chunk" if len(chunks) < 3 else "",
    lambda c: chunks.append(c.text) if not c.done else None,
)

SSE server (OpenAI-compatible)

pip install "winnex-nano[server]"
python -m winnex_nano.server_sse 30002
curl -N http://localhost:30002/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"O Madhava e deterministico"}],"stream":true}'

Honest benchmark (vs BPE)

Run the full benchmark on Kaggle — installs winnex-nano from PyPI and reports round-trip, throughput and O(1) decode scaling on real multilingual text:

Kaggle

Metric winnex-nano spectral BPE (Qwen2.5)
Round-trip perfect 8/8 n/a
Char error rate 0.00% n/a
Encode throughput 234K chars/s 4.3M chars/s
Stream (3 chunks) 1.7 ms ~2.1 s (HTTP)
Vocabulary none 151K tokens

The spectral tokenizer is 100% deterministic with no vocabulary dependency, but 50–70× slower and ~1000× less compact than BPE. It is an autonomous encoding for the native multimodel engine, NOT a drop-in BPE replacement for a BPE-trained model.

License

Business Source License 1.1 (BSL 1.1) — pay@winnex.ai.

Pre-patent: https://zenodo.org/records/21861809

Metadata

Release files for winnex-nano 0.1.13

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 winnex-nano 0.1.13
File Interpreter ABI Platform
winnex_nano-0.1.13-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details

Release files / winnex_nano-0.1.13-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL winnex_nano-0.1.13-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 450.5 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a41c581e6d5dab3e5dcfea1798d572fb67ffae351ca86489372fed171544d421
BLAKE2b-256 checksum
How to use checksums
d18bbc331f5248436b368971989b859f8e28eb2c500473cb7324665571a3e470
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 19, 2026.

Transparency log

Security for winnex-nano 0.1.13

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.

Full provenance

All 1 file in this release has been uploaded with provenance metadata.

Attestation for winnex_nano-0.1.13-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

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 Oct 19, 2026.

Transparency log

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.

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