unlock unlimited code runs for $79, limited time →
NOSSLETTER.techLIVE
back to archive

ui : Discover & Download Models from HF Hub

Language: C+++5688 -580feature
concepts demonstrated
Graphical User Interface (GUI) designAsynchronous download managementContainer queries for responsive designState management with live status updates
The Issue & Context

Before this PR, users could not browse or download GGUF models directly from HuggingFace Hub within the UI, nor manage quant-matched draft sidecar files alongside main model downloads.

Root Cause Analysis

The existing model manager lacked integration with HuggingFace Hub APIs and did not support coordinating downloads of main quantized models with their corresponding draft sidecar files, resulting in manual, error-prone workflows and missing UI affordances for these operations.

Solution Strategy & Architectural Pattern

This PR introduces a Discover Models view that fetches and displays HF GGUF models with search, filters, and detailed info, plus download chips showing live states. It extends download logic in common/download.cpp to handle tagged sidecar files (e.g., dflash, mtp) linked to main quant models, enabling automatic and manual draft downloads with synchronized pause/resume/cancel controls. The UI components were updated to show draft sub-lines under main models, and settings were added to toggle Discover integration and filter out unsupported decision models.

Key Takeaway for Contributors

When integrating external model repositories into a UI with complex download dependencies, explicitly model and coordinate related file sets (main + sidecars) in both backend download logic and frontend state to maintain consistent user controls and resumable downloads.