---
title: DeepSeek-V4.1-Flash-1017-INT8
canonical_url: "https://www.modelscope.cn/models/Apsara-Stack/DeepSeek-V4.1-Flash-1017-INT8"
md_url: "https://www.modelscope.cn/models/Apsara-Stack/DeepSeek-V4.1-Flash-1017-INT8.md"
repository: Apsara-Stack/DeepSeek-V4.1-Flash-1017-INT8
last_updated: 2026-10-26
license: mit
pipeline_tag: image-text-to-text
tasks:
  - image-text-to-text
model_type:
  - deepseek_v41
architectures:
  - DeepseekV41ForCausalLM
base_model_relation: quantized
parameters: 763.2B
tensor_type:
  - BF16
  - F8_E4M3
  - F8_E8M0
  - I8
  - F32
library_name:
  - safetensors
downloads: 600
stars: 9
---

# DeepSeek-V4.1-Flash-1017-INT8

> DeepSeek-V4.1-Flash-1017-INT8 - Apsara-Stack 在 ModelScope 开源的模型。DeepSeek-V4.1-Flash-1017

Apsara-Stack/DeepSeek-V4.1-Flash-1017-INT8 是 ModelScope 魔搭社区上的 763.2B 参数image-text-to-text模型，采用 mit 许可。

- **Repository**: Apsara-Stack/DeepSeek-V4.1-Flash-1017-INT8
- **License**: mit
- **Tasks**: image-text-to-text
- **Parameters**: 763.2B
- **Downloads**: 600
- **Stars**: 9
- **Last updated**: 2026-10-26

Source: https://www.modelscope.cn/models/Apsara-Stack/DeepSeek-V4.1-Flash-1017-INT8

---

# DeepSeek-V4.1-Flash-1017

<!-- markdownlint-disable first-line-h1 -->
<!-- markdownlint-disable html -->
<!-- markdownlint-disable no-duplicate-header -->

<div align="center">
  <img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/logo.svg?raw=true" width="60%" alt="DeepSeek-V4.1" />
</div>
<hr>
<div align="center" style="line-height: 1;">
  <a href="https://www.deepseek.com/" target="_blank" style="margin: 2px;">
    <img alt="Homepage" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/badge.svg?raw=true" style="display: inline-block; vertical-align: middle;"/>
  </a>
  <a href="https://chat.deepseek.com/" target="_blank" style="margin: 2px;">
    <img alt="Chat" src="https://img.shields.io/badge/🤖%20Chat-DeepSeek%20V4.1-536af5?color=536af5&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
  </a>
</div>
<div align="center" style="line-height: 1;">
  <a href="https://huggingface.co/deepseek-ai" target="_blank" style="margin: 2px;">
    <img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-DeepSeek%20AI-ffc107?color=ffc107&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
  </a>
  <a href="https://twitter.com/deepseek_ai" target="_blank" style="margin: 2px;">
    <img alt="Twitter Follow" src="https://img.shields.io/badge/Twitter-deepseek_ai-white?logo=x&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
  </a>
</div>
<div align="center" style="line-height: 1;">
  <a href="LICENSE" style="margin: 2px;">
    <img alt="License" src="https://img.shields.io/badge/License-MIT-f5de53?&color=f5de53" style="display: inline-block; vertical-align: middle;"/>
  </a>
</div>

<p align="center">
  <a href="https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash/blob/main/DeepSeek_V41_Tech_Report.pdf"><b>Technical Report</b> 👁️</a>
</p>

## Introduction

**DeepSeek-V4.1-Flash-1017** is a minor update to [**DeepSeek-V4.1-Flash**](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash), delivering substantial improvements across reasoning, coding, agentic tasks, and visual benchmarks. Alongside these gains, the model reduces task execution time and output length, enabling users to complete tasks faster and at lower cost and advancing the performance–cost Pareto frontier across multiple agent harnesses.

<div align="center">

| Benchmark | DS-V4.1-Flash-1017 | DS-V4.1-Flash | K3 | GLM-5.3 | GPT-5.6 Sol | Opus 5 |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| HLE w/o tools | 42.6 (44.0†) | 36.8 (39.1†) | 43.5 | 42.0† | 44.5 | 56.3 |
| Terminal-Bench 4.0 | 42.3 | 31.2 | 12.6 | 37.9 | 39.9 | 51.8 |
| DeepSWE v1.1 | 77.0 | 74.2 | 67.5 | 66.9 | 73.0 | 74.0 |
| ProgramBench | 29.1 | 20.3 | 17.5 | 19.0 | 23.0 | 37.0 |
| NL2Repo-Bench | 68.2 | 65.4 | 58.0 | 58.0 | 56.8 | 75.3 |
| Automation-Bench v1.0.6 | 60.5 | 54.8 | 46.7 | 48.8 | 45.8 | 50.3 |
| Agents’ Last Exam | 35.4 | 31.8 | 27.6 | 28.5 | 26.7 | 28.6 |
| Apex Bench v1.1 | 72.1 | 64.6 | 47.8 | 56.6 | 54.3 | 65.8 |
| Chartography (w/tools) | 83.0 | 78.9 | 68.1 | — | 79.9 | 84.0 |
| BabyVision (w/tools) | 92.5 | 89.6 | 85.7 | — | 88.9 | 94.1 |
| ZeroBench-main (w/tools) | 51.0 | 49.0 | 41.0 | — | 53.0 | 52.0 |

</div>

*† denotes the text-only subset of HLE. We use the Claude Code harness for Terminal-Bench 4.0 and the Mini-SWE-V2 harness for DeepSWE v1.1.*

## Prompt Encoding

This release does not include a Jinja-format chat template. The [`encoding`](encoding/README.md) folder contains a self-contained Python reference implementation (`encoding.py`) with test cases for multi-turn conversations, tool calling, thinking mode, numeric reasoning effort, mid-conversation system messages, and interleaved image content.

For production use, we additionally release [deepseek-recipe](https://github.com/deepseek-ai/deepseek-recipe), a set of Rust libraries with Python bindings that provides the same prompt format as a maintained, protocol-aware toolkit. It converts Messages, Chat Completions, and Responses API requests into the Conversation format, encodes them into DeepSeek V4 and V4.1 prompts or token IDs, and parses model output back into complete or streamed responses — covering thinking, tool calls, images, and generation settings. Model inference, tool execution, and HTTP transport are left to the caller.

## Minimal Inference

Please refer to the [`inference`](inference/README.md) folder for instructions on weight conversion and running inference locally.

**Recommended sampling parameters:**

| Parameter | Value |
| :--- | :--- |
| `temperature` | 1.0 |
| `top_p` | 1.0 |
| `context_window` | 1M tokens |
| `max_tokens` | ≥ 256K |

## W8A8 INT8 Quantization

This is a W8A8 INT8 per-channel quantized version of [`DeepSeek-V4.1-Flash-1017`](https://www.modelscope.cn/models/deepseek-ai/DeepSeek-V4.1-Flash-1017). The recipe is consistent with [`DeepSeek-V4.1-Flash-INT8`](https://www.modelscope.cn/models/Apsara-Stack/DeepSeek-V4.1-Flash-INT8).

### Quantization Method

- Weights: symmetric INT8 per-channel quantization with F32 `(out, 1)` scales (`amax(abs(W), dim=in) / 127`).
- Activations: dynamic INT8 quantization; no calibration dataset is used.
- Source FP8/FP4 weights are reconstructed in BF16 before conversion.
- The checkpoint contains 47,457 INT8 weights, each paired with a `weight_scale`, and is compatible with SGLang `w8a8_int8`.

### 1017 Update

The model structure is unchanged. Compared with the previous release, the 1017 source stores 131 additional precision-sensitive weights in FP8. These weights are dequantized and kept in BF16 here: `attn.wq_a`, `attn.wkv`, `attn.wo_a` (129 tensors), and `engram.wkv` (2 tensors).

### Quantized Weights

| Scope | Tensors | Source format | Output format |
| :--- | ---: | :--- | :--- |
| Main-model routed experts (`ffn.experts.*.w1/w2/w3`) | 46,080 | FP4 E2M1 | INT8 + F32 scale |
| MTP routed experts | 1,152 | FP4 E2M1 | INT8 + F32 scale |
| Main-model and MTP shared experts | 129 | FP8 E4M3 | INT8 + F32 scale |
| Attention `wq_b` / `wo_b` and indexer `wq_b` | 94 | FP8 E4M3 | INT8 + F32 scale |
| `mtp.0.main_proj` / `mtp.2.confidence_head.proj` | 2 | FP8 / BF16 | INT8 + F32 scale |

FP8 tensors use 32×32 E8M0 block scales; FP4 expert tensors use packed E2M1 values with per-32 E8M0 scales.

### Kept in BF16

KV-cache-related and precision-sensitive projections listed in `quantization_config.ignore` remain BF16:

- `attn.wq_a`, `attn.wkv`, and `attn.wo_a`.
- `attn.compressor.wkv/wgate` and `attn.indexer.weights_proj/wk`.
- `engram.wkv`, `vision.*`, and `aligner.*`.

The two large `engram.embed` lookup tables remain in native FP8 E4M3 + E8M0 format because they are lookup tables rather than GEMM linear layers. Embeddings, heads, routers, normalization layers, and other non-linear weights retain their original formats.

### Configuration

The relevant `config.json` settings are:

```json
{
  "quant_method": "w8a8_int8",
  "activation_scheme": "dynamic",
  "is_dynamic": true,
  "is_checkpoint_int8_serialized": true,
  "expert_dtype": "int8"
}
```

### Verification

All 48 safetensors shards were checked: the index and shard headers contain the same 95,955 keys, all 47,457 INT8 weights have matching F32 `(out, 1)` scales, and all 346 ignore-matched linear weights are BF16. The checkpoint occupies approximately 722 GiB and requires an inference stack with `deepseek_v41` and `w8a8_int8` support.

## License

This repository and the model weights are licensed under the [MIT License](LICENSE).

## Citation

```bibtex
@misc{deepseekai2026deepseekv41flash,
      title={DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression},
      author={DeepSeek-AI},
      year={2026},
}
```

## Contact

If you have any questions, please raise an issue or contact us at [service@deepseek.com](mailto:service@deepseek.com).
