solo_api/llm/mod.rs
1// SPDX-License-Identifier: Apache-2.0
2
3//! `solo-api` LLM clients that depend on the MCP transport.
4//!
5//! Other LLM clients (Anthropic, OpenAI, Ollama) live in `solo-storage::llm`
6//! because they're HTTP-only and storage-layer-callable. The
7//! MCP-sampling client lives here because it needs `rmcp::Peer<RoleServer>`
8//! — only available inside the MCP transport.
9//!
10//! v0.9.0 P2 ships [`sampling::SamplingLlmClient`] + the
11//! [`sampling::SamplingClient`] trait the test fixture
12//! ([`super::test_support::fake_mcp_client::FakeMcpClient`]) implements.
13
14pub mod sampling;
15pub mod sampling_coordinator;
16
17// v0.10.1 F3 — integration test that drives a real `Peer<RoleServer>`
18// + a real `ClientHandler` over `tokio::io::duplex`. Pins the rmcp
19// concurrency invariant `PeerSamplingClient::call_peer` assumes when N
20// parallel `complete()` calls share a single Peer. `#![cfg(test)]`
21// inside the file gates the entire module out of non-test builds.
22#[cfg(test)]
23mod peer_concurrency;
24
25pub use sampling::{
26 DEFAULT_SAMPLING_TIMEOUT, SamplingClient, SamplingError, SamplingLlmClient,
27 build_sampling_steward,
28};
29pub use sampling_coordinator::{
30 DEFAULT_COALESCE_MAX_BATCH, DEFAULT_COALESCE_WINDOW, SamplingCoordinator,
31};