switchyard_llm_client/lib.rs
1// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4//! HTTP LLM client that speaks Switchyard's neutral IR directly.
5//!
6//! [`TranslatingLlmClient`] maps a model name (and the wire format resolved from
7//! the request) to a [`Backend`],
8//! encodes a [`switchyard_protocol::Request`] to that backend's wire format via
9//! `switchyard-translation`, applies auth and forwards caller headers, makes the
10//! HTTP call with a shared [`reqwest::Client`], and decodes the wire response
11//! back to a [`switchyard_protocol::Response`] — supporting both buffered and
12//! streamed responses.
13
14pub mod backend;
15pub mod client;
16pub mod error;
17pub mod metrics;
18pub mod raw;
19
20pub use backend::{Backend, DEFAULT_MAX_RETRIES, HttpBackendConfig};
21pub use client::{ModelConfig, TranslatingLlmClient};
22pub use error::{LlmClientError, Result};
23pub use raw::RawResponse;
24pub use switchyard_translation::RawEventStream;