How to Use ModelDiff
Step 1: Load Models
Drag and drop two model files (.gguf or .safetensors) into the side-by-side drop zones. Or click the zones to browse for files.
Note: ModelDiff only reads the file headers. Even 100GB+ files parse in seconds because we never load the actual tensor data.
Step 2: Compare
Click the "Compare Models" button. ModelDiff will analyze the differences and show you a detailed report.
Step 3: Explore Results
The report has 4 tabs:
- Summary: High-level comparison — file sizes, tensor counts, quick stats.
- Metadata Diff: (GGUF only) See which metadata keys changed, were added, or removed.
- Tensor Diff: Detailed table of all tensors. Filter by status (added/removed/changed), search by name, sort by size delta.
- Size Analysis: Interactive charts showing total size, size by quantization type, and top changed tensors.
What Are GGUF and SafeTensors?
GGUF
GGUF (GPT-Generated Unified Format) is a binary format used by llama.cpp, ollama, and other C/C++ LLM tools. It stores model weights, metadata (architecture, parameters, etc.), and tensor info in a compact binary structure.
Common use: Quantized models (Q4_K_M, Q5_K_S, etc.) for efficient inference.
SafeTensors
SafeTensors is a simple, safe format developed by HuggingFace. It stores tensors with a JSON header describing their shapes and data types. It's designed to prevent arbitrary code execution and is easier to parse than pickle-based formats.
Common use: Fine-tuned models from HuggingFace, often in F16 or F32 precision.
Use Cases
1. Comparing Quantizations
You have model-f16.gguf and model-q4_k_m.gguf. Use ModelDiff to verify:
- All tensors are present in the quantized version
- Only the quantization type changed (not shapes)
- How much space you saved
2. Checking Fine-Tune Changes
You fine-tuned a model. Compare the base and fine-tuned versions to see:
- Which tensors changed (usually adapter weights or specific layers)
- Whether the structure remained intact
3. Verifying Merges
You merged two models. Compare the merged result with the originals to confirm:
- The merge didn't corrupt the structure
- Tensor counts match expectations
4. Cross-Format Conversion
You converted a SafeTensors model to GGUF. Use ModelDiff to check:
- All tensors were converted correctly
- Shapes and types match (accounting for quantization)
Tips
Performance
- ModelDiff reads only headers, so even 100GB files are fast.
- Comparison happens in-browser. No uploads, no waiting for server processing.
Filters
- Use the Metadata Diff filter to hide unchanged keys and focus on changes.
- Use the Tensor Diff status filter to show only added/removed/changed tensors.
- Search by tensor name to quickly find specific layers (e.g., "attention").
Charts
- The Size by Quantization Type chart shows which quant types dominate your model.
- The Top Changed Tensors chart highlights the biggest size deltas (useful for debugging merges or fine-tunes).
FAQ
Q: Can I compare two SafeTensors files?
Yes! ModelDiff supports GGUF-GGUF, SafeTensors-SafeTensors, and GGUF-SafeTensors comparisons.
Q: Why does it say "Metadata Diff only available for GGUF files"?
SafeTensors has minimal metadata (usually just format type). GGUF stores rich metadata (architecture, vocab size, etc.). The Metadata Diff tab only works when at least one model is GGUF.
Q: Do I need to upload my files?
No. Everything happens in your browser. Your files never leave your device.
Q: Can I use ModelDiff offline?
Yes, once the page loads. The only external dependency is ECharts (loaded from CDN), but modern browsers cache it.
Q: What if tensor names don't match?
ModelDiff matches tensors by exact name. If you're comparing GGUF vs SafeTensors and names differ (e.g., "blk.0.attn_q.weight" vs "model.layers.0.self_attn.q_proj.weight"), they'll show as added/removed rather than matched. This is expected for cross-format conversions.
Troubleshooting
Parse Error
If you see "Invalid GGUF magic number" or similar:
- Make sure the file is actually .gguf or .safetensors (not .bin or other formats)
- Check if the file is corrupted (try re-downloading)
- GGUF version must be 3 (older versions not supported)
Browser Compatibility
ModelDiff uses modern JavaScript (File.slice, DataView, TextDecoder). Works in:
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
Contact
Need help? Found a bug? Email nullkit.dev@outlook.com.