Files
Kaname/src/lib/benchmark-view.test.ts
T
Pascal LinxweilerandClaude Opus 5.5 276108932d
Release / release (push) Successful in 12m32s
Release 0.15.0: endpoints instead of deployments
Kaname keeps two jobs: the model downloader and benchmarks. Benchmarks
now run against endpoints (any OpenAI-compatible server added by URL,
with an optional server-side API key and hand-written hardware notes)
instead of deployments Kaname started itself.

Removed: runtimes, deployments, sweeps, resource telemetry, hardware
detection, the /api/v1 API with tokens and guardrails, and all Docker
access. The quality eval's coding tests run in a network-less sandbox
container that shares only an exchange folder with the worker.

The previous state is kept in branch backup / tag backup-0.14.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:43:42 +01:00

66 lines
2.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { configChips, deltaPct, describeSettings, engineName, headline, modelName, targetName } from "./benchmark-view";
import type { BenchmarkSnapshot, BenchmarkSummary } from "./db/schema";
const summary: BenchmarkSummary = {
combined: { decode: 42.5, ttft_p50: 180, itl_low1: null, update_p50: null, update_p99: null },
single: [],
prefill: [
{ target_depth: 2048, skipped: false, pp_med: 900 },
{ target_depth: 8192, skipped: false, pp_med: 700 },
{ target_depth: 65536, skipped: true },
],
concurrency: [
{ level: 1, ok: 48, requests: 48, aggregate_tps: 40, ttft_p50: 100, ttft_p99: 200, decode_med: 40 },
{ level: 4, ok: 48, requests: 48, aggregate_tps: 95, ttft_p50: 300, ttft_p99: 900, decode_med: 25 },
{ level: 8, ok: 48, requests: 48, aggregate_tps: 90, ttft_p50: 700, ttft_p99: 2000, decode_med: 12 },
],
phases: ["decode", "prefill", "concurrency"],
cacheHits: 0,
betterbenchVersion: "0.6.1",
corpusVersion: "1.0",
passes: 20,
quick: false,
};
describe("benchmark view", () => {
it("picks the headline numbers", () => {
assert.deepEqual(headline(summary), { decode: 42.5, ttftMs: 180, prefill: { tps: 700, depth: 8192 }, peak: { tps: 95, level: 4 } });
assert.deepEqual(headline(null), { decode: null, ttftMs: null, prefill: null, peak: null });
});
it("lists set options as chips", () => {
const snap = {
options: { modelFile: "Qwen3-0.6B-Q4_K_M.gguf", contextSize: 4096, threads: 8, cacheTypeK: "q8_0", extraArgs: [] },
cpus: 8,
memoryMb: null,
} as unknown as BenchmarkSnapshot;
assert.deepEqual(configChips(snap), ["context 4096", "kv cache q8_0 / f16", "Q4_K_M", "threads 8", "cpu limit 8 cores"]);
});
it("lists an endpoint's notes as chips, and names it, its model and engine", () => {
const snap: BenchmarkSnapshot = {
type: "endpoint",
endpointName: "arc box",
model: "Qwen3-8B-Q4_K_M.gguf",
engine: "vllm",
engineVersion: "0.31.0",
contextSize: 32768,
hardware: { gpuName: "Intel Arc Pro B65", gpuCount: 2, kvCache: "fp8", concurrency: 4 },
};
assert.deepEqual(configChips(snap), ["2× Intel Arc Pro B65", "Q4_K_M", "context 32768", "parallel slots 4", "kv cache fp8"]);
assert.equal(targetName(snap), "arc box");
assert.equal(modelName(snap), "Qwen3-8B-Q4_K_M.gguf");
assert.equal(engineName(snap), "vLLM 0.31.0");
assert.equal(engineName({ ...snap, hardware: { engineName: "vllm-radiance" } }), "vllm-radiance 0.31.0");
});
it("describes settings and deltas", () => {
assert.equal(describeSettings({ quick: true, passes: null, warmup: null, phases: [] }), "quick, 5 passes · all phases");
assert.equal(describeSettings({ quick: false, passes: 10, warmup: null, phases: ["decode"] }), "10 passes · decode");
assert.equal(deltaPct(110, 100), 10);
assert.equal(deltaPct(null, 100), null);
});
});