pub enum ModelEntry {
Id(String),
Detailed {
id: String,
name: Option<String>,
context_window: Option<u64>,
max_output_tokens: Option<u64>,
thinking_format: Option<ThinkingFormat>,
},
}Expand description
A model candidate configuration declaration.
TOML supports two forms (accepted via Deserialize with untagged):
- Plain string
"gpt-5.5": only the id is given; the UI display name falls back to the id. - Table
{ id = "...", name = "Opus 4.8" }: pairs a long id with a short display name.
name is mapped to defect_agent::llm::ModelInfo::display_name; the ACP uses it as
the label for model selector options. When None, the wire layer falls back to the
id.
context_window / max_output_tokens let the user declare model metadata that the
provider cannot discover at runtime — most importantly for Bedrock, whose SDK does
not return model limits, so without this the compaction watermarks have no window to key
off and the context can grow unbounded. Both are optional; when absent the provider’s
own value (if any) or the compaction fallback applies.
Variants§
Id(String)
A plain ID (legacy format).
Detailed
A detailed entry with a display name and optional limits.
Fields
thinking_format: Option<ThinkingFormat>How extended thinking is serialized on the Anthropic Messages wire for this
model. Defaults to ThinkingFormat::Adaptive — the format newer models
(Opus 4.6+, Sonnet 4.6, Fable) require. Set to ThinkingFormat::Legacy for
older models (Sonnet 4.5, Haiku 4.5, …) that only accept the
thinking.type=enabled + budget_tokens shape and reject adaptive /
output_config.effort. Ignored by the OpenAI-compatible protocol.
Implementations§
Source§impl ModelEntry
impl ModelEntry
Sourcepub fn context_window(&self) -> Option<u64>
pub fn context_window(&self) -> Option<u64>
Optional context-window size (tokens), only from the table form.
Sourcepub fn max_output_tokens(&self) -> Option<u64>
pub fn max_output_tokens(&self) -> Option<u64>
Optional max output tokens, only from the table form.
Sourcepub fn thinking_format(&self) -> Option<ThinkingFormat>
pub fn thinking_format(&self) -> Option<ThinkingFormat>
Optional thinking wire format override, only from the table form.
Trait Implementations§
Source§impl Clone for ModelEntry
impl Clone for ModelEntry
Source§fn clone(&self) -> ModelEntry
fn clone(&self) -> ModelEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelEntry
impl Debug for ModelEntry
Source§impl<'de> Deserialize<'de> for ModelEntry
impl<'de> Deserialize<'de> for ModelEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ModelEntry
impl PartialEq for ModelEntry
Source§fn eq(&self, other: &ModelEntry) -> bool
fn eq(&self, other: &ModelEntry) -> bool
self and other values to be equal, and is used by ==.