Skip to main content

count

Function count 

Source
pub fn count(
    model: &str,
    body: &[u8],
    map: Option<&Value>,
    registry: RegistryHandle<'_>,
) -> u64
Expand description

Count tokens of a provider-native request body. map = provider settings tokenizer_map (glob → vocab name). Never fails: worst case is the chars/2 estimate.