UNPKG

zon-format

Version:

ZON: The most token-efficient serialization format for LLMs - beats CSV, TOON, JSON, and all competitors

27 lines (26 loc) 739 B
export declare class LLMOptimizer { private tokenizer; constructor(); /** * Optimizes the order of fields in an array of objects to minimize token usage. * * @param data - Array of objects to optimize * @returns Data with optimized field order */ optimizeFieldOrder(data: any[]): any[]; /** * Reorders data fields according to the specified ordering. * * @param data - Data to reorder * @param ordering - Field order * @returns Reordered data */ private _reorderData; /** * Generates candidate field orderings to test. * * @param fields - List of fields * @returns Array of candidate orderings */ private _generateOrderings; }