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:
| 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file winnex_nano-0.1.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: winnex_nano-0.1.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 401.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90e740adb1f92699c9c3830cb9f797624a90be1661af4cd407579447f0e97d50
|
|
| MD5 |
f032782071f8fc0897cae062204ffe1f
|
|
| BLAKE2b-256 |
b354ed0a7cc19d4f2216dc04ef9134f66ba525ea4abeca0f56d9e8a66f8ef332
|
Provenance
The following attestation bundles were made for winnex_nano-0.1.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on winnex-ai/winnex-nano
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
winnex_nano-0.1.10-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
90e740adb1f92699c9c3830cb9f797624a90be1661af4cd407579447f0e97d50 - Sigstore transparency entry: 2438112340
- Sigstore integration time:
-
Permalink:
winnex-ai/winnex-nano@719b31973415ceb19af05fe64b9cedac2b4d0c7e -
Branch / Tag:
refs/tags/v0.1.10 - Owner: https://github.com/winnex-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@719b31973415ceb19af05fe64b9cedac2b4d0c7e -
Trigger Event:
push
-
Statement type: