Quick Start
Estimation Modes
| Mode | Description | Performance |
|---|---|---|
HEURISTIC | Fast character-based estimate | Fastest |
ACCURATE | Use tiktoken if available | Slower |
VALIDATED | Compare both, log mismatches | Slowest |
Configuration
Environment Variables
EstimationMetrics
Mismatch Logging
Whenlog_estimation_mismatch=True and error exceeds threshold:
Estimation Caching
Estimates are cached by content hash:Heuristic Algorithm
The heuristic uses character-based estimation:Accurate Estimation
When tiktoken is available:CLI Usage
Best Practices
- Use heuristic for production - Fast and good enough
- Use validated for debugging - Find estimation issues
- Set reasonable threshold - 15-20% is typical
- Monitor mismatch logs - Identify problematic content

