pub struct CacheConfig {
pub max_seq_len: usize,
pub page_size: usize,
pub kind: CacheKind,
}Expand description
Configuration for a KV cache instance.
Fields§
§max_seq_len: usizeMaximum number of cached positions (arena capacity).
page_size: usizeTokens per page (paged cache only).
kind: CacheKindImplementation to use.
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub const DEFAULT_PAGE_SIZE: usize = 16
pub const DEFAULT_PAGE_SIZE: usize = 16
Default page size (MLC uses 16 as well).
Sourcepub fn contiguous(max_seq_len: usize) -> Self
pub fn contiguous(max_seq_len: usize) -> Self
Contiguous (baseline) cache.
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CacheConfig
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin for CacheConfig
impl UnsafeUnpin for CacheConfig
impl UnwindSafe for CacheConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more