Files
traefik-llmgateway/webui/src/lib/chart-labels.ts
T
lukaszraczyloandGitHub 979d903c19 feat: admin redesign, decision assist, prompt caching and shared state (#11)
This change adds the redesigned admin panel and the smart router decision model assist.
It adds opt-in prompt-prefix caching per provider and cached-token pricing and metrics.
With Redis, the metrics route reports fleet-wide values. The redis.sharedState switch shares six coordination states across replicas.
PR CI grants actions read, which the shared go-pr workflow needs.
The pull request description has the full list and the verification.
2026-11-26 15:50:11 +00:00

7 lines
381 B
TypeScript

/** thinLabels blanks every label except every Nth (N = ceil(len / max)), always keeping the last, so long axes stay legible. */
export function thinLabels(labels: string[], max = 6): string[] {
const step = Math.max(1, Math.ceil(labels.length / Math.max(1, max)))
const last = labels.length - 1
return labels.map((label, i) => (i % step === 0 || i === last ? label : ''))
}