{{/* The usage tab of the people page. */}} {{define "usage_body"}} {{if .Error}}

{{.Error}}

{{end}} {{/* One row of controls above the charts, which is where a reader looks for them. Links rather than a script: the choice is in the URL, so a view worth coming back to can be bookmarked or pasted to somebody else. */}}
{{t "usage.group_by"}} {{range .Groups}}{{.Label}}{{end}} {{t "usage.window"}} {{range .Windows}}{{.Label}}{{end}}
{{template "tschart" dict "t" .Requests "title" (t "usage.requests") "note" (t "usage.requests_note")}} {{template "tschart" dict "t" .Tokens "title" (t "usage.tokens") "note" (t "usage.tokens_note")}}
{{if .Priced}} {{template "tschart" dict "t" .Spend "title" (t "usage.spend") "note" (t "usage.spend_note")}} {{else}} {{/* Said rather than drawn. A spend chart flat along the bottom reads as a quiet month, and this is not that. */}}

{{t "usage.spend"}}

{{th "usage.unpriced"}}

{{end}}
{{if .Rows}} {{if .HasStats}}{{end}} {{range .Rows}} {{if $.HasStats}}{{with .Stats}} {{end}}{{end}} {{end}}
{{t "usage.col.group"}}{{t "usage.requests"}}{{t "usage.tokens"}}{{t "usage.spend"}}{{t "usage.errors"}}{{t "usage.col.error_rate"}} {{t "usage.col.limited"}} {{t "usage.col.ttft"}} {{t "usage.col.latency"}}
{{.Name}} {{compact .Requests}} {{compact .Tokens}} {{.Spend}} {{if .Errors}}{{count .Errors}}{{else}}—{{end}}{{if .Requests}}{{t "usage.pct" (pct1 .ErrorRate)}}{{else}}—{{end}} {{if .Limited}}{{compact .Limited}}{{else}}—{{end}} {{pctile .TTFT 50}} / {{pctile .TTFT 95}} {{pctile .Latency 95}}
{{else}}

{{t "usage.empty"}}

{{end}} {{with .GPUHours}}

{{t "usage.gpu.title"}}

{{/* What each owner's models held, whether or not anybody asked them anything: a model kept loaded holds its cards all the same, and that is the time a GPU quota is about. */}}
{{template "tschart" dict "t" $.GPUHeld "title" (t "usage.gpu.chart") "note" (t "usage.gpu.chart_note")}}
{{range .}}{{end}}
{{t "usage.col.owner"}}{{t "usage.col.gpu_hours"}}{{t "usage.col.held_now"}}
{{.Owner}}{{num .Hours 1}}{{num .Now 0}}

{{t "usage.gpu.note"}}

{{end}} {{/* The charts fold their tail; the table does not. Both are here because they answer different questions, and the one that is easy to get wrong is thinking the four coloured lines are all of it. */}}

{{t "usage.note.charts"}}

{{th "usage.note.person"}}

{{end}}