Skip to content

Surface hardware-requirement labels in model selection UI (follow-up to #1094) #1140

Closed

Description

@malibio

Overview

Add a user-visible hardware-requirement label per model in the model selection UI, so a user manually picking between catalog entries has a clear cue about which model their machine can actually run.

Problem Statement

PR #1134 landed Gemma 4 E4B and 31B alongside the existing Ministral 3B/8B entries and wired up RAM-tier-based auto-recommendation (recommended_model_id_for(family)). That covers the "default recommendation" path.

What it does not cover: a user who opens the model manager and wants to compare options themselves. The UI currently shows only file size and quantization (packages/desktop-app/src/lib/components/settings/model-manager.svelte lines 95-99). A user on 8 GB RAM has no signal that Gemma 4 31B will be unusable until they've downloaded ~18.7 GB and tried to load it.

#1094 listed "Both models appear in model selection UI with hardware requirements visible" as an acceptance criterion. That criterion was deferred from PR #1134 for scope reasons (the reviewer agreed the deferral was reasonable; this issue is the explicit follow-up).

Proposed Solution

Carry a minimum-RAM hint on every catalog entry, propagate it through the Tauri serialization boundary, and render it in the model card.

Implementation Approach

Phase 1: Catalog metadata

  • Add min_memory_gb: u8 field to CatalogEntry in packages/agent/src/local_agent/model_manager.rs.
  • Populate it on all four existing entries:
    • MINISTRAL_3B: 8
    • MINISTRAL_8B: 16
    • GEMMA_4_E4B: 16
    • GEMMA_4_31B: 24

Phase 2: Propagation to frontend

  • Add pub min_memory_gb: u8 to ModelInfo in packages/agent/src/agent_types.rs.
  • Populate it in GgufModelManager::list() (the models.push(ModelInfo { ... }) block) from the catalog entry.
  • For OllamaInferenceEngine's ModelInfo construction in packages/agent/src/local_agent/ollama_model_manager.rs, pick a sensible value (Ollama models are size-driven, so 16 GB is a reasonable default) or model it as Option<u8> and have Ollama return None.
  • Add the matching field to the TypeScript ModelInfo type in packages/desktop-app/src/lib/types/agent-types.ts.

Phase 3: UI surfacing

  • In packages/desktop-app/src/lib/components/settings/model-manager.svelte (the .model-card-meta block around lines 95-99), add a third inline span: Requires {min_memory_gb} GB RAM.
  • When the user's detected system RAM is below min_memory_gb, dim the card or add a subdued warning chip so the constraint is obvious before download.

Acceptance Criteria

  • CatalogEntry::min_memory_gb field added and populated for all four catalog entries
  • ModelInfo carries min_memory_gb through serde and Tauri serialization
  • TypeScript ModelInfo type matches the Rust struct
  • Model selection UI shows "Requires X GB RAM" for every model
  • Models the current machine cannot run are visually distinguished (dimmed / warning chip)
  • Tests cover the new field on CatalogEntry (extend list_models_have_correct_metadata and list_includes_gemma4_entries_with_correct_metadata in model_manager.rs)
  • Code passes bun run quality:fix
  • Tests pass (bun run test:all)

Technical Specifications

Reference Files

  • Catalog: packages/agent/src/local_agent/model_manager.rs (CatalogEntry at lines ~36-60; entries at ~63-118; list() impl around line 245)
  • Shared types: packages/agent/src/agent_types.rs (ModelInfo struct)
  • Ollama bridge: packages/agent/src/local_agent/ollama_model_manager.rs (one ModelInfo {...} construction site)
  • Frontend types: packages/desktop-app/src/lib/types/agent-types.ts (ModelInfo interface)
  • UI: packages/desktop-app/src/lib/components/settings/model-manager.svelte (model card meta row)

Detection of System RAM

The system-RAM detection function already exists in the same crate: detect_system_ram() in packages/agent/src/local_agent/model_manager.rs. The UI does not need to call it directly — expose the comparison via a Tauri command or reuse recommended_model_id_for(family) to highlight the recommended choice. The simplest UX is to surface the static min_memory_gb label and let the user judge against their own machine.

Suggested RAM Thresholds

Model min_memory_gb Rationale
Ministral 3B 8 ~2.1 GB GGUF + Metal working set fits comfortably on 8 GB
Ministral 8B 16 ~5.2 GB GGUF; needs headroom for context window
Gemma 4 E4B 16 ~5.0 GB GGUF; validated on M2 Pro 16 GB in nodespace-nlp-experiment
Gemma 4 31B 24 ~18.7 GB GGUF; matches issue #1094's stated "24 GB+ Apple Silicon" recommendation

Dependencies

Related Issues

Non-Goals

  • Hard-blocking downloads on insufficient RAM. The label is informational; users may have reasons to download a model that exceeds their current machine (e.g., transferring to another machine, planning a hardware upgrade).
  • Detecting available disk space. That is a separate concern handled in check_disk_space and is unrelated to runtime memory headroom.

Activity

  1. malibio commented on May 18, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 128 files, 3916 tests passed

  2. self-assigned this
    on May 18, 2026
  3. added a commit that references this issue on Jun 22, 2026
    1cafcbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions