/** * Real-API speed benchmark — sends actual requests to a live provider and * measures TTFT, output throughput, cache behavior, and wall-clock latency. * * Unlike the mock benchmark, this hits real endpoints and produces * production-representative numbers. Uses gg's own AuthStorage to resolve * credentials (same path as a real session). * * Usage: * npx tsx src/core/api-benchmark.ts * * Environment overrides: * GG_BENCH_PROVIDER — provider name (default: "glm") * GG_BENCH_MODEL — model id (default: "glm-5.3") * GG_BENCH_TURNS — number of turns (default: 5) */ export interface ApiTurnMetrics { turn: number; prompt: string; ttftMs: number; outputTokens: number; outputDurationMs: number; tokensPerSecond: number; wallClockMs: number; inputTokens: number; cacheRead: number; cacheWrite: number; cacheHit: boolean; stopReason: string; } export interface ApiBenchmarkResult { provider: string; model: string; turns: ApiTurnMetrics[]; totalWallClockMs: number; totalTtftMs: number; totalOutputTokens: number; avgTokensPerSecond: number; avgTtftMs: number; cacheHits: number; cacheHitRate: number; } export declare function runApiBenchmark(config: { provider: string; model: string; apiKey: string; baseUrl?: string; accountId?: string; cacheRetention?: "short" | "long"; promptCacheKey?: string; turns?: number; }): Promise; export declare function formatApiResult(result: ApiBenchmarkResult): string; export interface ApiComparisonResult { baseline: ApiBenchmarkResult; optimized: ApiBenchmarkResult; ttftImprovement: number; throughputImprovement: number; wallClockImprovement: number; cacheHitRateDelta: number; } /** Format an A/B comparison between two API benchmark runs. */ export declare function formatApiComparison(c: ApiComparisonResult): string; //# sourceMappingURL=api-benchmark.d.ts.map