UNPKG

zon-format

Version:

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

44 lines (43 loc) 1.23 kB
/** * Built-in Metrics for ZON LLM Evaluation */ import type { Metric } from './types'; /** * Exact match metric - checks if answer exactly matches expected */ export declare const exactMatch: Metric; /** * Token efficiency metric - accuracy per 1000 tokens */ export declare const tokenEfficiency: Metric; /** * Structural validity metric - checks if output matches schema */ export declare const structuralValidity: Metric; /** * Format correctness metric - checks if output is valid ZON */ export declare const formatCorrectness: Metric; /** * Partial match metric - scores based on field-level correctness */ export declare const partialMatch: Metric; /** * Hallucination detection metric (placeholder for LLM-as-judge) * * Note: This is a simplified version. In production, this would call * another LLM to judge if the answer contains hallucinations. */ export declare const hallucination: Metric; /** * Latency metric - measures response time */ export declare const latency: Metric; /** * All built-in metrics */ export declare const BUILTIN_METRICS: Record<string, Metric>; /** * Register all built-in metrics with an evaluator */ export declare function registerBuiltinMetrics(evaluator: any): void;