Text Generation
Transformers
Safetensors
deepseek_v2
conversational
custom_code
text-generation-inference
Instructions to use deepseek-ai/DeepSeek-Coder-V2-Instruct-0724 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deepseek-ai/DeepSeek-Coder-V2-Instruct-0724 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-Coder-V2-Instruct-0724", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Instruct-0724", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("deepseek-ai/DeepSeek-Coder-V2-Instruct-0724", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use deepseek-ai/DeepSeek-Coder-V2-Instruct-0724 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deepseek-ai/DeepSeek-Coder-V2-Instruct-0724" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deepseek-ai/DeepSeek-Coder-V2-Instruct-0724", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/deepseek-ai/DeepSeek-Coder-V2-Instruct-0724
- SGLang
How to use deepseek-ai/DeepSeek-Coder-V2-Instruct-0724 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 "deepseek-ai/DeepSeek-Coder-V2-Instruct-0724" \ --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": "deepseek-ai/DeepSeek-Coder-V2-Instruct-0724", "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 "deepseek-ai/DeepSeek-Coder-V2-Instruct-0724" \ --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": "deepseek-ai/DeepSeek-Coder-V2-Instruct-0724", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use deepseek-ai/DeepSeek-Coder-V2-Instruct-0724 with Docker Model Runner:
docker model run hf.co/deepseek-ai/DeepSeek-Coder-V2-Instruct-0724
add AIBOM
#7
by RiccardoDav - opened
deepseek-ai_DeepSeek-Coder-V2-Instruct-0724.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bomFormat": "CycloneDX",
|
| 3 |
+
"specVersion": "1.6",
|
| 4 |
+
"serialNumber": "urn:uuid:a296c322-0d20-45c7-aea3-263a042fa8f7",
|
| 5 |
+
"version": 1,
|
| 6 |
+
"metadata": {
|
| 7 |
+
"timestamp": "2025-06-05T09:37:35.206933+00:00",
|
| 8 |
+
"component": {
|
| 9 |
+
"type": "machine-learning-model",
|
| 10 |
+
"bom-ref": "deepseek-ai/DeepSeek-Coder-V2-Instruct-0724-f48f6fab-c6d8-52e7-ba4e-f7039067fc5f",
|
| 11 |
+
"name": "deepseek-ai/DeepSeek-Coder-V2-Instruct-0724",
|
| 12 |
+
"externalReferences": [
|
| 13 |
+
{
|
| 14 |
+
"url": "https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Instruct-0724",
|
| 15 |
+
"type": "documentation"
|
| 16 |
+
}
|
| 17 |
+
],
|
| 18 |
+
"modelCard": {
|
| 19 |
+
"modelParameters": {
|
| 20 |
+
"task": "text-generation",
|
| 21 |
+
"architectureFamily": "deepseek_v2",
|
| 22 |
+
"modelArchitecture": "DeepseekV2ForCausalLM"
|
| 23 |
+
},
|
| 24 |
+
"properties": [
|
| 25 |
+
{
|
| 26 |
+
"name": "library_name",
|
| 27 |
+
"value": "transformers"
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"name": "base_model",
|
| 31 |
+
"value": "deepseek-ai/DeepSeek-Coder-V2-Base"
|
| 32 |
+
}
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
"authors": [
|
| 36 |
+
{
|
| 37 |
+
"name": "deepseek-ai"
|
| 38 |
+
}
|
| 39 |
+
],
|
| 40 |
+
"licenses": [
|
| 41 |
+
{
|
| 42 |
+
"license": {
|
| 43 |
+
"name": "deepseek-license",
|
| 44 |
+
"url": "LICENSE"
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
],
|
| 48 |
+
"tags": [
|
| 49 |
+
"transformers",
|
| 50 |
+
"safetensors",
|
| 51 |
+
"deepseek_v2",
|
| 52 |
+
"text-generation",
|
| 53 |
+
"conversational",
|
| 54 |
+
"custom_code",
|
| 55 |
+
"arxiv:2401.06066",
|
| 56 |
+
"base_model:deepseek-ai/DeepSeek-Coder-V2-Base",
|
| 57 |
+
"base_model:finetune:deepseek-ai/DeepSeek-Coder-V2-Base",
|
| 58 |
+
"license:other",
|
| 59 |
+
"autotrain_compatible",
|
| 60 |
+
"text-generation-inference",
|
| 61 |
+
"endpoints_compatible",
|
| 62 |
+
"region:us"
|
| 63 |
+
]
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
}
|