1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// ABOUTME: Library root re-exporting server modules for integration testing
// ABOUTME: Enables tests/ to access router, state, types, and handler modules
//
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2026 dravr.ai
//! # embacle-server
//!
//! Unified OpenAI-compatible REST API + MCP server for embacle LLM runners.
//!
//! ## Endpoints
//!
//! - `POST /v1/chat/completions` — chat completion (streaming and non-streaming)
//! - `GET /v1/models` — list available providers and models
//! - `GET /health` — per-provider readiness check
//! - `POST /mcp` — MCP Streamable HTTP (JSON-RPC 2.0, via embacle-mcp)
//!
//! ## Modules
//!
//! - [`completions`] — chat completion handler with multiplex fan-out
//! - `mcp_client` — MCP stdio client pool for server-side tool execution (feature `mcp-tools`)
//! - [`models`] — model listing endpoint
//! - [`health`] — provider health checks
//! - [`auth`] — optional bearer token authentication
//! - [`streaming`] — SSE streaming for OpenAI-format responses
//! - [`provider_resolver`] — `provider:model` string routing
//! - [`router`] — Axum router wiring all endpoints (`OpenAI` + MCP)
//! - [`state`] — re-export of unified state from embacle-mcp
//! - [`runner`] — runner factory bridging to embacle core