ModelBehavior

Struct ModelBehavior 

Source
pub struct ModelBehavior {
Show 32 fields pub thinking_in_tools: bool, pub max_thinking_budget: u32, pub effort_capped_at_ceiling: bool, pub thinking_default: bool, pub fp8_kv_calibration_tokens: usize, pub default_kv_dtype: &'static str, pub default_num_drafts: u32, pub mtp_max_seqs: u32, pub disable_tool_steering: bool, pub disable_cwd_hint_injection: bool, pub use_sampling_presets_for_core: bool, pub tool_call_parser: &'static str, pub enable_loop_watchdog: bool, pub enable_think_loop_watchdog: bool, pub honor_eos_inside_thinking: bool, pub min_reasoning_floor_tokens: u32, pub cap_thinking_at_max_tokens: bool, pub min_p_floor: f32, pub temperature_max: f32, pub think_loop_min_repeats: u32, pub think_loop_scan_window: u32, pub confidence_early_stop: bool, pub confidence_run_length: u32, pub fuzzy_repeat_tolerance_div: u32, pub max_inter_tool_prose: u32, pub max_post_think_content_tokens: u32, pub tscg: bool, pub disable_tool_grammar: bool, pub rollback_resteer: bool, pub rom_head: &'static str, pub tool_retry: bool, pub preserve_thinking: Option<bool>,
}
Expand description

2026-09-25: Model-specific behaviour flags from MODEL.toml [behavior], parsed at build time by build_parse_behavior.rs. “Default” below is the value of an absent key, which equals ModelBehavior::default().

Fields§

§thinking_in_tools: bool

2026-09-25: When false, a tool-active request without an explicit thinking directive runs with thinking off. Default true.

§max_thinking_budget: u32

2026-09-25: Thinking budget (tokens) for a thinking-on request that names none, and the anchor E of the reasoning_effort ladder (effort_budget in metrale-server’s api/chat/thinking.rs). --max-thinking-budget outranks it. Default DEFAULT_MAX_THINKING_BUDGET.

§effort_capped_at_ceiling: bool

2026-09-25: Clamp the reasoning_effort ladder at E, so high and xhigh resolve to max_thinking_budget instead of 2E and 4E. Default DEFAULT_EFFORT_CAPPED_AT_CEILING.

§thinking_default: bool

2026-09-25: Thinking state for a request that carries no thinking directive. Any explicit directive overrides it, and --disable-thinking turns thinking off for every request. Default false.

§fp8_kv_calibration_tokens: usize

2026-09-25: FP8 KV calibration token count used when --fp8-kv-calibration-tokens is not given; 0 disables calibration.

§default_kv_dtype: &'static str

2026-09-25: KV cache dtype (e.g. “bf16”, “fp8”) used when --kv-cache-dtype is not given; empty means the engine default (resolve_kv_dtype_str).

§default_num_drafts: u32

2026-09-25: Speculative num_drafts (K = num_drafts + 1) used when --num-drafts is not given; 0 means the engine default (resolve_num_drafts).

§mtp_max_seqs: u32

2026-09-29: The multi-sequence MTP dispatch cap (the widest batch that speculates) when --mtp-max-seqs is not given; 0 means the engine default (metrale_model_layers::speculative::resolve_mtp_max_seqs).

§disable_tool_steering: bool

2026-09-25: Passed to the chat template as disable_tool_steering; nemotron_h.jinja then omits its <tool_call> generation-prompt prefix when tools are present. Default false.

§disable_cwd_hint_injection: bool

2026-09-25: Skip the <environment> working-directory hint that the chat path adds to the system message of a tool-active request. Default false.

§use_sampling_presets_for_core: bool

2026-09-25: On the chat path, take the default temperature, top-k, top-p, min-p and top-n-sigma from the selected MODEL.toml sampling category instead of the server-wide defaults. Request values still win. Default false.

§tool_call_parser: &'static str

2026-09-25: Tool-call parser name. --tool-call-parser outranks it; empty means the tool_defaults.toml entry for the checkpoint’s model_type.

§enable_loop_watchdog: bool

2026-09-25: Starting value of the content-loop watchdog lever (SchedLevers::loop_watchdog), which resolve_content_loop_watchdog combines with METRALE_CONTENT_LOOP_WATCHDOG and --content-loop-watchdog. Default false.

§enable_think_loop_watchdog: bool

2026-09-25: Per-model gate for the thinking-loop watchdog. Default true.

§honor_eos_inside_thinking: bool

2026-09-25: When thinking is the only reason an EOS is suppressed, close the thinking block instead of discarding the EOS. Default false.

§min_reasoning_floor_tokens: u32

2026-09-25: While fewer than this many thinking tokens have been emitted, </think> gets a -8.0 logit bias; 0 disables it. Default 16.

§cap_thinking_at_max_tokens: bool

2026-09-25: Also cap the thinking budget at 90% of the request’s max_tokens; false leaves max_thinking_budget (or the request’s own budget) as the only cap. Default true.

§min_p_floor: f32

2026-09-25: Server-side min-p floor, applied as min_p.max(floor) after request and preset resolution, so it holds even when a client sends min_p = 0. 0.0 disables it. The qwen3.6-35b-a3b MODEL.toml files set 0.05 and record the measurement behind it.

§temperature_max: f32

2026-09-25: Server-side temperature ceiling, applied as temperature.min(max) after resolution. 0.0 disables it.

§think_loop_min_repeats: u32

2026-09-25: Repeat count at which the thinking-loop detector forces </think>, unless the request sends its own repetition_detection. Default 3.

§think_loop_scan_window: u32

2026-09-25: Carried into WatchdogParams::think_loop_scan_window; detect_token_loop ignores that value, so this field has no effect. Default 160.

§confidence_early_stop: bool

2026-09-25: Whether F2ConfidenceEarlyStop may arm a forced </think>. Default true.

§confidence_run_length: u32

2026-09-25: Consecutive confident thinking tokens after which F2ConfidenceEarlyStop arms a forced </think>. Default 30.

§fuzzy_repeat_tolerance_div: u32

2026-09-25: Fuzzy-repetition tolerance divisor: a pattern_len window tolerates max(pattern_len / div, 1) mismatches. Default 12 (about 8%).

§max_inter_tool_prose: u32

2026-09-25: Cap on content tokens outside tool bodies since the last tool call on a tool request; past it the watchdog rolls back or ends the response. --max-inter-tool-prose and METRALE_MAX_INTER_TOOL_PROSE outrank it, and 0 disables the guard (resolve_max_inter_tool_prose). Default DEFAULT_MAX_INTER_TOOL_PROSE.

§max_post_think_content_tokens: u32

2026-09-25: Cap on content tokens per generation for a sequence with a grammar attached; past it the response ends. Sequences without a grammar are not capped. Default 100_000.

§tscg: bool

2026-09-25: TSCG (arXiv:2605.04107): render the prompt’s tool list as compiled function signatures instead of JSON schemas. Default false.

§disable_tool_grammar: bool

2026-09-25: On a tool-active request with tool_choice other than required, parse tool calls but do not constrain them with the tool grammar. A pinned --tool-grammar outranks it. Default false.

§rollback_resteer: bool

2026-09-25: When a decode-time watchdog fires, roll the sequence back to its last boundary and re-steer instead of ending the response (arXiv:2603.27905); false makes the rollback decline. After crate::ROLLBACK_RESTEER_CAP rollbacks of one sequence the rollback declines and the watchdog ends the response. Default true.

§rom_head: &'static str

2026-09-25: Path to a trained repetition-onset (ROM, arXiv:2603.22016) head artifact. Nothing loads it: a non-empty value only logs a startup warning, and the scheduler’s rom_head stays None. Default empty.

§tool_retry: bool

2026-09-25: Parsed from [behavior].tool_retry (default true), but nothing reads it: the chat stream’s tool_retry_enabled is the constant false.

§preserve_thinking: Option<bool>

2026-09-25: The chat template’s preserve_thinking variable. None leaves it undefined, so the template’s own default applies; Some(_) sets it. A server-level preserve_thinking default kwarg outranks it, and a request’s chat_template_kwargs.preserve_thinking wins over both.

Trait Implementations§

Source§

impl Clone for ModelBehavior

Source§

fn clone(&self) -> ModelBehavior

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelBehavior

Source§

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

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

impl Default for ModelBehavior

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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.