Instructions to use ubergarm/Kimi-K2-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ubergarm/Kimi-K2-Instruct-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 ubergarm/Kimi-K2-Instruct-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ubergarm/Kimi-K2-Instruct-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
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 ubergarm/Kimi-K2-Instruct-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
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 ubergarm/Kimi-K2-Instruct-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
Use Docker
docker model run hf.co/ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use ubergarm/Kimi-K2-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ubergarm/Kimi-K2-Instruct-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": "ubergarm/Kimi-K2-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
- Ollama
How to use ubergarm/Kimi-K2-Instruct-GGUF with Ollama:
ollama run hf.co/ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
- Unsloth Desktop
- Pi
How to use ubergarm/Kimi-K2-Instruct-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ubergarm/Kimi-K2-Instruct-GGUF:Q2_K" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ubergarm/Kimi-K2-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
- Lemonade
How to use ubergarm/Kimi-K2-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
Run and chat with the model
lemonade run user.Kimi-K2-Instruct-GGUF-Q2_K
List all available models
lemonade list
- Hermes Agent
How to use ubergarm/Kimi-K2-Instruct-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 ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
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 ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ubergarm/Kimi-K2-Instruct-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ubergarm/Kimi-K2-Instruct-GGUF:Q2_K
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 "ubergarm/Kimi-K2-Instruct-GGUF:Q2_K" \ --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"
IQ2_KS passes the Moonshot K2 Vendor Verifier test
In case someone was wondering on the 'quality' of theIQ2_KSquant, I ran the K2 Vendor Verifier test (https://github.com/MoonshotAI/K2-Vendor-Verifier) over a couple of days.
On the objective measurement of tool calling quality, IQ2_KS scores 81%, which is a pass and higher than even some commercially available API endpoints.
More details here: https://github.com/ikawrakow/ik_llama.cpp/issues/865
That's great, thank you.
I was thinking about doing the same, on a larger quant, llama.cpp versus ik_llama.
How long did it take?
How long did it take?
About 48 hours on my rig...
Thanks again for running the official vendor verifier and amazing these little quants are beating some commercial APIs! Now if the RAM prices weren't skyrocketing we'd be set lol...
Could you share the full command you used to launch ik_llama.cpp including where you got the chat template from? I'm asking for another user, @justj0sh who is having some issues with their setup here: https://huggingface.co/ubergarm/Kimi-K2-Thinking-GGUF/discussions/10
Thanks!
Of course. I'm using the chat template ik_llama.cpp/models/templates/Kimi-K2-Instruct.jinja from the ik_llama.cpp repository.
$ git rev-parse --short HEAD
87f6943e
Command line (from my llama-swap config):
${ik_llama}
-t 23
-m /home/ai/models/ubergarm/Kimi-K2-Instruct-0905-GGUF/Kimi-K2-Instruct-0905-IQ2_KS.gguf
--alias Kimi-K2
--jinja
--host 0.0.0.0
--chat-template-file /home/ai/ik_llama.cpp/models/templates/Kimi-K2-Instruct.jinja
-c 100000 --no-mmap -ngl 999
-ot "blk.(0|1|2|3|4|5|6|7).ffn.=CUDA0"
-ot "blk.(11|12|13|14|15|16|17).ffn.=CUDA1"
-ot "blk.(21|22).ffn.=CUDA2"
-ot "blk.(31|32).ffn.=CUDA3"
-ot exps=CPU
-mg 0 -ub 4096 -b 4096 -mla 3 -amb 1024
--temp 0.6
Where ${ik_llama} is :
/home/ai/ik_llama.cpp/build/bin/llama-server
--port ${PORT}
If it is of any use, I'm also running the k2vv tool on Kimi-K2-Thinking-smol-IQ2_KS.ggufat the moment (might be a couple of days more before I have results :-)). This is my config:
${ik_llama}
-t 23
-m /home/ai/models/ubergarm/Kimi-K2-Thinking-GGUF/Kimi-K2-Thinking-smol-IQ2_KS.gguf
--alias Kimi-K2-Thinking
--jinja
--host 0.0.0.0
--chat-template-file /home/ai/ik_llama.cpp/models/templates/Kimi-K2-Thinking.jinja
-c 150000 --no-mmap -ngl 999
-ot "blk.(0|1|2|3|4|5|6|7).ffn.=CUDA0"
-ot "blk.(11|12|13|14|15|16|17).ffn.=CUDA1"
-ot "blk.(21|22).ffn.=CUDA2"
-ot "blk.(31|32).ffn.=CUDA3"
-ot exps=CPU
-mg 0 -ub 4096 -b 4096 -mla 3 -amb 1024
--temp 1.0
--min-p 0.01