//! Token counter and cost tracking
//!
//! Provides token counting (tiktoken), usage statistics, cost estimation,
//! and a `TokenTrackingLLM` wrapper.
pub use ;
pub use TiktokenCounter;
pub use ;
use LazyLock;
use CoreBPE;
/// Global cached tiktoken encoder (cl100k_base, for GPT-3.5/4/4o).
static GLOBAL_ENCODER: = new;
/// Count tokens in text using the global tiktoken encoder.
///
/// This is a convenience function that uses a lazily-initialized
/// cl100k_base encoder (suitable for GPT-3.5/4/4o models).
///
/// # Examples
/// ```
/// use langchainrust::core::token_counter::count_tokens;
///
/// let n = count_tokens("Hello, world!");
/// assert!(n > 0);
/// ```