AI SeedbankHelp preserve open and free AI for humanity's future

← All models

deepseek-ai_DeepSeek-V2-Lite-Chat

deepseek-ai · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


license: other license_name: deepseek license_link: https://github.com/deepseek-ai/DeepSeek-V2/blob/main/LICENSE-MODEL


Model Download | Evaluation Results | Model Architecture | API Platform | License | Citation

Paper Link👁️

DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model

1. Introduction

Last week, the release and buzz around DeepSeek-V2 have ignited widespread interest in MLA (Multi-head Latent Attention)! Many in the community suggested open-sourcing a smaller MoE model for in-depth research. And now DeepSeek-V2-Lite comes out:

  • 16B total params, 2.4B active params, scratch training with 5.7T tokens
  • Outperforms 7B dense and 16B MoE on many English & Chinese benchmarks
  • Deployable on single 40G GPU, fine-tunable on 8x80G GPUs

DeepSeek-V2, a strong Mixture-of-Experts (MoE) language model characterized by economical training and efficient inference. DeepSeek-V2 adopts innovative architectures including Multi-head Latent Attention (MLA) and DeepSeekMoE. MLA guarantees efficient inference through significantly compressing the Key-Value (KV) cache into a latent vector, while DeepSeekMoE enables training strong models at an economical cost through sparse computation.

2. News

  • 2024.05.16: We released the DeepSeek-V2-Lite.
  • 2024.05.06: We released the DeepSeek-V2.

3. Model Downloads

With DeepSeek-V2, we are open-sourcing base and chat models across two sizes:

Model #Total Params #Activated Params Context Length Download
DeepSeek-V2-Lite 16B 2.4B 32k 🤗 HuggingFace
DeepSeek-V2-Lite-Chat (SFT) 16B 2.4B 32k 🤗 HuggingFace
DeepSeek-V2 236B 21B 128k 🤗 HuggingFace
DeepSeek-V2-Chat (RL) 236B 21B 128k 🤗 HuggingFace

Due to the constraints of HuggingFace, the open-source code currently experiences slower performance than our internal codebase when running on GPUs with Huggingface. To facilitate the efficient execution of our model, we offer a dedicated vllm solution that optimizes performance for running our model effectively.

4. Evaluation Results

Base Model

Standard Benchmark

Benchmark Domain DeepSeek 7B (Dense) DeepSeekMoE 16B DeepSeek-V2-Lite (MoE-16B)
Architecture - MHA+Dense MHA+MoE MLA+MoE
MMLU English 48.2 45.0 58.3
BBH English 39.5 38.9 44.1
C-Eval Chinese 45.0 40.6 60.3
CMMLU Chinese 47.2 42.5 64.3
HumanEval Code 26.2 26.8 29.9
MBPP Code 39.0 39.2 43.2
GSM8K Math 17.4 18.8 41.1
Math Math 3.3 4.3 17.1
For more evaluation details, such as few-shot settings and prompts, please check our paper.

Chat Model

Standard Benchmark

Benchmark Domain DeepSeek 7B Chat (SFT) DeepSeekMoE 16B Chat (SFT) DeepSeek-V2-Lite 16B Chat (SFT)
MMLU English 49.7 47.2 55.7
BBH English 43.1 42.2 48.1
C-Eval Chinese 44.7 40.0 60.1
CMMLU Chinese 51.2 49.3 62.5
HumanEval Code 45.1 45.7 57.3
MBPP Code 39.0 46.2 45.8
GSM8K Math 62.6 62.2 72.0
Math Math 14.7 15.2 27.9

5. Model Architecture

DeepSeek-V2 adopts innovative architectures to guarantee economical training and efficient inference:

  • For attention, we design MLA (Multi-head Latent Attention), which utilizes low-rank key-value union compression to eliminate the bottleneck of inference-time key-value cache, thus supporting efficient inference.
  • For Feed-Forward Networks (FFNs), we adopt DeepSeekMoE architecture, a high-performance MoE architecture that enables training stronger models at lower costs.

DeepSeek-V2-Lite has 27 layers and a hidden dimension of 2048. It also employs MLA and has 16 attention heads, where each head has a dimension of 128. Its KV compression dimension is 512, but slightly different from DeepSeek-V2, it does not compress the queries. For the decoupled queries and key, it has a per-head dimension of 64. DeepSeek-V2-Lite also employs DeepSeekMoE, and all FFNs except for the first layer are replaced with MoE layers. Each MoE layer consists of 2 shared experts and 64 routed experts, where the intermediate hidden dimension of each expert is 1408. Among the routed experts, 6 experts will be activated for each token. Under this configuration, DeepSeek-V2-Lite comprises 15.7B total parameters, of which 2.4B are activated for each token.

6. Training Details

DeepSeek-V2-Lite is also trained from scratch on the same pre-training corpus of DeepSeek-V2, which is not polluted by any SFT data. It uses the AdamW optimizer with hyper-parameters set to $\beta_1=0.9$, $\beta_2=0.95$, and $\mathrm{weight_decay}=0.1$. The learning rate is scheduled using a warmup-and-step-decay strategy. Initially, the learning rate linearly increases from 0 to the maximum value during the first 2K steps. Subsequently, the learning rate is multiplied by 0.316 after training about 80% of tokens, and again by 0.316 after training about 90% of tokens. The maximum learning rate is set to $4.2 \times 10^{-4}$, and the gradient clipping norm is set to 1.0. We do not employ the batch size scheduling strategy for it, and it is trained with a constant batch size of 4608 sequences. During pre-training, we set the maximum sequence length to 4K, and train DeepSeek-V2-Lite on 5.7T tokens. We leverage pipeline parallelism to deploy different layers of it on different devices, but for each layer, all experts will be deployed on the same device. Therefore, we only employ a small expert-level balance loss with $\alpha_{1}=0.001$, and do not employ device-level balance loss and communication balance loss for it. After pre-training, we also perform long-context extension, SFT for DeepSeek-V2-Lite and get a chat model called DeepSeek-V2-Lite Chat.

7. How to run locally

To utilize DeepSeek-V2-Lite in BF16 format for inference, 40GB*1 GPU is required.

Inference with Huggingface's Transformers

You can directly employ Huggingface's Transformers for model inference.

Text Completion

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig

model_name = "deepseek-ai/DeepSeek-V2-Lite"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
model.generation_config = GenerationConfig.from_pretrained(model_name)
model.generation_config.pad_token_id = model.generation_config.eos_token_id

text = "An attention function can be described as mapping a query and a set of key-value pairs to an output, where the query, keys, values, and output are all vectors. The output is"
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs.to(model.device), max_new_tokens=100)

result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)

Chat Completion

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig

model_name = "deepseek-ai/DeepSeek-V2-Lite-Chat"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
model.generation_config = GenerationConfig.from_pretrained(model_name)
model.generation_config.pad_token_id = model.generation_config.eos_token_id

messages = [
    {"role": "user", "content": "Write a piece of quicksort code in C++"}
]
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(input_tensor.to(model.device), max_new_tokens=100)

result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
print(result)

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:

<|begin▁of▁sentence|>User: {user_message_1}

Assistant: {assistant_message_1}<|end▁of▁sentence|>User: {user_message_2}

Assistant:

You can also add an optional system message:

<|begin▁of▁sentence|>{system_message}

User: {user_message_1}

Assistant: {assistant_message_1}<|end▁of▁sentence|>User: {user_message_2}

Assistant:

Inference with vLLM (recommended)

To utilize vLLM for model inference, please merge this Pull Request into your vLLM codebase: https://github.com/vllm-project/vllm/pull/4650.

from transformers import AutoTokenizer
from vllm import LLM, SamplingParams

max_model_len, tp_size = 8192, 1
model_name = "deepseek-ai/DeepSeek-V2-Lite-Chat"
tokenizer = AutoTokenizer.from_pretrained(model_name)
llm = LLM(model=model_name, tensor_parallel_size=tp_size, max_model_len=max_model_len, trust_remote_code=True, enforce_eager=True)
sampling_params = SamplingParams(temperature=0.3, max_tokens=256, stop_token_ids=[tokenizer.eos_token_id])

messages_list = [
    [{"role": "user", "content": "Who are you?"}],
    [{"role": "user", "content": "Translate the following content into Chinese directly: DeepSeek-V2 adopts innovative architectures to guarantee economical training and efficient inference."}],
    [{"role": "user", "content": "Write a piece of quicksort code in C++."}],
]

prompt_token_ids = [tokenizer.apply_chat_template(messages, add_generation_prompt=True) for messages in messages_list]

outputs = llm.generate(prompt_token_ids=prompt_token_ids, sampling_params=sampling_params)

generated_text = [output.outputs[0].text for output in outputs]
print(generated_text)

LangChain Support

Since our API is compatible with OpenAI, you can easily use it in langchain. Here is an example:

from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
    model='deepseek-chat',
    openai_api_key=<your-deepseek-api-key>,
    openai_api_base='https://api.deepseek.com/v1',
    temperature=0.85,
    max_tokens=8000)

8. License

This code repository is licensed under the MIT License. The use of DeepSeek-V2 Base/Chat models is subject to the Model License. DeepSeek-V2 series (including Base and Chat) supports commercial use.

9. Citation

@misc{deepseekv2,
      title={DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model}, 
      author={DeepSeek-AI},
      year={2024},
      eprint={2405.04434},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

10. Contact

If you have any questions, please raise an issue or contact us at [email protected].

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:5d964ae037509f2617d3e7e776c55c37417b7daf&dn=deepseek-ai_DeepSeek-V2-Lite-Chat

Open magnet in torrent client · infohash 5d964ae037509f2617d3e7e776c55c37417b7daf

Files & hashes

PathSizesha1sha256
LICENSE13.4 KB (13,759 B)ac09290cb2947183ab7f19d7477511dad3600a7accfee4895df06bcab524151c278e8dde88bbe76165a24ecbcbcf9fafd71fd2b3
README.md15.1 KB (15,500 B)70003f900a116afa00e10e7b292e365a8934b90e08cb188f66c8255377c757b02849256779735a68af67b843bbcbcd8fc5a91efe
config.json1.5 KB (1,522 B)a1aa8126bbf462cbec8fcc79e8c98d8d87f5c7edf346286b0f1c8b044252fd54cb4fa78b9fab6472a6e8bebb9edfe03d414ea03d
configuration_deepseek.py10.1 KB (10,338 B)82e0f5d9d33620a66e328fdeae0b8dc12e2cff7c6de5e7445ab490a16482027b131d5bd6a003da9b58a182a11432115fac84ce59
generation_config.json181 B (181 B)458e1d985ba3fbaaf62a4d1a9dd6ff795a451f7e63ec07f6cb36bd8359b44f671123518dd6fbf55007e0c74aa96c296a75def8b5
model-00001-of-000004.safetensors8.00 GB (8,594,887,408 B)c4d3c197d439e95f9331bd7fa14446f4ba73c1eda314b79a30810b1038f9db08345178e16fb5742aa266c4a3dc05054c59800082
model-00002-of-000004.safetensors8.00 GB (8,591,757,448 B)72b9069b27b34df498c0837d1bf439160c7851ceb0bd088feada0af954614da3a5b179c4d4d5d8bb2482ec83194d101f3fe91796
model-00003-of-000004.safetensors8.00 GB (8,590,718,520 B)43fd1118f8ad3a76cd6df977485bb6dfe67f4f48d31b192e488f0b3a04e007d842c3c9ba5783d944cb1cc27402fe8b8bb837c490
model-00004-of-000004.safetensors5.25 GB (5,636,263,200 B)e91affb5017e7ea735d5bc2d7fd388f1ebd6154f304499be0ea06bf8a3937d7a3cc515bc3738dbd288bdd0bbc1b2d3560fce4930
model.safetensors.index.json468.7 KB (479,924 B)5a821356160292c668d01f8e7fdf9abba4a7b72dd2cdb2f325f6682cf3ad1ad2526a9f979d857390b579380c0331d975136e0acf
modeling_deepseek.py76.8 KB (78,672 B)847a458bedcc8df352b1a89315b8e400b9bc60307d8e5221095286eea991137760893fd7ba52727c0b4ebf48ec09e8bc56b45b9c
tokenization_deepseek_fast.py1.3 KB (1,368 B)d24377191dd00e80c44f22e31dc15272258a22de702fc7dbadc450f2fecfbc59e248ecca5845b49101e8f58f805261c920a3effa
tokenizer.json4.4 MB (4,607,451 B)8b284e5afe1730e31c97ed5c3bdf240adbd15c8641f3bf64213da8c012d8bd0871a58a1fdf70463e8f08f110ddbb1082f529f669
tokenizer_config.json1.2 KB (1,279 B)685b4b63ad1aedad8f98824ab21d2ff422d9e1b131181eaf79394ea26728d95ecb54fe7c8413e6f56085dbabc8b0818134380ec8

Cite this release

Canonical URL
https://aiseedbank.org/models/deepseek-ai_DeepSeek-V2-Lite-Chat/
Slug
deepseek-ai_DeepSeek-V2-Lite-Chat
Infohash
5d964ae037509f2617d3e7e776c55c37417b7daf
License
custom/other license
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: deepseek-ai_DeepSeek-V2-Lite-Chat.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositorydeepseek-ai/DeepSeek-V2-Lite-Chat
Revision (pinned)85864749cd611b4353ce1decdb286193298f64c7
Fetched at2026-09-03T21:54:24Z
License at fetchother
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-03T22:03:15Z

custom/other license29.26 GB (31,418,836,570 bytes)transformerssafetensorsdeepseek_v2text-generationconversationalcustom_codetext-generation-inferenceendpoints_compatiblepaper: 2405.04434