Model reference · open weights
DeepSeek-Coder-Lite is an open-weight language model from DeepSeek. DeepSeek-Coder-V2-Lite-Instruct (BF16) weighs 31.4 GB; the smallest configuration that runs it is L40S 48 GB.
Summary of the deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct model card, 2026-10-01
What it is
| Released by | DeepSeek |
|---|---|
| Released | 2024-06-14 |
| Parameters | 15.7B |
| VRAM | 31.4 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB … RTX 5090 32 GB 5 smaller cards | — | — | — | |
| L40S 48 GB | 44 | 11 | all 160K | 44.0 GB |
| A100 80 GB | 179 | 44 | all 160K | 78.2 GB |
| H100 80 GB | 158 | 39 | all 160K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 220 | 55 | all 160K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 273 | 68 | all 160K | 107 GB |
| H200 141 GB | 393 | 98 | all 160K | 138 GB |
| B200 180 GB | 533 | 133 | all 160K | 176 GB |
| 2× RTX 4090 24 GB tensor parallel | 25 | 6 | all 160K | 23.4 GB a card |
| 2× RTX 3090 24 GB tensor parallel | 25 | 6 | all 160K | 23.4 GB a card |
| 2× RTX 5090 32 GB tensor parallel | 55 | 13 | all 160K | 31.0 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 32.8 GB | 33.6 GB |
| 5 | 33.8 GB | 37.7 GB |
| 8 | 34.6 GB | 40.7 GB |
| 16 | 36.6 GB | 48.9 GB |
| 32 | 40.7 GB | 65.2 GB |
| 64 | 48.9 GB | 97.8 GB |
One card, with vLLM's small-card settings.
From the model card
We present DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code language model that achieves performance comparable to GPT4-Turbo in code-specific tasks. Specifically, DeepSeek-Coder-V2 is further pre-trained from an intermediate checkpoint of DeepSeek-V2 with additional 6 trillion tokens. Through this continued pre-training, DeepSeek-Coder-V2 substantially enhances the coding and mathematical reasoning capabilities of DeepSeek-V2, while maintaining comparable performance in general language tasks. Compared to DeepSeek-Coder-33B, DeepSeek-Coder-V2 demonstrates significant advancements in various aspects of code-related tasks, as well as reasoning and general capabilities. Additionally, DeepSeek-Coder-V2 expands its support for programming languages from 86 to 338, while extending the context length from 16K to 128K.
In standard benchmark evaluations, DeepSeek-Coder-V2 achieves superior performance compared to closed-source models such as GPT4-Turbo, Claude 3 Opus, and Gemini 1.5 Pro in coding and math benchmarks. The list of supported programming languages can be found here.
We release the DeepSeek-Coder-V2 with 16B and 236B parameters based on the DeepSeekMoE framework, which has actived parameters of only 2.4B and 21B , including base and instruct models, to the public.
| Model | #Total Params | #Active Params | Context Length | Download |
|---|---|---|---|---|
| DeepSeek-Coder-V2-Lite-Base | 16B | 2.4B | 128k | 🤗 HuggingFace |
| DeepSeek-Coder-V2-Lite-Instruct | 16B | 2.4B | 128k | 🤗 HuggingFace |
| DeepSeek-Coder-V2-Base | 236B | 21B | 128k | 🤗 HuggingFace |
| DeepSeek-Coder-V2-Instruct | 236B | 21B | 128k | 🤗 HuggingFace |
You can chat with the DeepSeek-Coder-V2 on DeepSeek's official website: coder.deepseek.com
We also provide OpenAI-Compatible API at DeepSeek Platform: platform.deepseek.com, and you can also pay-as-you-go at an unbeatable price.
Here, we provide some examples of how to use DeepSeek-Coder-V2-Lite model. If you want to utilize DeepSeek-Coder-V2 in BF16 format for inference, 80GB*8 GPUs are required.
You can directly employ Huggingface's Transformers for model inference.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-Base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-Base", trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
input_text = "#write a quick sort algorithm"
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_length=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-Base", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-Base", trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
input_text = """def quick_sort(arr):
if len(arr) <= 1:
return arr
pivot = arr[0]
left = []
right = []
if arr[i] < pivot:
left.append(arr[i])
else:
right.append(arr[i])
return quick_sort(left) + [pivot] + quick_sort(right)"""
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_length=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True)[len(input_text):])
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct", trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
messages=[
{ 'role': 'user', 'content': "write a quick sort algorithm in python."}
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
# tokenizer.eos_token_id is the id of token
outputs = model.generate(inputs, max_new_tokens=512, do_sample=False, top_k=50, top_p=0.95, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
The complete chat template can be found within tokenizer_config.json located in the huggingface model repository.
An example of chat template is as belows:
Assistant: {assistant_message_1}User: {user_message_2}
Assistant:
You can also add an optional system message:
User: {user_message_1}
Assistant: {assistant_message_1}User: {user_message_2}
Assistant:
To utilize [vLLM](https://github.com/vllm-p
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.