Skip to main content

Module handler

Module handler 

Source
Expand description

HTTP handlers for the embedding service.

Submodules:

  • common: shared input validation and readiness helpers.
  • dense: POST /v1/embeddings (OpenAI-compatible dense embeddings).
  • sparse: POST /v1/sparse-embeddings (BGE-M3 SPLADE-style sparse embeddings).
  • both: POST /v1/embeddings:both (paired dense + sparse output in one pass).
  • health: GET /health (readiness + tuning details).
  • models: GET /v1/models (fleet discovery).

Modulesยง

both ๐Ÿ”’
POST /v1/embeddings:both handler โ€” dense + sparse embeddings in one pass.
common ๐Ÿ”’
Shared input validation and service-readiness helpers used by all handlers.
dense ๐Ÿ”’
POST /v1/embeddings handler โ€” OpenAI-compatible dense embeddings.
health ๐Ÿ”’
GET /health handler โ€” readiness status, worker counts, and tuning diagnostics.
models ๐Ÿ”’
GET /v1/models handler โ€” OpenAI-compatible fleet discovery endpoint.
sparse ๐Ÿ”’
POST /v1/sparse-embeddings handler โ€” BGE-M3 SPLADE-style sparse embeddings.

Functionsยง

both_embeddings
Handles POST /v1/embeddings:both โ€” returns dense and sparse embeddings in one pass.
dense_embeddings
Handles POST /v1/embeddings โ€” returns dense (float32) embeddings.
health
Handles GET /health โ€” returns readiness status, worker counts, and tuning diagnostics.
models
Returns an OpenAI-compatible models list confirming BGE-M3 is resident.
sparse_embeddings
Handles POST /v1/sparse-embeddings โ€” returns sparse (SPLADE-style) embeddings.