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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

winnex_ai_normalize-1.0.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

winnex_ai_normalize-1.0.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file winnex_ai_normalize-1.0.0.tar.gz.

File metadata

  • Download URL: winnex_ai_normalize-1.0.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for winnex_ai_normalize-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5ec0f81baeb42f165078698a79d61460dfd2593c222576876919043d04bdc1c8
MD5 434c7b784f8e5155b21a880d9eb1d401
BLAKE2b-256 af4e251bad7300a668678080996f61b01965601d58e97d3c3c48df1e7c8a1a5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for winnex_ai_normalize-1.0.0.tar.gz:

Publisher: publish.yml on winnex-ai/winnex-ai-normalize

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file winnex_ai_normalize-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for winnex_ai_normalize-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ebab2fd2baccfa5163ae55ff3fb6878d1bf8339580cbb60388019a3aa4c35d1
MD5 259eb3ad2ec962bb72d4a9332f92e4f5
BLAKE2b-256 a60c8d7b4c3c8c8b671a0dfdc6cb1c145df936e4af72ed31b810f023c11b8df8

See more details on using hashes here.

Provenance

The following attestation bundles were made for winnex_ai_normalize-1.0.0-py3-none-any.whl:

Publisher: publish.yml on winnex-ai/winnex-ai-normalize

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page