Skip to main content

Dsv4Encoding

Enum Dsv4Encoding 

Source
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_effortPreview (base repo @ 60d8d707)V0731 (0731 @ 7872f01b)
Noneno prefixno prefix (None == “low” default)
“low”INVALID upstream (assert) — renders as no prefix hereno prefix
“high”documented NO-OP (== None)DS_EFFORT_ABSOLUTE_MAX prefix
“max”DS_EFFORT_ABSOLUTE_MAX prefixDS_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

Source§

fn clone(&self) -> Dsv4Encoding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Dsv4Encoding

Source§

impl Debug for Dsv4Encoding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Dsv4Encoding

Source§

impl PartialEq for Dsv4Encoding

Source§

fn eq(&self, other: &Dsv4Encoding) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Dsv4Encoding

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.