Skip to content

Feature/add uqff support - #1

Open
paydii wants to merge 5 commits into
developmentfrom
feature/add-UQFF-support
Open

Feature/add uqff support#1
paydii wants to merge 5 commits into
developmentfrom
feature/add-UQFF-support

Conversation

@paydii

@paydii paydii commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What & why

Add support for UQFF model format.

Blocked by ondeinference/onde#10

How it was tested

Checklist

  • make lint passes (clippy + tsc, no warnings)
  • make fmt applied
  • make build compiles
  • Docs updated if behavior changed
  • I have signed the CLA (the bot will prompt on first PR)
  • This PR is focused on a single logical change

@paydii paydii self-assigned this Aug 10, 2026

@sigit-code sigit-code Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds UQFF (pre-quantised) model support alongside the existing GGUF and ISQ paths. A new UQFF_MODELS table (Qwen 3 family) feeds chat_list_models and resolve_model_id, dispatched through a new ResolvedModel::Uqff arm to ChatEngine::load_uqff_model. Download progress is now observable: blobs_dir_size gains an include_incomplete flag distinguishing completeness (ignore .part/.lock) from progress (count them), exposed via a new chat_download_progress command and polled from Settings to show a real percentage bar. CI clones a sibling onde checkout because Cargo.toml patches onde to a local path for the unreleased load_uqff_model API.

Start with mod.rs: the blobs_dir_size semantics split and the ResolvedModel dispatch are the core. Note the CI/Cargo.toml patch is explicitly temporary and must be reverted once onde publishes.


Automated review by siGit Code · commit e64c41a

description: sanitize_description(entry.description),
approx_memory: entry.approx_memory.to_string(),
size_bytes: Some(entry.expected_size_bytes),
is_downloaded: is_model_downloaded(entry.id, entry.expected_size_bytes),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning — Two 4B variants (Qwen3-4B-Instruct-2507 and Qwen3-4B-Thinking-2507) share the identical expected_size_bytes 3_040_959_629 as the base 4B; if that value was copied rather than measured per-repo, is_downloaded/progress will be off for those two.

Comment thread src-tauri/src/chat/mod.rs
let entry = UQFF_MODELS.iter().find(|m| m.id == id)?;
Some(UqffModelConfig {
model_id: entry.id.to_string(),
files: vec!["q4k-0.uqff".to_string()],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warningfiles is hardcoded to q4k-0.uqff for every entry; if any repo shards the q4k weights across more than one file (e.g. q4k-1.uqff), the load and the size accounting silently miss the rest.

Comment thread src/Settings.tsx
}
let active = true;
const tick = async () => {
const bytes = await getDownloadProgress(selectedId).catch(() => null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit — If getDownloadProgress returns 0 during a real in-flight download (unknown id / empty cache also return 0), the bar shows 0% indistinguishably from a stalled transfer, matching the doc but worth confirming the id passed matches the loading model's cache id.

Comment thread .github/workflows/ci.yml
- name: Check out the Onde engine as a sibling checkout
run: |
git clone --depth 1 \
--branch feature/add-UQFF-support \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit — The clone hardcodes branch feature/add-UQFF-support; once that branch merges/deletes on the onde side, CI on this branch breaks until the patch block is removed as noted.

@sigit-code sigit-code Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds UQFF (pre-quantised Qwen 3) model support: a new UQFF_MODELS table with per-model metadata, a ResolvedModel::Uqff variant and load path via onde's load_uqff_model, plus a download-progress command (chat_download_progress) that reads bytes-on-disk (including .part files) from the HF cache. The frontend polls this to turn the loading spinner into a real percentage. blobs_dir_size gains an include_incomplete flag so completeness checks exclude .part/.lock while progress includes them, with tests covering the threshold regression. CI temporarily clones the onde sibling checkout because Cargo.toml now patches onde to a local path — reviewers should note this and the patch must be reverted once onde ships UQFF.


Automated review by siGit Code Review · commit 15eef14

{
use super::UQFF_MODELS;
for entry in UQFF_MODELS {
if entry.desktop_only && !cfg!(any(target_os = "macos", target_os = "windows")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warningdesktop_only filters to macOS/Windows only, but the model table is compiled for iOS/Android/Windows too; non-desktop-only UQFF models are still offered on mobile, so verify the huge non-desktop_only entries (e.g. 32B ~19.5 GB) are actually intended to appear on phones.

Comment thread src-tauri/src/chat/mod.rs
target_os = "windows"
))]
pub(crate) fn uqff_config_for_model_id(id: &str) -> Option<UqffModelConfig> {
let entry = UQFF_MODELS.iter().find(|m| m.id == id)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning — Every 30B-A3B / MoE / Coder entry shares the identical expected_size_bytes (17_640_189_769) and several 4B variants share 3_040_959_629; if these are copy-paste placeholders rather than true measured sizes, is_model_downloaded and the progress percentage will be wrong for those models.

target_os = "windows"
)))]
#[tauri::command]
pub async fn chat_download_progress(_model_id: String) -> u64 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit — The cfg(not(...)) fallback lists the same four targets; simpler to just use the always-defined model_downloaded_bytes if it were gated identically, but as-is the duplicated cfg lists must stay perfectly in sync across three files.

Comment thread src/Settings.tsx
}
let active = true;
const tick = async () => {
const bytes = await getDownloadProgress(selectedId).catch(() => null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit — The 1s poll continues across model switches: selectedId change re-triggers the effect, but a slow in-flight getDownloadProgress for the previous id could still resolve; active guards state but the awaited call for the old model may briefly overlap. Minor given the guard.

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.

1 participant