Instructions to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF", filename="Kimi-Linear-48B-A3B-Instruct-APEX-balanced.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF # Run inference directly in the terminal: llama cli -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF # Run inference directly in the terminal: llama cli -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF # Run inference directly in the terminal: ./llama-cli -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF # Run inference directly in the terminal: ./build/bin/llama-cli -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Use Docker
docker model run hf.co/Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
- LM Studio
- Jan
- vLLM
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
- Ollama
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with Ollama:
ollama run hf.co/Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
- Unsloth Studio
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF to start chatting
- Pi
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with Docker Model Runner:
docker model run hf.co/Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
- Lemonade
How to use Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Run and chat with the model
lemonade run user.Kimi-Linear-48B-A3B-Instruct-APEX-GGUF-{{QUANT_TAG}}List all available models
lemonade list
Kimi-Linear-48B-A3B-Instruct β APEX GGUF
MoE-aware, mixed-precision APEX quantizations of moonshotai/Kimi-Linear-48B-A3B-Instruct β 48B total / ~3B active, a hybrid linear-attention MoE: most layers use KDA (Kimi Delta Attention, gated-delta linear attention), a few use full MLA attention, over a 256-routed + 1-shared expert FFN.
To my knowledge this is the first APEX quant of a linear-attention hybrid MoE. APEX assigns precision per tensor role and per layer instead of uniformly; here that meant teaching the recipe about tensor families the stock generator doesn't know (see Method).
Results
Perplexity on wikitext-2-raw (test, 200Γ512-token windows), llama-perplexity.
| File | Size | BPW | PPL | Ξ vs bf16 |
|---|---|---|---|---|
| bf16 (reference) | 92 GB | 16.0 | 7.374 | β |
| APEX-balanced (no-imatrix) | 33 GB | 5.72 | 7.377 | +0.04% |
| APEX-handroll (ssm@Q8_0, no-imatrix) | 33 GB | 5.72 | 7.382 | +0.11% |
| APEX-i-quality (imatrix, IQ4_XS mid experts) | 29 GB | 4.94 | pending | pending |
Both no-imatrix tiers land essentially on the bf16 reference (within ~0.1%). An
imatrix-guided i-quality tier (IQ4_XS mid experts, 29 GB) is now available
as Kimi-Linear-48B-A3B-Instruct-APEX-i-quality.gguf; its perplexity benchmark is
still being run and will be filled in here.
From a 92 GB bf16 baseline β 33 GB (~2.8Γ smaller), and it runs on a 128 GB unified-memory box (fits with full GPU offload). Coherent on general and factual prompts.
The balanced and handroll tiers were built without an imatrix (Q6_K/Q5_K
experts, Q8_0 shared, Q6_K attention β none of which require importance data). The
newer i-quality tier is imatrix-guided (IQ4_XS mid experts). Deeper lower-bit
"I-tier" variants (IQ3/IQ2) would also need an imatrix and are not included here.
Note on the two tiers (a null result)
The hand-roll tier pins the KDA recurrence tensors (ssm_conv1d_*,
ssm_f/g_*, ssm_beta) to Q8_0 instead of Q6_K, testing whether protecting
the linear-attention state preserves quality. It doesn't β PPL is identical
within noise (7.382 vs 7.377), at the same size (the ssm tensors are tiny next to
the experts). Use balanced. The hand-roll is kept only to document the
experiment.
Which file
- APEX-balanced β recommended. Q6_K/Q5_K experts on a layer-depth gradient, Q8_0 shared experts, Q6_K attention + KDA tensors.
- APEX-i-quality β imatrix-guided IQ4_XS mid experts (29 GB); the smallest tier
here. Try it when you want to save a few GB over
balanced; PPL comparison pending. - APEX-handroll β experimental (see null-result note below); not recommended.
Usage (llama.cpp)
llama-cli -m Kimi-Linear-48B-A3B-Instruct-APEX-balanced.gguf -ngl 999 -p "Hello"
llama-server -m Kimi-Linear-48B-A3B-Instruct-APEX-balanced.gguf -ngl 999 --host 0.0.0.0 --port 8080
Requires a llama.cpp build supporting the kimi_linear architecture and the
kimi-k2 pre-tokenizer.
Method
APEX is a bit-allocation recipe over stock llama-quantize --tensor-type-file.
Kimi-Linear needed two tensor families the stock APEX generator doesn't emit:
- MLA (full-attention layers):
attn_kv_a_mqa,attn_k_b,attn_v_b - KDA (linear-attention layers):
ssm_conv1d_{k,q,v},ssm_f_a/f_b,ssm_g_a/g_b,ssm_beta(norms/1-D state kept F32)
plus a dense layer 0 (--dense-layers 1). The expert intermediate dim is 2048
(256-divisible), so no IQ4_NL workaround was needed. Config generation +
patching: see REPRODUCE.md, patch_kimi_config.py, and
configs/.
Baseline: quantized from bartowski's bf16 GGUF.
Attribution & licenses
All MIT; see LICENSE and NOTICE.
- Base: Moonshot AI (@moonshotai) β Kimi-Linear-48B-A3B-Instruct (MIT)
- bf16 GGUF: bartowski (@bartowski) β source
- Engine: llama.cpp (@ggml-org Β· github) (MIT)
- APEX: Ettore Di Giacinto / LocalAI (@mudler) β localai-org/apex-quant (MIT)
Unofficial community quantization; not affiliated with or endorsed by Moonshot AI.
- Downloads last month
- 690
We're not able to determine the quantization variants.
Model tree for Myric/Kimi-Linear-48B-A3B-Instruct-APEX-GGUF
Base model
moonshotai/Kimi-Linear-48B-A3B-Instruct