Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/app/src/components/GlobalFilterContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,21 @@ export function GlobalFilterProvider({
}
}, [unofficialAvailable, selectedModel]);

// Auto-switch when the (URL- or default-) selected model has zero rows in
// availability — e.g. a small / freshly-truncated self-host DB where the
// upstream default (DeepSeek-R1) was never ingested. Without this, /evaluation
// and /inference both show "No data" on first paint and the user has to know
// to manually pick a model from the dropdown.
const didFallbackToFirstAvailableRef = useRef(false);
useEffect(() => {
if (!availabilityRows || availableModels.length === 0) return;
if (didFallbackToFirstAvailableRef.current) return;
if (availableModels.includes(selectedModel)) return;
if (getUrlParam('g_model')) return; // honor explicit URL pick even if empty
didFallbackToFirstAvailableRef.current = true;
setSelectedModel(availableModels[0]);
}, [availabilityRows, availableModels, selectedModel, getUrlParam]);

// Sequences available for the selected model (DB ∪ unofficial run for this model)
const availableSequences = useMemo(() => {
const unofficialSeqs = unofficialAvailable
Expand Down
Loading