zon-format
Version:
ZON: The most token-efficient serialization format for LLMs - beats CSV, TOON, JSON, and all competitors
19 lines (18 loc) • 558 B
TypeScript
export declare class TokenCounter {
/**
* Estimates the number of tokens in a string.
* Uses a simple heuristic: ~4 characters per token.
*
* @param text - Text to count tokens for
* @returns Estimated token count
*/
count(text: string): number;
/**
* Estimates tokens for a specific model (placeholder for future expansion).
*
* @param text - Text to count
* @param model - Model identifier
* @returns Estimated token count
*/
countForModel(text: string, model: string): number;
}