Downloads · 30 days
11
6% of all-time downloads
MikeKuykendall/phi-3.5-moe-q2-k-cpu-offload-gguf
phi-3.5-moe-q2-k-cpu-offload-gguf is a text generation model from MikeKuykendall. Use it when you need the model to write or continue text. The card lists the license as mit.
This is a Q2K quantization of Microsoft's Phi-3.5-MoE-Instruct model with MoE (Mixture of Experts) CPU offloading capability enabled via Rust bindings for llama.cpp.
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
192
Public
Repo size
15.3 GB
Likes
0
Public
Click a slice to open those files.
.gguf15.3 GB · 100%
From the Hugging Face model README
This is a Q2_K quantization of Microsoft's Phi-3.5-MoE-Instruct model with MoE (Mixture of Experts) CPU offloading capability enabled via Rust bindings for llama.cpp.
Tested on Lambda Cloud GH200 (96GB VRAM, 480GB RAM, CUDA 12.8) with shimmy v1.6.0:
| Configuration | VRAM Usage | VRAM Saved | Reduction |
|---|---|---|---|
| All GPU (baseline) | 14.78 GB | - | - |
CPU Offload (--cpu-moe) | 1.34 GB | 13.44 GB | 90.9% |
Mixture of Experts models activate only a subset of parameters per token (sparse activation). This quantization includes Rust bindings that expose llama.cpp's MoE CPU offloading feature, allowing inactive experts to reside in system RAM instead of VRAM.
Note: The core MoE CPU offloading algorithm was implemented in llama.cpp (PR #15077, August 2025). This release provides Rust language bindings and production integration for that functionality.
# Download the model
huggingface-cli download MikeKuykendall/phi-3.5-moe-q2-k-cpu-offload-gguf \
phi-3.5-moe-Q2_K.gguf --local-dir ./models
# Run with CPU offloading (uses ~1.3 GB VRAM)
shimmy serve \
--model-dirs ./models \
--cpu-moe \
--bind 127.0.0.1:11435
# Run without offloading (uses ~15 GB VRAM)
shimmy serve \
--model-dirs ./models \
--bind 127.0.0.1:11435
use llama_cpp_2::context::params::LlamaContextParams;
use llama_cpp_2::llama_backend::LlamaBackend;
use llama_cpp_2::model::params::LlamaModelParams;
use llama_cpp_2::model::LlamaModel;
fn main() {
let backend = LlamaBackend::init().unwrap();
// Enable MoE CPU offloading
let model_params = LlamaModelParams::default()
.with_cpu_moe_all(); // Offload all inactive experts to CPU
let model = LlamaModel::load_from_file(
&backend,
"phi-3.5-moe-Q2_K.gguf",
&model_params
).unwrap();
let ctx_params = LlamaContextParams::default()
.with_n_ctx(2048);
let mut ctx = model.new_context(&backend, ctx_params).unwrap();
// ... tokenize and generate as normal
}
# Build llama.cpp with CUDA support
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release
# Run with CPU offloading
./build/bin/llama-cli \
-m phi-3.5-moe-Q2_K.gguf \
-p "Explain quantum computing" \
--cpu-moe
Phi-3.5-MoE uses a sparse Mixture of Experts architecture where only a subset of experts are activated per token. This allows the model to have high capacity (many parameters) while maintaining efficiency (sparse activation).
The --cpu-moe flag (or with_cpu_moe_all() in Rust) tells llama.cpp to:
This dramatically reduces VRAM usage with a manageable performance trade-off.
Prompt: "Explain quantum computing in simple terms"
Response:
Sure! Imagine you have a magical coin that can land on heads or tails in a super-special way. When you flip it, instead of just being heads OR tails, it can be both at the same time...
(Coherent response generated, suitable quality for Q2_K quantization)
If you use this model in your work, please cite the original Phi-3.5 paper and acknowledge the quantization:
@article{phi3.5,
title={Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone},
author={Microsoft Research},
year={2024}
}
License: MIT (inherited from base model)
Quantized by: MikeKuykendall
Date: October 2025