Text Generation
Transformers
Safetensors
deepseek_v2
fp8
vllm
conversational
custom_code
text-generation-inference
Instructions to use RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8", 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("RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8", 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 RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8
- SGLang
How to use RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8 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 "RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8" \ --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": "RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8", "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 "RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8" \ --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": "RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8 with Docker Model Runner:
docker model run hf.co/RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8
Update README.md
Browse files
README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
| 2 |
tags:
|
| 3 |
- fp8
|
| 4 |
- vllm
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
# DeepSeek-Coder-V2-Lite-Instruct-FP8
|
|
@@ -19,13 +22,13 @@ tags:
|
|
| 19 |
- **Version:** 1.0
|
| 20 |
- **Model Developers:** Neural Magic
|
| 21 |
|
| 22 |
-
Quantized version of [DeepSeek-Coder-V2-Lite-Instruct](deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct).
|
| 23 |
<!-- It achieves an average score of 73.19 on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) benchmark (version 1), whereas the unquantized model achieves 73.48. -->
|
| 24 |
It achieves an average score of 79.60 on the [HumanEval+](https://github.com/openai/human-eval?tab=readme-ov-file) benchmark, whereas the unquantized model achieves 79.33.
|
| 25 |
|
| 26 |
### Model Optimizations
|
| 27 |
|
| 28 |
-
This model was obtained by quantizing the weights and activations of [DeepSeek-Coder-V2-Lite-Instruct](deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct) to FP8 data type, ready for inference with vLLM >= 0.5.2.
|
| 29 |
This optimization reduces the number of bits per parameter from 16 to 8, reducing the disk size and GPU memory requirements by approximately 50%.
|
| 30 |
|
| 31 |
Only the weights and activations of the linear operators within transformers blocks are quantized. Symmetric per-tensor quantization is applied, in which a linear scaling per output dimension maps the FP8 representations of the quantized weights and activations.
|
|
|
|
| 2 |
tags:
|
| 3 |
- fp8
|
| 4 |
- vllm
|
| 5 |
+
license: other
|
| 6 |
+
license_name: deepseek-license
|
| 7 |
+
license_link: LICENSE
|
| 8 |
---
|
| 9 |
|
| 10 |
# DeepSeek-Coder-V2-Lite-Instruct-FP8
|
|
|
|
| 22 |
- **Version:** 1.0
|
| 23 |
- **Model Developers:** Neural Magic
|
| 24 |
|
| 25 |
+
Quantized version of [DeepSeek-Coder-V2-Lite-Instruct](https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct).
|
| 26 |
<!-- It achieves an average score of 73.19 on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) benchmark (version 1), whereas the unquantized model achieves 73.48. -->
|
| 27 |
It achieves an average score of 79.60 on the [HumanEval+](https://github.com/openai/human-eval?tab=readme-ov-file) benchmark, whereas the unquantized model achieves 79.33.
|
| 28 |
|
| 29 |
### Model Optimizations
|
| 30 |
|
| 31 |
+
This model was obtained by quantizing the weights and activations of [DeepSeek-Coder-V2-Lite-Instruct](https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct) to FP8 data type, ready for inference with vLLM >= 0.5.2.
|
| 32 |
This optimization reduces the number of bits per parameter from 16 to 8, reducing the disk size and GPU memory requirements by approximately 50%.
|
| 33 |
|
| 34 |
Only the weights and activations of the linear operators within transformers blocks are quantized. Symmetric per-tensor quantization is applied, in which a linear scaling per output dimension maps the FP8 representations of the quantized weights and activations.
|