Skip to main content

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)

Metadata

Release files for winnex-ai-normalize 1.1.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 winnex-ai-normalize 1.1.0
File Size Uploaded Provenance Actions
winnex_ai_normalize-1.1.0.tar.gz 28.8 kB With provenance Details for winnex_ai_normalize-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for winnex-ai-normalize 1.1.0
File Interpreter ABI Platform Actions
winnex_ai_normalize-1.1.0-py3-none-any.whl Python 3 none any Details for winnex_ai_normalize-1.1.0-py3-none-any.whl

Total release size: 61.9 kB

Release files / winnex_ai_normalize-1.1.0.tar.gz

Download URL winnex_ai_normalize-1.1.0.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5446c3d061ccee2aa4c64ac5459bc0e7e1947f0544fb94ac45fc4fa7d2e68276
BLAKE2b-256 checksum
How to use checksums
3d17b0ea6602833bf2f5fe22ca63df57cf7f222d5c87eec2ac8c1ba36574fc7c
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 Aug 27, 2026.

Transparency log

Release files / winnex_ai_normalize-1.1.0-py3-none-any.whl

Download URL winnex_ai_normalize-1.1.0-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c787db3bf9b31c8d689571a976cabd32fb1eb9677b49b66a04d5279445e2bd64
BLAKE2b-256 checksum
How to use checksums
6209cf6ee7e7adfff94d8ac1a06763db09f99b39185779e43fb5e828c775489e
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 Aug 27, 2026.

Transparency log

Security for winnex-ai-normalize 1.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for winnex_ai_normalize-1.1.0.tar.gz

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 Aug 27, 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.

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