Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ChevronRight } from 'lucide-react';
import { useT } from '../../i18n/useT';
import * as api from '../../services/api';
import { useChatStore, type SettingsSection } from '../../stores/chatStore';
import { useModelStore } from '../../stores/modelStore';
import { displayModelName, useModelStore } from '../../stores/modelStore';
import { ConfirmSheet } from '../setup/ConfirmSheet';
import { formatSize, ltrIn, totalMemory } from '../setup/format';
import { isServerDown } from './ErrorNotice';
Expand Down Expand Up @@ -48,7 +48,9 @@ export function SetupSettings() {

// The plan's chat model is setup's local pick; a cloud user runs something else.
const planned = plan?.catalog?.find((e) => e.id === plan.chat_model.id);
const chatName = active?.model ? (active.label ?? active.display_name ?? active.model) : planned?.name ?? null;
// A local model's label is its raw id and an English place word; a cloud one names its provider.
const activeName = active?.model ? (active.remote ? active.label ?? displayModelName(active.model) : displayModelName(active.model)) : null;
const chatName = activeName ?? planned?.name ?? null;
const installed = (plan?.catalog ?? []).filter((e) => e.downloaded);
const installedGb = installed.reduce((sum, e) => sum + (e.full_size_gb ?? 0), 0);
const device = [hardware?.gpu_name, hardware?.npu_detected ? t('setup.checks.npu') : null].filter(Boolean).join(' · ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ describe('SetupSettings', () => {
useChatStore.getState().setSystemStatus(null);
});

it('names a local model as every other screen does, not by its id', async () => {
useModelStore.setState({ active: { ...LOCAL, label: `${QWEN} · local` } });
render(<SetupSettings />);
expect(await screen.findByText('Running Qwen3.6 35B A3B')).toBeTruthy();
expect(screen.queryByText(/GGUF|· local/)).toBeNull();
});

it('falls back to the planned model before the active model is known', async () => {
useModelStore.setState({ active: null });
render(<SetupSettings />);
Expand Down
14 changes: 11 additions & 3 deletions src/gaia/ui/setup_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,11 @@ def _catalog(
is_embedding_model_id,
remaining_download_gb,
)
from gaia.llm.lemonade_client import is_cloud_model_entry, runs_on_npu
from gaia.llm.lemonade_client import (
DEFAULT_MODEL_LADDER,
is_cloud_model_entry,
runs_on_npu,
)

same = model_choice.ids_match
lemonade_list = (
Expand Down Expand Up @@ -440,8 +444,12 @@ def listed(model_id: str, ids: List[str]) -> bool:
entry = entry_for(model_id)
downloaded = bool(entry.get("downloaded")) if entry else False
full = entry.get("size") if entry else None
if not isinstance(full, (int, float)):
full = _registry_size(model_id)
# The plan's fit checks run on the server's size for setup's own models;
# any other model shows the one size Settings shows for it.
if not isinstance(full, (int, float)) or not listed(
model_id, [*base, *DEFAULT_MODEL_LADDER]
):
full = model_choice.download_size_gb(model_id, full)
partial_gb = 0.0 if downloaded else round((on_disk.get(model_id) or 0) / 1e9, 2)
remaining: Optional[float] = (
0.0 if downloaded else remaining_download_gb(full, on_disk.get(model_id))
Expand Down
26 changes: 26 additions & 0 deletions tests/unit/chat/ui/test_setup_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,32 @@ def test_catalog_offers_the_users_flm_model_but_not_speech_or_strays(flm_box):
assert not _entry(plan, DEFAULT_EMBEDDING_MODEL)["chat_choice"]


def test_catalog_shows_settings_size_for_a_model_outside_setups_own(
running, monkeypatch
):
"""Lemonade lists Muse Glimmer in GiB (19.9); Settings shows 21.4 GB."""
from gaia.llm.lemonade_client import MUSE_GLIMMER_MODEL_NAME

fake = running(BIG_GPU)
listed = fake.list_models
muse = {
"id": MUSE_GLIMMER_MODEL_NAME,
"downloaded": False,
"size": 19.9,
"recipe": "llamacpp",
"labels": ["chat", "tool-calling"],
}
monkeypatch.setattr(
fake, "list_models", lambda show_all=False: {"data": listed()["data"] + [muse]}
)
plan = sp.build_plan()
shown = sp.model_choice.download_size_gb(MUSE_GLIMMER_MODEL_NAME, 19.9)
assert shown == 21.36
assert _entry(plan, MUSE_GLIMMER_MODEL_NAME)["full_size_gb"] == shown
# Setup's own models keep the size the plan's fit checks run on.
assert _entry(plan, DEFAULT_MODEL_NAME)["full_size_gb"] == 5.6


def test_catalog_leaves_out_cloud_models_lemonade_lists_as_downloaded(
flm_box, monkeypatch
):
Expand Down
Loading