本地模型内存

DeepSeek 4 Flash 显存计算器

在购买硬件或下载 GGUF 前,估算 DS4 q2/q4 本地推理是否适合你的 Mac 或 CUDA 机器。

Recommended memory 0 GB
Fit Unknown
Source DS4 README

中文说明

这页只做硬件规划估算,不保证一定能跑。真实可用性还取决于量化、上下文长度、后端、KV cache 和上游项目更新。

第一版中文页保留部分英文 API 字段、模型名和表单标签,方便和官方文档、价格表、开发工具配置项对应。计算结果只做预算和选型参考,最终价格、限额和条款以官方后台或服务商当前公开说明为准。

How to read the result

DS4 is a DeepSeek V4 Flash-specific engine, not a generic GGUF runner. The project documentation says Metal starts from 96 GB machines, q2-imatrix targets 96/128 GB machines, and q4-imatrix targets 256 GB or larger machines. This calculator turns those published memory classes into a planning estimate.

Practical launch path

  • Start with q2-imatrix unless you already own a 256 GB+ machine.
  • Test 32K or 100K context before attempting the full 1M window.
  • On Mac, unified memory is usually the simplest capacity signal.
  • On CUDA, verify a specific hardware recipe before buying parts.

What DS4 is optimizing for

DeepSeek 4 Flash VRAM searches usually come from people deciding whether a local machine can run DeepSeek V4 Flash before they buy hardware. DS4, or DwarfStar 4, is not a general model runner. Its README describes it as a narrow DeepSeek V4 Flash inference engine with Metal and CUDA backends, DS4-specific GGUF loading, prompt rendering, tool calling, KV state handling, a server API, and an integrated coding agent.

The reason memory planning is tricky is that the model is very large, but DS4 leans on special quantization and compressed KV cache behavior. The upstream README says DeepSeek V4 Flash has a 1M token context window and that the 2-bit quantization can run on MacBooks with 128 GB RAM, with many reports at 96 GB. The Hugging Face model card lists the q2 GGUF at 80.8 GiB and the q4 GGUF at 153.3 GiB, before you account for runtime overhead, context, MTP, and system headroom.

Variant Published file size Upstream machine class Calculator behavior
q2-imatrix About 80.8 GiB q2-family GGUF 96 GB / 128 GB machines Uses q2 as the recommended default and adds context overhead.
q4-imatrix About 153.3 GiB q4-family GGUF 256 GB or larger machines Flags 128 GB-class machines as underpowered for q4.
MTP support file About 3.6 GiB Optional speculative decoding support Not included in the headline estimate; leave extra headroom if you enable it.

How the calculator turns sources into an estimate

The result is intentionally conservative. It starts from the machine classes stated by DS4, then adds a simple overhead for the target context window. q2-imatrix begins around the 96/128 GB class, while q4-imatrix begins around the 256 GB class. As the requested context rises, the calculator adds more memory headroom because long-context inference stresses KV storage, cache management, and the OS more than a short prompt benchmark.

This is not a guaranteed compatibility test. The exact fit depends on DS4 version, macOS or Linux version, Metal/CUDA backend, context length, MTP, KV-on-disk choices, and how much memory the rest of the machine is using. Treat "likely runnable" as permission to test, not permission to buy hardware blindly.

Mac unified memory vs CUDA VRAM

On Apple Silicon, unified memory is the practical capacity signal because the model and runtime share the system memory pool. The simplest DS4 path is therefore a high-memory Mac where Metal is the primary target. On CUDA, aggregate GPU memory is only part of the story. You still need a hardware recipe that has been tested with the selected DS4 backend and quantization. The page warns when CUDA GPU memory is below the broad 96 GB starting class because a random consumer GPU setup is unlikely to behave like a documented workstation path.

Recommended first test path

  1. Start with q2-imatrix, not q4, unless the machine has at least 256 GB of memory.
  2. Download through the DS4 script so the expected symlink and file layout are created.
  3. Run a short prompt first, then test 32K context, then 100K context.
  4. Only push toward 250K or 1M context after short runs are stable.
  5. Keep MTP/speculative decoding off for the first fit test, then add it after the baseline works.
  6. Record tokens per second, peak memory, and any crashes before changing quantization.

FAQ

Why does the page say VRAM when Mac uses unified memory?

Searchers often use "VRAM" as shorthand for local inference memory. On Mac, unified memory is the relevant number. On CUDA, GPU memory matters more directly, but DS4 still needs a tested backend and enough host resources.

Can I use these GGUF files in llama.cpp instead of DS4?

The Hugging Face page includes generic local-app examples, but the DS4 README says the project only works with GGUF files prepared for DS4 and that arbitrary GGUF files may not match the expected layout. For this calculator, DS4 is the assumed runner.

Should I buy a 128 GB or 256 GB machine?

If your goal is simply to experiment with q2-imatrix, 96/128 GB is the upstream starting class. If your goal is q4-imatrix or more comfortable long-context work, the DS4 documentation points to 256 GB or larger machines.

Sources

This page is an independent hardware planning estimate. It is not affiliated with DeepSeek, antirez, or the DS4 project.