Instructions to use kakaocorp/kanana-2-1.3b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kakaocorp/kanana-2-1.3b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kakaocorp/kanana-2-1.3b-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("kakaocorp/kanana-2-1.3b-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kakaocorp/kanana-2-1.3b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kakaocorp/kanana-2-1.3b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kakaocorp/kanana-2-1.3b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kakaocorp/kanana-2-1.3b-instruct
- SGLang
How to use kakaocorp/kanana-2-1.3b-instruct 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 "kakaocorp/kanana-2-1.3b-instruct" \ --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": "kakaocorp/kanana-2-1.3b-instruct", "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 "kakaocorp/kanana-2-1.3b-instruct" \ --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": "kakaocorp/kanana-2-1.3b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kakaocorp/kanana-2-1.3b-instruct with Docker Model Runner:
docker model run hf.co/kakaocorp/kanana-2-1.3b-instruct
News 🔥
2026/07/27: 🤗 Releasedkanana-2-3b,kanana-2-1.3bHF model weights.2026/07/27: 📕 Published a blog post about the development of theKanana-2 SLMseries.
Introduction
We present Kanana-2 SLM, Kakao's second series of Small Language Models (SLMs), designed to deliver strong language capabilities while remaining compact and efficient for practical deployment. The series includes 3B, 1.3B, and 0.9B models. This release publicly includes the 3B model and the compressed 1.3B model, providing a balance between capability and efficiency for a wide range of applications. Kanana-2-3B was pretrained from scratch on TPU clusters and further improved through post-training with supervised fine-tuning and reinforcement learning, resulting in strong instruction-following and reasoning capabilities. Kanana-2-1.3B models are derived from Kanana-2-3B through a cascade pruning and distillation pipeline. To further improve deployment efficiency, they adopt Sliding Window Attention (SWA), enabling memory-efficient long-context inference with support for context lengths of up to 32K tokens while substantially reducing KV-cache memory requirements.
The Kanana-2 SLM release consists of the following four publicly available models:
- Kanana-2-3B-Base — 3B pretrained base
- Kanana-2-3B-Instruct — instruction-tuned 3B model
- Kanana-2-1.3B-Base — compressed 1.3B pretrained base
- Kanana-2-1.3B-Instruct — instruction-tuned 1.3B model for on-device deployment
No Kakao user data was used for either pre-training or post-training.
Highlights
- Cascade Pruning & Distillation: Kanana-2-1.3B is built by progressively compressing Kanana-2-3B-Base (3B → 2B → 1.3B → 0.9B) through a cascade pruning and distillation pipeline.
- Sliding Window Attention (SWA): Uses a 3:1 hybrid layout of sliding-window and full-attention layers. A sliding-window size of 1024 reduces per-token KV-cache reads, cutting KV-cache usage by up to ~72.7% at a 32K context length compared to a full-attention-only model. YaRN is applied to full-attention layers, while SWA layers retain RoPE, preserving long-range context without sacrificing local-attention efficiency.
- Kanana-2 tokenizer: Improves Korean tokenization efficiency by over 30% compared to the previous generation.
- Long context: Natively supports context lengths of up to 32,768 tokens.
Model Downloads
| Model | Download |
|---|---|
| kanana-2-3b-base | 🤗 HuggingFace |
| kanana-2-3b-instruct | 🤗 HuggingFace |
| kanana-2-1.3b-base | 🤗 HuggingFace |
| kanana-2-1.3b-instruct | 🤗 HuggingFace |
Performance
Base model evaluation results
| Benchmark | Metric | Shot | kanana-2-3b-base | kanana-2-1.3b-base | Qwen3-1.7B-Base |
|---|---|---|---|---|---|
| General Tasks | |||||
| MMLU | acc | 5 | 62.77 | 56.49 | 62.32 |
| MMLU-Pro | acc | 5 | 36.54 | 29.87 | 37.08 |
| BBH | acc | 3 | 54.23 | 45.58 | 53.60 |
| SimpleQA† | acc | 5 | 27.39 | 23.76 | 16.83 |
| Mathematics Tasks | |||||
| MATH | em | 4 | 35.08 | 30.82 | 41.74 |
| GSM8K | em | 8 | 61.03 | 51.93 | 75.74 |
| Coding Tasks | |||||
| HumanEval | pass@1 | 0 | 55.96 | 51.33 | 45.31 |
| MBPP | pass@1 | 3 | 50.95 | 44.86 | 53.85 |
| Korean Tasks | |||||
| KMMLU | acc | 5 | 47.92 | 44.17 | 43.08 |
| KoSimpleQA† | acc | 5 | 32.50 | 28.50 | 13.40 |
| HAE-RAE Bench (v1.0) | acc | 5 | 80.66 | 75.34 | 55.54 |
| MATH-Ko‡ | em | 4 | 31.54 | 24.75 | 31.92 |
| MBPP-Ko§ | pass@1 | 3 | 44.55 | 39.38 | 47.97 |
| Long Context Tasks | |||||
| RULER-32K | acc | 0 | 67.50 | 55.72 | 69.01 |
† Evaluated in Multiple Choice Question Answering (MCQA) format with 10 options.
‡ Subsets from HRM8K (MATH, GSM8K).
§ Internally translated to Korean.
Instruct model evaluation results
Instruction-following, chat, tool-calling, code, math, and knowledge benchmarks for the Kanana-2 SLM series. Scores use greedy decoding (temperature 0.0, top-p 1.0, max 4096 tokens); the metric for each benchmark is listed in the Metric column.
| Benchmark | Metric | kanana-2-3b-instruct | kanana-2-1.3b-instruct | Qwen3.5-2B | Qwen3-1.7B |
|---|---|---|---|---|---|
| Chat | |||||
| MT-Bench† | judge | 7.15 | 6.83 | 6.87 | 6.98 |
| KoMT-Bench† | judge | 6.92 | 6.54 | 5.21 | 5.29 |
| Instruction Following | |||||
| IFBench | prompt strict | 33.33 | 34.69 | 24.83 | 18.33 |
| IFEval | prompt strict | 80.96 | 77.63 | 66.91 | 68.39 |
| IHEval | pass@1 | 35.96 | 27.06 | 38.52 | 42.09 |
| Tool Calling | |||||
| BFCL-v3 (Live)‡ | pass@1 | 71.94 | 69.64 | 66.96 | 65.48 |
| BFCL-v3 (Multi-Turn)‡ | pass@1 | 17.12 | 5.50 | 6.27 | 4.38 |
| Code Generation | |||||
| MBPP | pass@1 | 70.63 | 69.05 | 55.56 | 62.17 |
| MBPP+ | pass@1 | 60.05 | 60.85 | 46.83 | 52.65 |
| Mathematics | |||||
| GSM-Plus | pass@1 | 61.17 | 58.27 | 61.29 | 63.10 |
| MATH-500 | pass@1 | 61.20 | 61.40 | 67.80 | 72.00 |
| Minerva Math | pass@1 | 24.44 | 22.43 | 35.18 | 27.21 |
| Reasoning & Knowledge | |||||
| MMLU-CoT | acc | 61.09 | 60.37 | 69.01 | 66.02 |
| KMMLU-CoT | acc | 43.32 | 42.79 | 41.75 | 37.84 |
| HAERAE-Bench (v1.0)-CoT | acc | 43.75 | 44.89 | 27.84 | 27.84 |
| KoSimpleQA | acc | 22.29 | 17.81 | 3.21 | 2.82 |
† Evaluated using gpt-4o-2024-08-06 as the judge model.
‡ Live denotes the average score of 6 live benchmarks, and Multi-Turn the average score of 4 multi-turn benchmarks.
Deployment
kanana-2-1.3b-instruct uses a custom hybrid attention architecture (Kanana2TinyForCausalLM — a Qwen3 backbone with a 3:1 SWA/full-attention layout and per-layer-type RoPE), shipped as remote code in the repository.
Because the modeling code is loaded from the repository, serving requires
transformers >= 4.57and the--trust-remote-codeflag. For SGLang, use--attention-backend tritonso the hybrid sliding-window attention is handled correctly.
vLLM
vLLM is a fast and memory-optimized engine designed for high-performance LLM inference and serving.
vllm serve kakaocorp/kanana-2-1.3b-instruct \
--tensor-parallel-size 1 \
--max-model-len 32768 \
--trust-remote-code \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder
SGLang
SGLang is a high-efficiency framework for serving LLMs and VLMs, enabling easy deployment of OpenAI-compatible API servers.
For SGLang, the model is served through the stock Qwen3ForCausalLM path instead of the remote-code Kanana2TinyForCausalLM class. This requires two files shipped in the sglang/ directory of this repository:
sglang/config.json— a Qwen3-flavored config (architectures: ["Qwen3ForCausalLM"],model_type: qwen3, noauto_map) that keeps the hybrid-attention fields (layer_types,sliding_window, per-layer-typerope_parameters). Use it in place of the defaultconfig.jsonwhen serving with SGLang.sglang/qwen3.py— a patched model definition that overrides the installedsglang/srt/models/qwen3.py.
python3 -m sglang.launch_server \
--model-path kakaocorp/kanana-2-1.3b-instruct \
--tp 1 \
--context-length 32768 \
--attention-backend triton \
--trust-remote-code \
--tool-call-parser qwen3_coder
- Recommended:
sglang==0.5.1.- With the Qwen3-flavored
sglang/config.jsonthe model itself needs no remote code, but--trust-remote-codeis passed so the tokenizer/config are loaded without prompting.- Use
tritonorfa3for the attention backend. Avoidflashinfer— it appears to have an issue with this model and causes significant accuracy/throughput degradation.
Kanana-2-1.3B shares the Qwen3 backbone but adds a 3:1 SWA/full hybrid attention layout and per-layer-type RoPE, which SGLang's stock Qwen3 model does not handle. The patched sglang/qwen3.py changes the decoder layer to:
- Per-layer-type RoPE — for each layer, read the entry in
config.rope_parametersmatchingconfig.layer_types[layer_id]and build that layer's own rotary embedding from it:full_attentionuses YaRN (factor=40,original_max_position_embeddings=4096) andsliding_attentionuses default RoPE (rope_theta=10000). A layer type with no matching entry falls back to no RoPE. - Hybrid sliding-window attention — layers typed
sliding_attentionrunRadixAttentionwithsliding_window_size = config.sliding_window - 1(SGLang uses an exclusive window, HF an inclusive one), whilefull_attentionlayers use full causal attention.
License
The model weights are released under the KananaOpenLicense.
Citation
@misc{kanana2slm2026,
title = {Kanana-2 SLM},
author = {Kanana LLM},
year = {2026},
url = {https://huggingface.co/collections/kakaocorp/kanana-2-slm}
}
Contact
- Kanana LLM Team Technical Support: kanana-llm@kakaocorp.com
- Business & Partnership Contact: alpha.k@kakaocorp.com
- Downloads last month
- 88
Model tree for kakaocorp/kanana-2-1.3b-instruct
Base model
kakaocorp/kanana-2-1.3b-base