microsoft / microsoft/winml-cli

P1-FEATURE-GGUF: GGUF Format — Load & Convert to ONNX

Open
#152 1 comment 0 reactions 1 assignee View on GitHub

@tezheng is already working on this.

Since Mar 31, 2026.

dev experience feature scale P1 QDQ triaged
Dominant language
Python
Stars
40
Forks
11
Avg merge
1d 8h
Merged PRs (30d)
50

Description

Summary

Implement GGUF model format loading and conversion to ONNX, supporting the top 10 popular GGUF architectures as an experimental best-effort feature.

Context

GGUF (GPT-Generated Unified Format) is the standard format for quantized LLMs deployed via llama.cpp. Supporting GGUF → ONNX conversion lets ModelKit work with the large ecosystem of GGUF-quantized models without requiring original PyTorch weights.

This is experimental (best-effort) for May 1. From:

  • plans/release/0315_release_plan/P1_CHECKLIST.md (P1-FEATURE-003)
  • plans/release/0501_release_plan/P0_CHECKLIST.md (P1-FEATURE-006)

Current State

Desired State

  • wmk build <path_to_model.gguf> loads and converts GGUF model to ONNX
  • INT4/INT8 quantization metadata preserved in ONNX output
  • Top 10 popular GGUF architectures supported (best-effort)
  • Converted ONNX model runs through the standard pipeline (analyze → optimize → perf)

Acceptance Criteria

  • GGUF file parser implemented (header + tensor extraction)
  • GGUF → ONNX conversion for at least 5 architectures (Llama, Mistral, Phi, Gemma, Qwen)
  • INT4 quantization metadata preserved in ONNX output
  • Converted model passes static analysis and runs on at least one EP (CPU)
  • wmk build --format gguf path/to/model.gguf works E2E
  • Experimental flag clearly communicated in CLI output
  • All existing tests pass (GGUF is additive, no regressions)

Technical Notes

  • GGUF tensor types: F32, F16, Q4_0, Q4_1, Q8_0, Q5_0, Q5_1, Q4_K, Q6_K, etc.
  • Consider using gguf Python library for parsing
  • INT4 representation in ONNX: use MatMulNBits op (ORT extension) or pack as INT8 with scale
  • Experimental status: gate behind --experimental flag or warning message

Related Files

  • plans/release/0315_release_plan/feature-scale.md — P1.2 GGUF Support
  • plans/release/0501_release_plan/feature-scale.md — P1.6 GGUF Format
  • plans/release/0315_release_plan/P1_CHECKLIST.md — P1-FEATURE-003
  • plans/release/0501_release_plan/P0_CHECKLIST.md — P1-FEATURE-006

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.