Model reference · open weights
KwaiCoder is an open-weight language model from Kwaipilot. KwaiCoder-23B-A4B-v1 (BF16) weighs 46.5 GB; the smallest configuration that runs it is 2× RTX 5090 32 GB.
Summary of the Kwaipilot/KwaiCoder-23B-A4B-v1 model card, 2026-10-01
What it is
| Released by | Kwaipilot |
|---|---|
| Released | 2025-01-22 |
| Parameters | 23.3B |
| VRAM | 46.5 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory |
|---|---|---|---|
| 4K each | |||
| RTX 3060 12 GB … L40S 48 GB 6 smaller cards | — | — | |
| A100 80 GB | 23 | all 4K | 78.2 GB |
| H100 80 GB | 21 | all 4K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 32 | all 4K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 42 | all 4K | 107 GB |
| H200 141 GB | 65 | all 4K | 138 GB |
| B200 180 GB | 93 | all 4K | 176 GB |
| 2× RTX 5090 32 GB tensor parallel | 10 | all 4K | 31.0 GB a card |
| 2× L40S 48 GB tensor parallel | 30 | all 4K | 44.0 GB a card |
| 4× RTX 4090 24 GB tensor parallel | 33 | all 4K | 23.4 GB a card |
| 4× RTX 3090 24 GB tensor parallel | 33 | all 4K | 23.4 GB a card |
| Requests at once | 4K tokens each |
|---|---|
| 1 | 48.4 GB |
| 5 | 53.8 GB |
| 8 | 57.8 GB |
| 16 | 68.5 GB |
| 32 | 90.0 GB |
| 64 | 133 GB |
One card, with vLLM's small-card settings.
From the model card
Introduction
KwaiCoder-23BA4-v1 is the latest open-source self-developed code completion model from the Kwaipilot team at Kuaishou. The training of the model relies on an efficient training approach proposed by the Kwaipilot team. By incorporating techniques such as model pruning, knowledge distillation, and fine-grained merging, the training of the 23B-wide MoE architecture code completion model was achieved at 1/30 of the cost compared to traditional methods. It has also set new SOTA benchmarks across multiple code-related evaluation datasets.
Performance
Code Completion
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "Kwaipilot/KwaiCoder-23B-A4B-v1"
tokenizer = AutoTokenizer.from_pretrained(model_id,trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16,trust_remote_code=True)
text = "#write a quick sort algorithm"
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=80)
print(tokenizer.decode(outputs[0], skip_special_tokens=True)[len(text):])
Code Insertion
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "Kwaipilot/KwaiCoder-23B-A4B-v1"
tokenizer = AutoTokenizer.from_pretrained(model_id,trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.bfloat16,trust_remote_code=True)
text = """def find_longest_substring(s):
seen = {}
max_length = 0
start = 0
if char in seen and seen[char] >= start:
start = seen[char] + 1
seen[char] = end
max_length = max(max_length, end - start + 1)
return max_length"""
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=80)
print(tokenizer.decode(outputs[0], skip_special_tokens=True)[len(text):])
This code repository is licensed under the MIT License.
@misc{kwaicoder,
title = {KwaiCoder: Code mathematical abilities comprehensive improvement.},
author = {Kwaipilot team},
year = {2024},
}
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.