import type { EmpiricalEnv } from './empirical.js'; import type { LatencyResult, LatencyStats, LatencyTrial, Provider } from './types.js'; export type { LatencyResult, LatencyStats, LatencyTrial }; export interface MeasureLatencyOptions { modelId: string; prompt: string; trials: number; maxTokens?: number; env: EmpiricalEnv; } /** * Linear-interpolation percentile. `p` is 0-100. With p95 over n=3 trials this * just returns max(values), which is what we want for the "tail" reading. */ declare const nthPercentile: (values: readonly number[], p: number) => number; /** * Test seam: callers (tests) can substitute a provider's trial runner. The * production `measureLatency` always uses the real implementations above. */ export interface LatencyDeps { fetchImpl?: typeof fetch; trialRunner?: (provider: Provider, modelId: string, prompt: string, maxTokens: number, env: EmpiricalEnv) => Promise; } /** * Run `trials` real streaming generations and return percentile-summarized * latency data. Each trial is retried once on failure; if both attempts * fail, the original provider error is rethrown. */ export declare const measureLatency: (options: MeasureLatencyOptions, deps?: LatencyDeps) => Promise; export { nthPercentile }; //# sourceMappingURL=latency.d.ts.map