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.1.tar.gz (16.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.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

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

Hashes for winnex_ai_normalize-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ae42e47e26064b7f44f10c694a7fc45eda715e6d23bdbe0aa5298b3d05e4662b
MD5 1e3e6d2405eecdccf494428b0ad9707a
BLAKE2b-256 9ddd4f14e8d13a8b1aa2c29b88ad5c3f2e6e4aa5f8a8761fb68ebcc3f94bf940

See more details on using hashes here.

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

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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for winnex_ai_normalize-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a190c7de55e6916a7ae3857902c8b47ca6c63469fcddc333b63c61353dc386f6
MD5 c338f088e3dbb632d69f9eae1a47e319
BLAKE2b-256 f09f584c94b2b501b3868a21c3c3cb67e2bfee44797835fc2259f15006698ef7

See more details on using hashes here.

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

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