Severity-ordered psychbench sections, streamlined run metadata card with server config YAML
This commit is contained in:
parent
6f6f43c5ec
commit
8ec5c28623
2 changed files with 26 additions and 15 deletions
|
|
@ -130,9 +130,24 @@ public function suiteResults(?string $level = null, ?string $sortBy = null, ?str
|
|||
$orderCol = $sortBy ?? $defaultOrder;
|
||||
$direction = $sortDir === 'asc' ? 'asc' : 'desc';
|
||||
|
||||
// psychbench sections are severity labels (mild → severe). Sort them
|
||||
// by clinical severity, not alphabetically, when sorting by section.
|
||||
$severitySort = $this->suite === 'psychbench' && $orderCol === 'section';
|
||||
|
||||
return $this->{$relation}()
|
||||
->when($level !== null && $level !== '', fn ($q) => $q->where('level', $level))
|
||||
->orderBy($orderCol, $direction)
|
||||
->when($severitySort, function ($q) use ($direction) {
|
||||
$q->orderByRaw("CASE section
|
||||
WHEN 'mild' THEN 1
|
||||
WHEN 'moderate' THEN 2
|
||||
WHEN 'difficult' THEN 3
|
||||
WHEN 'severe' THEN 4
|
||||
WHEN 'documentation' THEN 5
|
||||
ELSE 6
|
||||
END {$direction}");
|
||||
}, function ($q) use ($orderCol, $direction) {
|
||||
$q->orderBy($orderCol, $direction);
|
||||
})
|
||||
->orderBy('id')
|
||||
->get();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,24 +131,20 @@ private function sortDir(): string
|
|||
</div>
|
||||
|
||||
<flux:card>
|
||||
<flux:heading size="md">{{ __('Run metadata') }}</flux:heading>
|
||||
<div class="mt-4 grid grid-cols-2 gap-x-8 gap-y-2 text-sm md:grid-cols-4">
|
||||
<div><span class="text-zinc-500">{{ __('Engine build') }}</span><div class="font-mono">{{ $this->run->engine_build ?? '—' }}</div></div>
|
||||
<div><span class="text-zinc-500">{{ __('Context') }}</span><div class="font-mono">{{ number_format($this->run->n_ctx ?? 0) }}</div></div>
|
||||
<div><span class="text-zinc-500">{{ __('Slots') }}</span><div class="font-mono">{{ $this->run->slots ?? '—' }}</div></div>
|
||||
<div class="flex flex-wrap items-center gap-x-8 gap-y-2 text-sm">
|
||||
<div><span class="text-zinc-500">{{ __('GPU') }}</span><div>{{ ($this->run->gpu_count ? $this->run->gpu_count.'x ' : '').($this->run->gpu ?? 'unknown') }}</div></div>
|
||||
<div><span class="text-zinc-500">{{ __('Context') }}</span><div class="font-mono">{{ number_format($this->run->n_ctx ?? 0) }}</div></div>
|
||||
<div><span class="text-zinc-500">{{ __('Inference host') }}</span><div><flux:badge size="xs" color="sky">{{ $this->run->engine ?? 'unknown' }}</flux:badge></div></div>
|
||||
<div class="col-span-2"><span class="text-zinc-500">{{ __('Image digest') }}</span><div class="break-all font-mono text-xs">{{ $this->run->image_digest ?? '—' }}</div></div>
|
||||
@if ($this->run->serverConfig)
|
||||
<div class="col-span-2"><span class="text-zinc-500">{{ __('Server config') }}</span><div><flux:badge size="xs" color="amber">{{ $this->run->serverConfig->name }}</flux:badge></div></div>
|
||||
@endif
|
||||
@if ($this->run->suite_versions)
|
||||
<div class="col-span-2"><span class="text-zinc-500">{{ __('Suite versions') }}</span><div class="break-all font-mono text-xs">{{ json_encode($this->run->suite_versions) }}</div></div>
|
||||
@endif
|
||||
@if ($this->run->validators)
|
||||
<div class="col-span-2"><span class="text-zinc-500">{{ __('Validators') }}</span><div class="break-all font-mono text-xs">{{ json_encode($this->run->validators) }}</div></div>
|
||||
@if ($this->run->label)
|
||||
<div><span class="text-zinc-500">{{ __('Run name') }}</span><div><flux:badge size="xs" color="amber">{{ $this->run->label }}</flux:badge></div></div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($this->run->serverConfig)
|
||||
<div class="mt-4">
|
||||
<flux:heading size="sm">{{ __('Server config') }} — {{ $this->run->serverConfig->name }}</flux:heading>
|
||||
<pre class="mt-2 overflow-x-auto rounded-lg bg-zinc-900 p-4 text-xs leading-relaxed text-zinc-100">{{ $this->run->serverConfig->config_yaml }}</pre>
|
||||
</div>
|
||||
@endif
|
||||
</flux:card>
|
||||
|
||||
@if ($this->run->isOwnedBy(auth()->user()))
|
||||
|
|
|
|||
Loading…
Reference in a new issue