import type { ProviderName } from "../eval/llm.js"; import type { EvalCase } from "../eval/schema.js"; import type { BenchmarkResult, BenchmarkCase } from "../eval/benchmark.js"; export interface ModelSpec { provider: ProviderName; model: string; } export interface ModelStats { mean: number; stddev: number; median?: number; ci95?: [number, number]; } export interface ModelResult { provider: string; model: string; passRate: ModelStats; rubricScore: ModelStats | null; duration: ModelStats; cost: { total: number; perCase: number; }; status: "complete" | "error"; errorMessage: string | null; caseResults: BenchmarkCase[][]; baselinePassRate?: ModelStats; skillDelta?: ModelStats; amplificationPct?: number; compositeScore?: number; } export interface SweepResult { sweepId: string; timestamp: string; judge: string; runs: number; models: ModelResult[]; baselineEnabled?: boolean; skillQualityScore?: number; skillQualityRating?: "excellent" | "good" | "marginal" | "minimal" | "harmful"; judgeBiasWarning?: string; } export interface SweepOpts { skillDir: string; skillName: string; systemPrompt: string; evalCases: EvalCase[]; models: string[]; judge: string; runs: number; concurrency: number; baseline?: boolean; baselinePrompt?: string; } export type SweepSSEEvent = { type: "sweep_start"; data: { totalModels: number; runs: number; judge: string; baseline: boolean; }; } | { type: "sweep_model_start"; data: { model: string; provider: string; modelIndex: number; totalModels: number; }; } | { type: "sweep_model_progress"; data: { model: string; currentCase: number; totalCases: number; run: number; totalRuns: number; percentComplete: number; phase?: "skill" | "baseline"; }; } | { type: "sweep_model_complete"; data: { model: string; provider: string; status: "complete" | "error"; passRate?: ModelStats; baselinePassRate?: ModelStats; skillDelta?: ModelStats; amplificationPct?: number; errorMessage?: string; }; } | { type: "sweep_judge_bias_warning"; data: { judge: string; matchedModel: string; warning: string; }; } | { type: "sweep_complete"; data: SweepResult; }; /** * Parse a model spec string like "provider/model" or "provider/org/model". * Splits on the first `/` only — everything after is the model ID. */ export declare function parseModelSpec(spec: string): ModelSpec; export declare function computeMean(values: number[]): number; export declare function computeStddev(values: number[], mean: number): number; export declare function computeMedian(values: number[]): number; export declare function computeCI95(values: number[]): [number, number] | undefined; export declare function computeStats(values: number[]): ModelStats; export interface JudgeBiasResult { warning: string; matchedModel: string; } export declare function detectJudgeBias(judgeSpec: string, modelSpecs: string[]): JudgeBiasResult | undefined; export declare function computeCompositeScore(passRate: ModelStats, runs: number): number; export type SkillQualityRating = "excellent" | "good" | "marginal" | "minimal" | "harmful"; export declare function computeSkillQualityScore(amplifications: number[]): { score: number; rating: SkillQualityRating; }; export declare function aggregateRuns(results: BenchmarkResult[], provider: string, model: string): Omit; export declare function runSweep(opts: SweepOpts): AsyncGenerator; export declare function writeLeaderboard(skillDir: string, result: SweepResult): Promise; export declare function listLeaderboard(skillDir: string, limit?: number): Promise; export declare function readLeaderboardEntry(skillDir: string, timestamp: string): Promise;