/** * bench/harness.ts — run a benchmark and A/B two models. * * The harness drives a model over held-out token sequences, scores next-token * prediction with {@link metrics}, and produces a {@link BenchmarkReport}. It * also offers a one-call {@link trainAndBenchmark} that builds a fresh * `EvermindLM` from a corpus, holds out a slice, trains on the rest, and scores * — the path the Studio uses to benchmark a model in the browser. */ import type { AsyncLogitsModel, BenchmarkOptions, BenchmarkReport, ComparisonReport, LogitsModel, TrainAndBenchmarkOptions, TrainAndBenchmarkResult } from "./types.js"; /** * Benchmark a model (synchronous forward) over held-out token sequences. * Sequences shorter than 2 tokens have no prediction target and are skipped. */ export declare function benchmarkModel(model: LogitsModel, sequences: number[][], opts?: BenchmarkOptions): BenchmarkReport; /** Benchmark a model whose forward pass is asynchronous (e.g. a WebGPU backend). */ export declare function benchmarkModelAsync(model: AsyncLogitsModel, sequences: number[][], opts?: BenchmarkOptions): Promise; /** A/B two models on the same eval set. Lower perplexity wins (the primary metric). */ export declare function compareModels(candidate: LogitsModel, baseline: LogitsModel, sequences: number[][], opts?: BenchmarkOptions): ComparisonReport; /** Build a {@link ComparisonReport} from two already-computed scorecards. */ export declare function compareReports(candidate: BenchmarkReport, baseline: BenchmarkReport): ComparisonReport; /** Split a corpus into next-token training sequences (one per sentence). */ export declare function corpusToSequences(corpus: string, codec: { encode(text: string): number[]; }): number[][]; /** Benchmark an existing model against a raw-text corpus (tokenized per sentence). */ export declare function benchmarkText(model: LogitsModel, codec: { encode(text: string): number[]; }, corpus: string, opts?: BenchmarkOptions): BenchmarkReport; /** * Train a fresh `EvermindLM` on a corpus and benchmark it on a held-out slice — * the canonical "build + score a model from text" path. A real benchmark must * score data the model never trained on, so `heldOutRatio` is clamped to leave * at least one eval sequence and one train sequence. */ export declare function trainAndBenchmark(corpus: string, opts?: TrainAndBenchmarkOptions): TrainAndBenchmarkResult; //# sourceMappingURL=harness.d.ts.map