Instructions to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF", dtype="auto") - llama-cpp-python
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF", filename="Kimi-Linear-48B-A3B-Instruct-jp-imatrix.IQ3_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
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 ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
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 ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ymcki/Kimi-Linear-48B-A3B-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": "ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
- SGLang
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with Ollama:
ollama run hf.co/ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
- Unsloth Studio new
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-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 ymcki/Kimi-Linear-48B-A3B-Instruct-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 ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF to start chatting
- Pi new
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
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": "ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
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 ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Kimi-Linear-48B-A3B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
This is a repo for experimental GGUFs for the backend agnostic implementation of the Kimi-Linear model support that requires a llama.cpp from this repo. You can git clone it and compile locally.
git clone https://github.com/ymcki/llama.cpp --branch Kimi-Linear
cd llama.cpp
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j 6
If you have enough VRAM, you can run it purely on your graphics card:
./build/bin/llama-cli -m ~/Kimi-Linear-48B-A3B-Instruct-GGUF/Kimi-Linear-48B-A3B-Instruct.Q4_K_M.gguf -c 8192 -ngl 100 --mmap
Otherwise, you can only load the shared experts and KV cache to your graphics card and the rest to CPU and RAM.
./build/bin/llama-cli -m ~/Kimi-Linear-48B-A3B-Instruct-GGUF/Kimi-Linear-48B-A3B-Instruct.Q4_K_M.gguf -c 8192 -cmoe -ngl 100 --mmap
I am going to only make ggufs without imatrix and ggufs with an imatrix based on c4_en_ja_imatrix.txt for better Japanese performance as bartowski and unsloth will make ggufs with English imatrix anyway.
Base perplexity for f16 gguf is 7.291970 ± 0.048577.
Seems like MLA KV cache can only be run at F16 probably due to itself being a kind of compression. You can use this table to see how much context you can run with a single 24GB card.
| Quant Type | imatrix | File Size | Delta Perplexity | KL Divergence | Description |
|---|---|---|---|---|---|
| Q5_K_M | c4_en_ja_imatrix.txt | 34.87GB | 7.115874 ± 0.047587 | 0.074066 ± 0.001537 | Good |
| Q5_K_M | None | 34.87GB | 7.133672 ± 0.047741 | 0.074684 ± 0.001535 | Good. Slightly worse than imatrix |
| Q4_K_M | c4_en_ja_imatrix.txt | 29.70GB | 7.147482 ± 0.047851 | 0.081894 ± 0.001521 | Good. Can run 128k context on a single 32GB card. |
| Q4_K_M | None | 29.70GB | 7.172188 ± 0.048107 | 0.083700 ± 0.00152 | Good. Slightly worse than imatrix |
| MXFP4_MOE | None | 27.21GB | 7.179840 ± 0.047966 | 0.088789 ± 0.001544 | Good. Can run 240k context on a single 32GB card. |
| MXFP4_MOE | c4_en_ja_imatrix.txt | 27.21GB | 7.179840 ± 0.047966 | 0.088789 ± 0.001544 | Good. Same as the no imatrix version. |
| IQ4_XS | c4_en_ja_imatrix.txt | 26.27GB | 7.208724 ± 0.048490 | 0.088246 ± 0.001528 | Good. Can run 304k context on a single 32GB card. |
| IQ4_NL | c4_en_ja_imatrix.txt | 27.79GB | 7.209342 ± 0.048412 | 0.087678 ± 0.001532 | Doesn't make sense compare to MXFP4_MOE |
| IQ3_M | c4_en_ja_imatrix.txt | 21.55GB | 7.368516 ± 0.048425 | 0.113435 ± 0.001457 | Quite Good. Can run 96k context on a single 24GB card. |
| IQ3_S | c4_en_ja_imatrix.txt | 21.33GB | 7.448991 ± 0.049167 | 0.119987 ± 0.001466 | Quite Good. Can run 112k context on a single 24GB card. |
| IQ3_XS | c4_en_ja_imatrix.txt | 20.17GB | 7.534649 ± 0.049461 | 0.129645 ± 0.001448 | Quite Good. Can run 176k context on a single 24GB card. |
| Q3_K_S | c4_en_ja_imatrix.txt | 21.33GB | 7.557247 ± 0.051236 | 0.131708 ± 0.001521 | Quite Good. Can run 112k context on a single 24GB card. |
| Q3_K_S | None | 21.33GB | 7.632887 ± 0.051792 | 0.146355 ± 0.001534 | Quite Good but worse than imatrix. Good for CPU use. |
| IQ3_XXS | c4_en_ja_imatrix.txt | 18.99GB | 7.780732 ± 0.052592 | 0.164925 ± 0.001537 | Not so good but can run 240k context on a single 24GB card. |
| IQ2_M | c4_en_ja_imatrix.txt | 16.13GB | 8.207663 ± 0.054957 | 0.224437 ± 0.001536 | Slightly batter than Q2_K but you can run 400k context on a single 24GB card. |
| Q2_K | c4_en_ja_imatrix.txt | 18.03GB | 8.295144 ± 0.057566 | 0.221437 ± 0.001617 | So-so but you can run 288k context on a single 24GB card. Good for performance evaluation. |
| Q2_K | None | 18.03GB | 8.648201 ± 0.059234 | 0.267082 ± 0.001659 | Worse than imatrix |
As expected, imatrix has no effect on MXFP4_MOE. From this reddit thread, its perplexity is about the same as IQ4_XS but about 6% bigger file size. Here, its perplexity is better than IQ4_XS. This makes it a viable option.
- Downloads last month
- 3,575
2-bit
3-bit
4-bit
5-bit
Model tree for ymcki/Kimi-Linear-48B-A3B-Instruct-GGUF
Base model
moonshotai/Kimi-Linear-48B-A3B-Instruct