Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

812 B
Raw Blame
pub mod context;
pub mod diagnostic;

pub mod caching;
pub mod error;
pub mod outbound;
pub mod provider;
pub mod resources;

pub use error::Error;

#[derive(Clone, Default)]
pub struct CallOptions {
    pub cache: Option<litellm_cache_response::CachePolicy>,
    pub observers: Option<litellm_host::observation::ObservationSender>,
}

impl From<Option<litellm_host::observation::ObservationSender>> for CallOptions {
    fn from(observers: Option<litellm_host::observation::ObservationSender>) -> Self {
        Self {
            cache: None,
            observers,
        }
    }
}

impl From<litellm_cache_response::CachePolicy> for CallOptions {
    fn from(cache: litellm_cache_response::CachePolicy) -> Self {
        Self {
            cache: Some(cache),
            observers: None,
        }
    }
}