Skip to main content

Crate troupekit_providers

Crate troupekit_providers 

Source
Expand description

Model providers for Troupekit: four wire protocols, a provider catalog, injected transports and middleware behind one Model trait. Start with Catalog::load and Catalog::connect("vendor/model", key).

Re-exports§

pub use catalog::Catalog;
pub use catalog::CatalogError;
pub use catalog::EmbeddingSpec;
pub use catalog::Price;
pub use catalog::BUILTIN_CATALOG;
pub use middleware::FallbackModel;
pub use middleware::MeteredModel;
pub use middleware::RetryModel;
pub use middleware::RetryPolicy;
pub use model::Endpoint;
pub use model::FailedCall;
pub use model::HttpModel;
pub use model::Model;
pub use model::RESEND_NOTE_BYTES;
pub use request::CompletionRequest;
pub use request::CompletionResponse;
pub use request::Delta;
pub use request::StopReason;

Modules§

catalog
fold
middleware
model
request
reqwest_transport
route
Model routing: a TOML policy, a pure route decision over bound targets and network or device signals, and RoutedModel, a Model that tries the planned targets in order. A private request never leaves the device.
sse
status
transport
wire
The wire protocols: pure encode and decode functions, no I/O. Each protocol module turns a CompletionRequest into JSON and wire JSON back into Deltas; Fold turns deltas into the response.

Traits§

Transport
Sends HTTP requests. HTTP clients, guarded clients, proxies and test fakes implement it, so models and tools never own an HTTP stack. Returns Ok for any status the server sent and Err when the request was refused, failed in transport or broke a limit.