Skip to main content

embacle_server/
lib.rs

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