Skip to main content

tt_provider_compat/
lib.rs

1//! `tt-provider-compat` — the OpenAI-wire-compatible adapter machinery.
2//!
3//! Many inference providers (OpenAI itself, plus Mistral, Groq, Together AI,
4//! OpenRouter) speak the OpenAI `POST /chat/completions` + `/embeddings` wire
5//! format. This crate holds the shared plumbing — request/response translation,
6//! SSE streaming, error mapping, the HTTP client config, and the generic
7//! [`OpenAICompatibleProvider`] — so each adapter crate is a thin
8//! configuration over it.
9//!
10//! `tt-provider-openai` builds its native adapter on top of this crate (adding
11//! the OpenAI pricing catalog); the four BYOK adapters depend only on this
12//! crate, not on the full OpenAI adapter.
13
14pub mod client;
15pub mod compat;
16pub mod errors;
17pub mod stream;
18pub mod translate;
19
20pub use client::ClientConfig;
21pub use compat::{CompatConfig, OpenAICompatibleProvider};