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]

364 B
Raw Blame
use litellm_cache::Error;

use crate::StoredValue;

pub trait ValueAdapter: Send + Sync + 'static {
    fn read(&self, value: StoredValue) -> Result<Option<Vec<u8>>, Error>;
    fn write(&self, payload: Vec<u8>) -> StoredValue;
    fn counter_seed(&self, value: Option<StoredValue>) -> Result<f64, Error>;
    fn counter_value(&self, value: f64) -> StoredValue;
}