pub enum Dsv4Encoding {
Preview,
V0731,
}Expand description
Which encoding_dsv4.py revision governs the deepseek-v4 REASONING-EFFORT ladder
(0731 re-gate, 2026-08-18 — research/dsv4-template-20260818/ENCODING-DIFF.md).
The two shipped encodings differ ONLY here; every other rendering law (roles, tool blocks, transitions, special tokens, think-mode prefixes, parsing) is byte-identical:
reasoning_effort | Preview (base repo @ 60d8d707) | V0731 (0731 @ 7872f01b) |
|---|---|---|
| None | no prefix | no prefix (None == “low” default) |
| “low” | INVALID upstream (assert) — renders as no prefix here | no prefix |
| “high” | documented NO-OP (== None) | DS_EFFORT_ABSOLUTE_MAX prefix |
| “max” | DS_EFFORT_ABSOLUTE_MAX prefix | DS_EFFORT_BEYOND_MAX prefix |
The prefix (when non-empty) is injected once, before the first rendered message, in thinking mode only; chat mode never renders a prefix under either encoding.
DETECTION IS CONFIG-KEYED, never filename-keyed: the 0731 checkpoint added exactly four
dspark_* keys to config.json in the same revision that remapped the ladder
(dspark_block_size, dspark_markov_rank, dspark_noise_token_id,
dspark_target_layer_ids); tokenizer/template files are byte-identical across the two
checkpoints, so config.json is the artifact’s only encoding marker. Tokenizer::from_hf_dir
performs the census (all four -> V0731, none -> Preview, a partial set refuses to load).
Callers that cannot know the revision pass None; rendering then REFUSES exactly the
(thinking, “high”/“max”) requests whose bytes differ between revisions and stays
infallible everywhere the two encodings agree.
Variants§
Preview
deepseek-ai/DeepSeek-V4-Flash (preview) law: {None,“high”} no-op, “max” -> absolute.
V0731
DeepSeek-V4-Flash-0731 law: None/“low” no prefix, “high” -> absolute, “max” -> beyond.
Trait Implementations§
Source§impl Clone for Dsv4Encoding
impl Clone for Dsv4Encoding
Source§fn clone(&self) -> Dsv4Encoding
fn clone(&self) -> Dsv4Encoding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more