pub mod budget;
pub mod cache;
pub mod cache_negative;
#[cfg(feature = "opendal-cache")]
pub mod cache_opendal;
pub mod cache_policy;
pub mod cache_singleflight;
pub mod circuit;
pub mod cooldown;
pub mod cost;
pub(crate) mod error;
pub mod fallback;
pub mod fallback_chain;
pub mod guardrail;
pub mod health;
pub mod hedge;
pub mod hooks;
pub mod idempotency;
pub mod in_flight;
pub mod metrics;
pub mod rate_limit;
pub mod route_classify;
pub mod router;
pub mod service;
#[cfg(test)]
mod tests;
#[cfg(test)]
pub(crate) mod tests_common;
pub mod tracing;
pub mod types;
pub use tower::ServiceExt;
pub use crate::cache_key::{
CacheKeyInput, CacheKeyStrategy, ExactHashStrategy, SystemPromptAwareStrategy, TenantScopedStrategy,
};
pub use crate::embedding::{EmbeddingProvider, NoOpEmbeddingProvider, SelfHostedEmbeddingProvider};
pub use crate::guardrail::{Guardrail, GuardrailContext, GuardrailDecision, GuardrailStage};
#[cfg(feature = "opendal-cache")]
pub use crate::vectorstore::OpenDalVectorStore;
pub use crate::vectorstore::{InMemoryVectorStore, VectorMatch, VectorMetadata, VectorStore};
pub use budget::{
BudgetConfig, BudgetDimension, BudgetLayer, BudgetLedger, BudgetLedgerLayer, BudgetLedgerService, BudgetService,
BudgetSnapshot, BudgetState, BudgetVerdict, CostCheckContext, CostRecordContext, DimensionLimits, Enforcement,
InMemoryBudgetLedger, should_hedge,
};
pub use cache::{
CacheBackend, CacheConfig, CacheLayer, CacheMetadata, CacheService, CacheStore, CachedResponse, InMemoryStore,
};
pub use cache_negative::{FixedWindowNegativeCache, NegativeCacheLayer, NegativeCachePolicy, NegativeCacheService};
#[cfg(feature = "opendal-cache")]
pub use cache_opendal::OpenDalCacheStore;
pub use cache_policy::{CacheDecision, CachePolicy, CachePolicyContext, StandardCachePolicy};
pub use cache_singleflight::{
InMemorySingleflight, SingleflightCoordinator, SingleflightHandle, SingleflightLayer, SingleflightResult,
SingleflightService,
};
pub use circuit::{CircuitLayer, CircuitPolicy, CircuitService, CircuitState, ExponentialBackoffCircuit};
pub use cooldown::{CooldownLayer, CooldownService};
pub use cost::{CostTrackingLayer, CostTrackingService};
pub use fallback::{FallbackLayer, FallbackService};
pub use fallback_chain::{DefaultRetryPolicy, FallbackChainLayer, FallbackChainService, RetryClass, RetryPolicy};
pub use guardrail::{GuardrailLayer, GuardrailService, TENANT_ID_METADATA_KEY};
#[cfg(feature = "native-http")]
pub use health::HttpProbeHealthChecker;
pub use health::{
HealthCheckConfig, HealthCheckLayer, HealthCheckService, HealthChecker, HealthStatus, PerProviderHealthCheck,
};
pub use hedge::{BudgetAwareHedge, FixedDelayHedge, HedgeLayer, HedgePolicy, HedgeService};
pub use hooks::{HooksLayer, HooksService, LlmHook};
pub use idempotency::{
IdempotencyEntry, IdempotencyLayer, IdempotencyService, IdempotencyStore, IdempotencyStoreError,
InMemoryIdempotencyStore,
};
pub use in_flight::{InFlightLimitConfig, InFlightLimitLayer, InFlightLimitService};
pub use metrics::{MetricsLayer, MetricsService};
pub use rate_limit::{
CostRateLimitConfig, CostRateLimitLayer, CostRateLimitService, ModelRateLimitLayer, ModelRateLimitService,
RateLimitConfig,
};
pub use route_classify::{
CascadeClassifier, ClassifierVerdictCache, ClassifyContext, EmbeddingSimilarityClassifier, IntentPrototype,
KeywordClassifier, LlmClassifier, RouteClassifier,
};
pub use router::{
DEFAULT_CONCURRENCY_LIMIT, DynamicRouter, ProviderConfig, Router, RouterError, RoutingStrategy, StaticDiscover,
UpstreamDiscover, Weight,
};
pub use service::LlmService;
pub use tracing::{TracingLayer, TracingService};
pub use types::{LlmRequest, LlmRequestKind, LlmResponse};