Dockerfile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # syntax=docker/dockerfile:1.7
  2. # DeepSeek-V4-Flash-DSpark — overlay on top of
  3. # aidendle94/sparkrun-vllm-ds4-gb10:production-3.8
  4. #
  5. # production-3.8 is the clean-overlay micromamba/conda build (vLLM 0.21.1,
  6. # torch 2.11+cu130, NCCL 2.30.4, flashinfer 0.6.12, b12x 0.15.3) with the
  7. # opt-in DSPARK tiny-A8 decode kernel (VLLM_B12X_TINY_DECODE=1, see
  8. # /opt/tinydec). It is a clean base (empty entrypoint) meant to be launched
  9. # externally, matching how sm121 launches engines.
  10. #
  11. # Vs production-3.75 (vLLM 0.11.2 @ /opt/venv): the deepseek_v4 tokenizer
  12. # stack is byte-identical (verified md5), so the same patches apply; only the
  13. # prefix path differs (/opt/env, not /opt/venv). instanttensor is dropped — it
  14. # is not shipped in 3.8 and the recipe uses --load-format auto.
  15. #
  16. # Build: cd docker-images/deepseek-v4-flash-dspark && docker build -t sparkrun-vllm-ds4-gb10:fixed .
  17. FROM aidendle94/sparkrun-vllm-ds4-gb10:production-3.8
  18. # Fix reasoning_effort handling in the vendored deepseek_v4 tokenizer:
  19. # - high was accepted but silently injected nothing (only max triggered text)
  20. # - low / unknown values were coerced to high (unreachable low, silent escalation)
  21. # - the bundled deepseek_v4_encoding.py was an OLD revision (single REASONING_EFFORT_MAX
  22. # wording, max used the high text, read the deprecated `reasoning` key)
  23. # deepseek_v4_encoding.py is replaced with the canonical model-card reference
  24. # (deepseek-ai/DeepSeek-V4-Flash-0731 encoding/encoding_dsv4.py): full low/high/max
  25. # prompt dict, correct gate for both high and max, and reasoning_content key.
  26. # deepseek_v4.py carries the normalization fix so low is reachable and unknown
  27. # values map to None. See deepseek_v4.py / deepseek_v4_encoding.py in patches/.
  28. #
  29. # Tool-calling benchmarks showed three further encoding-level fixes on top of the
  30. # canonical file (see patches/):
  31. # * thinking_mode kwarg ('thinking'/'chat') honored as a model-card alias
  32. # * TOOLS_TEMPLATE carries an anti-prompt-injection security line
  33. # * response_format_template requires raw JSON (no markdown fences)
  34. COPY patches/deepseek_v4.py \
  35. patches/deepseek_v4_encoding.py \
  36. /opt/env/lib/python3.12/site-packages/vllm/tokenizers/
  37. # Tiny-decode kernel is opt-in via env (sitecustomize hook reads these at
  38. # interpreter start); the recipe[env] sets VLLM_B12X_TINY_DECODE=1 to enable.
  39. ENV VLLM_B12X_TINY_DECODE=0