bge_m3_embedding_server/handler.rs
1// Copyright (c) 2026 J. Patrick Fulton
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! HTTP handlers for the embedding service.
16//!
17//! Submodules:
18//! - `common`: shared input validation and readiness helpers.
19//! - `dense`: `POST /v1/embeddings` (OpenAI-compatible dense embeddings).
20//! - `sparse`: `POST /v1/sparse-embeddings` (BGE-M3 SPLADE-style sparse embeddings).
21//! - `both`: `POST /v1/embeddings:both` (paired dense + sparse output in one pass).
22//! - `health`: `GET /health` (readiness + tuning details).
23//! - `models`: `GET /v1/models` (fleet discovery).
24
25mod both;
26mod common;
27mod dense;
28mod health;
29mod models;
30mod sparse;
31
32pub use both::both_embeddings;
33pub use dense::dense_embeddings;
34pub use health::health;
35pub use models::models;
36pub use sparse::sparse_embeddings;
37
38#[cfg(test)]
39mod tests;