{
 "schema_version": 1,
 "generated": "2026-10-24",
 "id": "deepseek-ai-deepinfer--run-offline-inference-deepseek-v4-flash",
 "repo": "deepseek-ai/DeepInfer",
 "repo_url": "https://github.com/deepseek-ai/DeepInfer",
 "repo_slug": "deepseek-ai-deepinfer",
 "title": "Run offline inference on DeepSeek-V4.1-Flash locally",
 "page_title": "How to run offline inference on DeepSeek-V4.1-Flash locally with Deep Infer",
 "summary": "Build Deep Infer from source and generate text from the default DeepSeek checkpoint.",
 "who": "An ML engineer with an SM100 GPU or Ascend 950 NPU who needs to test DeepSeek-V4.1-Flash outputs on their own hardware.",
 "problem": "Getting a DeepSeek model to run on a specific accelerator needs a build, the right environment variables, and a checkpoint in the right place.",
 "outcome": "A working Deep Infer build that loads DeepSeek-V4.1-Flash and produces generated text from the offline example script.",
 "steps": [
  "Create and activate an empty Python 3.12 environment.",
  "Run `export DEEPINFER_ACCELERATOR=nvidia` (use `ascend` instead on the Ascend platform), and keep it exported in the shell where you run Deep Infer.",
  "Run `./build.sh` from the repo root.",
  "(Optional) Run `DEEPINFER_HF_MODEL_DIR=/path/to/DeepSeek-V4.1-Flash-1017` to use a local checkpoint instead of the Hugging Face cache.",
  "Run `python examples/offline_inference.py` and read the output."
 ],
 "agent_prompt": "Clone https://github.com/deepseek-ai/DeepInfer, set up a Python 3.12 environment, export DEEPINFER_ACCELERATOR=nvidia, run ./build.sh, then run python examples/offline_inference.py using the checkpoint at <checkpoint path>. Report the generated text and the build result, and verify that the script finishes without an import or device error.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The README says the open-source release covers offline inference only, and KV cache, prefill and decode disaggregation, and data-parallel load balancing are not included.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Linux with GCC 13.0 or newer and Python 3.12",
  "NVIDIA SM100 GPU with CUDA 13, or Huawei Ascend 950 NPU with CANN 9.2",
  "Access to the deepseek-ai/DeepSeek-V4.1-Flash-1017 checkpoint on Hugging Face, or a local copy",
  "Enough disk space and memory for the checkpoint and the build"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/deepseek-ai-deepinfer/run-offline-inference-deepseek-v4-flash/",
 "md": "https://dedupedai.com/use-cases/deepseek-ai-deepinfer/run-offline-inference-deepseek-v4-flash/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/deepseek-ai-deepinfer--run-offline-inference-deepseek-v4-flash.json",
 "api_version": "v1"
}
