winnex-ai-normalize
The input-normalization plug for the Madhava engine.
The Madhava engine is agnostic — it consumes float32 vectors. This
package normalizes any input (text via an embedding provider, or raw
vectors) into a valid float32/uint8 corpus ready for
winnex_madhava.build_engine, with provider failover and no silent
fallback to fake vectors.
text / raw vectors
│
▼
winnex-ai-normalize
├── providers: OpenAI / Qwen3 / nano / xfactor / direct (failover order)
├── validate: dim + NaN + norm (fail loudly)
├── normalize: L2 unit-norm (cosine contract)
└── quantize: float32 → uint8 (the engine's native corpus)
│
▼
winnex-madhava (agnostic) → top-K + Cauchy-Schwarz proof
Install
pip install winnex-ai-normalize # core (numpy + httpx)
pip install winnex-ai-normalize[api] # + OpenAI-compatible /v1/embeddings
pip install winnex-ai-normalize[all] # + winnex-madhava
Quick start
from winnex_ai_normalize import EmbeddingNormalizer
norm = EmbeddingNormalizer() # reads env / JSON config
# 1. Embed text via the configured provider (OpenAI / Qwen3 / ...)
vecs = norm.vectorize_texts(["hypertension treatment", "diabetes care"])
# vecs: (2, d) float32 L2-normalized
# 2. Or normalize raw vectors (validated, no NaN, unit-norm)
vecs = norm.normalize_vectors(my_embeddings, dim=1024)
# 3. Feed the Madhava engine (agnostic)
u8 = norm.to_corpus(vecs, dim=1024) # uint8 corpus for build_engine
import winnex_madhava as wm
engine = wm.build_engine(u8, dim=1024, metric="cosine", k=10)
OpenAI-compatible API
uvicorn winnex_ai_normalize.api.server:app --port 8102
curl -X POST http://localhost:8102/v1/embeddings \
-H "Content-Type: application/json" \
-d '{"model": "Qwen3-Embedding-0.6B", "input": ["text one", "text two"]}'
# → {"data": [{"embedding": [...], "index": 0}, ...], ...}
Provider failover (no fake fallback)
Providers are tried in provider_order (JSON/env config). If all
fail, a RuntimeError is raised with the collected errors — a normalizer
must never fabricate embeddings.
{
"default_dim": 1024,
"default_provider": "qwen3",
"providers": [
{"name": "qwen3", "base_url": "http://winnex-embedding:8102",
"model": "/workspace/models/Qwen3-Embedding-0.6B", "priority": 1},
{"name": "openai", "base_url": "https://api.openai.com/v1",
"model": "text-embedding-3-small", "api_key_env": "OPENAI_API_KEY", "priority": 2}
],
"provider_order": ["qwen3", "openai"]
}
Consumed by
- winnex-madhava (direct — the engine stays agnostic)
- winnex-tracer (audit + commitment)
- Liferay bridges (tracer-gov-liferay, tracer-med-liferay)
- Maestro (winnex-ai-server / winnex-ai-engine) and any external tool
License
Business Source License 1.1 (BSL 1.1) | pay@winnex.ai | Winnex Brasil Soluções Empresariais LTDA (CNPJ 58.364.637/0001-47)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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_ai_normalize-1.0.1.tar.gz.
File metadata
- Download URL: winnex_ai_normalize-1.0.1.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae42e47e26064b7f44f10c694a7fc45eda715e6d23bdbe0aa5298b3d05e4662b
|
|
| MD5 |
1e3e6d2405eecdccf494428b0ad9707a
|
|
| BLAKE2b-256 |
9ddd4f14e8d13a8b1aa2c29b88ad5c3f2e6e4aa5f8a8761fb68ebcc3f94bf940
|
Provenance
The following attestation bundles were made for winnex_ai_normalize-1.0.1.tar.gz:
Publisher:
publish.yml on winnex-ai/winnex-ai-normalize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
winnex_ai_normalize-1.0.1.tar.gz -
Subject digest:
ae42e47e26064b7f44f10c694a7fc45eda715e6d23bdbe0aa5298b3d05e4662b - Sigstore transparency entry: 2534825301
- Sigstore integration time:
-
Permalink:
winnex-ai/winnex-ai-normalize@2e6e22a3c548e38b168ce2f9982c3cc1d5903132 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/winnex-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2e6e22a3c548e38b168ce2f9982c3cc1d5903132 -
Trigger Event:
push
-
Statement type:
File details
Details for the file winnex_ai_normalize-1.0.1-py3-none-any.whl.
File metadata
- Download URL: winnex_ai_normalize-1.0.1-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a190c7de55e6916a7ae3857902c8b47ca6c63469fcddc333b63c61353dc386f6
|
|
| MD5 |
c338f088e3dbb632d69f9eae1a47e319
|
|
| BLAKE2b-256 |
f09f584c94b2b501b3868a21c3c3cb67e2bfee44797835fc2259f15006698ef7
|
Provenance
The following attestation bundles were made for winnex_ai_normalize-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on winnex-ai/winnex-ai-normalize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
winnex_ai_normalize-1.0.1-py3-none-any.whl -
Subject digest:
a190c7de55e6916a7ae3857902c8b47ca6c63469fcddc333b63c61353dc386f6 - Sigstore transparency entry: 2534825941
- Sigstore integration time:
-
Permalink:
winnex-ai/winnex-ai-normalize@2e6e22a3c548e38b168ce2f9982c3cc1d5903132 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/winnex-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2e6e22a3c548e38b168ce2f9982c3cc1d5903132 -
Trigger Event:
push
-
Statement type: