pub struct ModelConfig {
pub provider: String,
pub model: String,
pub max_output_tokens: u32,
pub max_run_tokens: u64,
pub cache_ttl: CacheTtl,
pub prices: Option<Prices>,
pub base_url: Option<String>,
pub api_key_env: Option<String>,
pub structured_native: bool,
pub reasoning_summary: bool,
pub region: Option<String>,
}Expand description
The model speccoder calls.
Fields§
§provider: StringDriver name: anthropic, openai, openai-compatible or bedrock.
model: StringThe provider’s model id, pinned exactly.
max_output_tokens: u32Per-call output ceiling.
max_run_tokens: u64Token budget of one run.
cache_ttl: CacheTtlLifetime of prompt-cache breakpoints.
prices: Option<Prices>USD per million tokens, if configured (speccoder report --cost).
base_url: Option<String>openai-compatible: the server, e.g. http://localhost:11434/v1.
api_key_env: Option<String>openai-compatible: the environment variable holding a key, if the
server wants one.
structured_native: boolopenai-compatible: the server enforces json_schema output
(structured = "native", the default); "tool" carries it in a
forced tool instead, which works only for steps without tools.
reasoning_summary: boolAsk for a summary of the model’s reasoning on each attempt turn
(reasoning_summary, default on): shown as its account, never as
evidence. Providers without a way to ask (Chat Completions) give none.
region: Option<String>bedrock: the AWS region calls go to (the journal records it).
Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn key_variable(&self) -> &str
pub fn key_variable(&self) -> &str
The environment variable holding this provider’s API key.
Sourcepub fn caches(&self) -> bool
pub fn caches(&self) -> bool
Whether prompts carry cache breakpoints for this model: always, but on Bedrock only for Claude models (other families take no cache points).
Sourcepub fn prompt_style(&self) -> PromptStyle
pub fn prompt_style(&self) -> PromptStyle
How prompts are laid out for this provider.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§impl Debug for ModelConfig
impl Debug for ModelConfig
Source§impl PartialEq for ModelConfig
impl PartialEq for ModelConfig
impl StructuralPartialEq for ModelConfig
Auto Trait Implementations§
impl Freeze for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more