Skip to content

feat(local-ai): guided model tier selection by device capability#120

Merged
graycyrus merged 2 commits into
mainfrom
feat/local-ai-model-tier-presets
Mar 31, 2026
Merged

feat(local-ai): guided model tier selection by device capability#120
graycyrus merged 2 commits into
mainfrom
feat/local-ai-model-tier-presets

Conversation

@graycyrus
Copy link
Copy Markdown
Contributor

@graycyrus graycyrus commented Mar 31, 2026

Summary

  • Add tiered model presets (Lightweight ~1B / Balanced ~4B / Performance ~12B) with device-aware recommendations based on RAM, CPU, and GPU detection
  • New Settings > Local AI Model panel with device info card, clickable tier cards with "Recommended" / "Active" badges, loading/error states, and "Advanced" toggle for existing runtime controls
  • 3 new RPC methods: local_ai_device_profile, local_ai_presets, local_ai_apply_preset — preset selection persists to config.toml with OPENHUMAN_LOCAL_AI_TIER env var override
  • Graceful degradation: bootstrap failure hints suggest stepping down a tier
  • Removes duplicate "Local Model Runtime" from Developer Options (now only in main Settings)
  • Fixes pre-existing lint warning in SkillSetupWizard.tsx

Changes

Rust core

  • src/openhuman/local_ai/presets.rsModelTier enum, ModelPreset struct, tier definitions, recommend_tier(), apply_preset_to_config(), current_tier_from_config()
  • src/openhuman/local_ai/device.rsDeviceProfile struct, detect_device_profile() using sysinfo crate (Apple Silicon GPU detection)
  • src/openhuman/local_ai/schemas.rs — 3 new controller schemas + handlers
  • src/openhuman/config/schema/local_ai.rsselected_tier: Option<String> field
  • src/openhuman/config/schema/load.rsOPENHUMAN_LOCAL_AI_TIER env var override
  • src/openhuman/local_ai/service/bootstrap.rs — degradation hint for tier step-down

Frontend

  • app/src/components/settings/panels/LocalModelPanel.tsx — tier selection UI with device info, loading/error states
  • app/src/components/settings/SettingsHome.tsx — "Local AI Model" main menu item
  • app/src/components/settings/panels/DeveloperOptionsPanel.tsx — removed duplicate entry
  • app/src/utils/tauriCommands.ts — TypeScript types + 3 RPC wrappers

Tests

  • 7 Rust unit tests (tier recommendation, preset application, config round-trip, custom detection)
  • Comprehensive JSON-RPC E2E test covering all 3 new methods

Test plan

  • cargo check passes
  • yarn typecheck passes
  • yarn lint passes (0 warnings)
  • yarn format:check passes
  • yarn build passes
  • yarn tauri dev — app launches, core connects, presets RPC returns correct device info and tier recommendations
  • Rust unit tests pass
  • JSON-RPC E2E tests pass
  • Manual: Settings > Local AI Model shows device info + 3 tier cards
  • Manual: Clicking a tier card applies it and shows "Active" badge
  • Manual: "Recommended" badge appears on correct tier for device

Closes #80

🤖 Generated with Claude Code

Add tiered model presets (Low/Medium/High) with device-aware recommendations
so users can pick a local AI model that fits their machine without editing
raw JSON config. Detect RAM, CPU, GPU via sysinfo crate and recommend a tier.
Persist selection to config.toml, with env var override and graceful
degradation hints on bootstrap failure.

- Rust: presets.rs (tier definitions, recommendation logic), device.rs
  (hardware detection), 3 new RPC methods, env var override, bootstrap hints
- Frontend: tier selector UI in Settings > Local AI Model with device info,
  loading/error states, and "Advanced" toggle for existing controls
- Tests: 7 Rust unit tests + comprehensive JSON-RPC E2E test
- Also fixes pre-existing lint warning in SkillSetupWizard.tsx

Closes #80
@graycyrus graycyrus merged commit 93c0b72 into main Mar 31, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local AI: guided model selection by device capability (tiered presets + user override)

1 participant