Model reference · open weights

KwaiCoder

LLMs Kwaipilot Text gen · MoE 1 build Open weights 57 dl/mo

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.

  • KwaiCoder is a 23.3B parameter open-source code completion model developed by the Kwaipilot team at Kuaishou.
  • It supports multilingual text generation with a context length of 4096 tokens and is released under the MIT license.
  • The model utilizes a 23B-wide MoE architecture trained with techniques including model pruning and knowledge distillation.

Summary of the Kwaipilot/KwaiCoder-23B-A4B-v1 model card, 2026-10-01

What it is

Released byKwaipilot
Released2025-01-22
Parameters23.3B
VRAM46.5 GB for the weights

What it runs on

Memory and cards for KwaiCoder-23B-A4B-v1 (BF16)

46.5 GBweights, file size
328 MBcache per 1K tokens
541 MBruntime overhead, at least
4,096 tokenscontext max
CardRequests at onceContext maxMemory
4K each
RTX 3060 12 GB … L40S 48 GB
6 smaller cards
——
A100 80 GB23all 4K78.2 GB
H100 80 GB21all 4K78.1 GB
RTX PRO 6000 Blackwell 96 GB32all 4K93.8 GB
DGX Spark (GB10) 128 GB unified42all 4K107 GB
H200 141 GB65all 4K138 GB
B200 180 GB93all 4K176 GB
2× RTX 5090 32 GB
tensor parallel
10all 4K31.0 GB a card
2× L40S 48 GB
tensor parallel
30all 4K44.0 GB a card
4× RTX 4090 24 GB
tensor parallel
33all 4K23.4 GB a card
4× RTX 3090 24 GB
tensor parallel
33all 4K23.4 GB a card
Memory needed at each load
Requests at once4K tokens each
148.4 GB
553.8 GB
857.8 GB
1668.5 GB
3290.0 GB
64133 GB

One card, with vLLM's small-card settings.

From the model card

What Kwaipilot says about KwaiCoder

Read the model card

1.Model Details

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

2.Usage

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):])

3.License

This code repository is licensed under the MIT License.

4.BibTex

@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.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms