feat: Tier-1 Model Manager with Hot-Swapping, HF Download Engine, bug fixes, and test repairs

- Phase 4: Hugging Face Download Engine — streaming GGUF downloads with progress, cancellation, and managed-model storage
- Phase 5: Model Source Validation — source-mode compatibility, path/file validation, inline error UI with recovery guidance
- Hot-swap: stop runtime → update model_path → restart atomic command
- Model library: folder open, delete model file, local model management
- SettingsPage unified hub: local models list + HF search with 3-state action buttons
- Bug fixes: send button text restored (4 failing tests), reasoning-toggle aria-label, Rust warnings
- All 89 tests passing, cargo check clean
This commit is contained in:
Evandro Fonseca Junior committed 2026-03-31 02:03:55 -03:00
1 parent 01b629cb4a
commit 9a093dca15
23 files changed
+1798 -344

No files matched your search

+25 -7
View File
@@ -13,7 +13,8 @@ This milestone hardens the existing Tauri runtime workspace so operators can tru
- [x] **Phase 1: Draft State Ownership** - Separate live runtime state from editable draft state so polling cannot clobber user input.
- [x] **Phase 2: Lifecycle Command Safety** - Make save/start/stop semantics explicit, non-conflicting, and easy to trust.
- [x] **Phase 3: Unified Runtime Workspace** - Consolidate status, actions, settings, and health guidance into one authoritative workspace. (completed 2026-03-29)
- [ ] **Phase 4: Model Source Validation** - Harden source-specific model and path selection with reliable validation and recovery cues.
- [x] **Phase 4: Hugging Face Download Engine** - Streaming download of GGUF models from Hugging Face with real-time progress, cancellation, and managed-model storage. (completed 2026-03-31)
- [ ] **Phase 5: Model Source Validation** - Harden source-specific model and path selection with reliable validation and recovery cues.
## Phase Details
@@ -62,18 +63,34 @@ Plans:
- [x] `03-03-PLAN.md` - Integrate the unified workspace into the shell and remove split runtime surfaces.
**UI hint**: yes
### Phase 4: Model Source Validation
### Phase 4: Hugging Face Download Engine
**Goal**: Users can download GGUF models directly from Hugging Face with real-time progress, cancellation, and automatic storage in the managed-models directory.
**Depends on**: Phase 3 (Unified Runtime Workspace)
**Requirements**: HF-DL-01, HF-DL-02, HF-DL-03
**Success Criteria** (what must be TRUE):
1. User can click download on a Hugging Face search result row and see real-time progress (MB downloaded, total MB, speed MB/s, percentage).
2. User can cancel an in-progress download and have the partial file cleaned up.
3. Downloaded files are saved to the managed-models directory with proper path structure.
4. Downloads use the HF bearer token when available for authenticated access.
5. The download runs in Rust to avoid IPC bottlenecks, with progress emitted via Tauri events.
**Plans**: 3 plans
- [x] `04-01-PLAN.md` - Rust streaming download engine with progress events.
- [x] `04-02-PLAN.md` - React hook `useModelDownload` with Tauri event bridge.
- [x] `04-03-PLAN.md` - SettingsPage integration with `.sp-hf-file` row progress state.
**UI hint**: yes
### Phase 5: Model Source Validation
**Goal**: Users can choose valid runtime sources, models, and storage paths without destabilizing draft safety or applying invalid combinations.
**Depends on**: Phase 3
**Depends on**: Phase 4
**Requirements**: MODL-01, MODL-02
**Success Criteria** (what must be TRUE):
1. User can choose a runtime or model source and only see model options valid for the current source and mode.
2. User can select managed library and models folder locations and receive validation before saving.
3. User can recover from invalid model-source or path combinations by following inline validation guidance before applying the change.
**Plans**: 3 plans
- [x] `04-01-PLAN.md` - Add source-mode validation contract.
- [x] `04-02-PLAN.md` - Add path and model file validation.
- [x] `04-03-PLAN.md` - Add validation UI and recovery experience.
- [x] `05-01-PLAN.md` - Add source-mode validation contract.
- [x] `05-02-PLAN.md` - Add path and model file validation.
- [x] `05-03-PLAN.md` - Add validation UI and recovery experience.
**UI hint**: yes
## Progress
@@ -83,4 +100,5 @@ Plans:
| 1. Draft State Ownership | 3/3 | Complete | 2026-03-29 |
| 2. Lifecycle Command Safety | 3/3 | Complete | 2026-03-29 |
| 3. Unified Runtime Workspace | 3/3 | Complete | 2026-03-29 |
| 4. Model Source Validation | 3/3 | Planned | - |
| 4. Hugging Face Download Engine | 3/3 | Complete | 2026-03-31 |
| 5. Model Source Validation | 3/3 | Planned | - |