Skip to main content

bge_m3_embedding_server/handler/
models.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//! `GET /v1/models` handler — OpenAI-compatible fleet discovery endpoint.
16
17use std::sync::Arc;
18
19use axum::{extract::State, response::IntoResponse, Json};
20
21use crate::models::{ModelEntry, ModelsResponse};
22use crate::state::AppState;
23
24/// Returns an OpenAI-compatible models list confirming BGE-M3 is resident.
25pub async fn models(State(_state): State<Arc<AppState>>) -> impl IntoResponse {
26    Json(ModelsResponse {
27        object: "list",
28        data: vec![ModelEntry {
29            id: "bge-m3",
30            object: "model",
31        }],
32    })
33}