Skip to main content

Module model_config

Module model_config 

Source
Expand description

[model] in speccoder.toml.

Structs§

ModelConfig
The model speccoder calls.
Prices
USD per million tokens.

Enums§

CacheTtl
Prompt-cache lifetime for breakpoints: agentplane’s, read as 5m or 1h (one hour survives a run paused for an approval). How long a provider keeps a cached prompt prefix.
PromptStyle
Provider prompt dialects (same content, same stability order).

Constants§

NEEDS_REGION
How parse’s error for a Bedrock file without its region begins; that error is never reported while another one stands.

Functions§

bedrock_fixes
What gets Bedrock credentials when none is found: a Bedrock API key, an aws login session, or another provider.
bedrock_model_warning
What to say when model is not a Bedrock model id (vendor.model, an inference profile global.vendor.model, or an ARN): a warning, since Bedrock alone knows its ids.
config_fix
The speccoder config … command a [model] error ends with, if any.
open_driver
The model driver for model, and the secret to redact from messages. Keys come only from the environment; a local openai-compatible server needs none unless api_key_env names one, and Bedrock’s come from the AWS credential chain (AWS_BEARER_TOKEN_BEDROCK or a profile).
parse
Reads [model] from the configuration text; None when absent.
provider_refused_fix
The fix for a provider refusing the account (PROVIDER-REFUSED): the catalog’s, after — for Bedrock — the command that renews source, the credentials the calls were signed with.
refused
Why the model could not be opened, as a result: a missing key is KEY-MISSING with the exact export (and the other ways to get a model), anything else CONFIG-INVALID. Every command that calls a model says it the same way.
strip_cache_control
Removes cache_control breakpoints from a prompt (for PromptStyle::Chat).
to_parts
Converts an Anthropic-layout prompt to agentplane’s shared shape (for PromptStyle::Parts): system blocks and the first message’s content become text parts, a cache_control breakpoint a cache mark — "1h" for the hour, "5m" otherwise — or none when caches is off. A string system stays as it is; a prompt without messages is left untouched.