pub struct ModelSpec {
pub key: String,
pub api_id: String,
pub protocol: Protocol,
pub thinking: ThinkingMode,
pub context_window_tokens: u64,
pub max_image_base64_bytes: u64,
pub max_truncated_resumes: u32,
pub auto_compact_at_tokens: Option<u64>,
}Expand description
A resolved model: everything the protocol drivers need, minus credentials
(those live in BackendConfig). Built by the application configuration from the
[models] / [gateways] catalog in config.toml — myco ships no built-in
models.
Fields§
§key: StringCatalog key: what the user types after --model and what sessions
record. Distinct from api_id so one wire model can appear under
several keys (e.g. routed via different gateways).
api_id: StringWire id sent to the provider (the request model field).
protocol: Protocol§thinking: ThinkingMode§context_window_tokens: u64Context window for UX (USER n/m) and auto-compact heuristics.
max_image_base64_bytes: u64Largest image this model accepts, measured on the base64 payload.
Enforced locally by view_image and by REPL @path attachments so an
oversized image fails with a clear message instead of a provider 400.
Always concrete: config resolution applies the max_image_base64_bytes
entry or its default, and callers downstream take this value.
max_truncated_resumes: u32How many consecutive max_tokens truncations one turn resumes through
before handing control back (0 never resumes). Resolved from the
model’s max_truncated_resumes or its default; the agent takes this
value via the agent’s continuation policy.
auto_compact_at_tokens: Option<u64>Prompt size at which the REPL compacts without being asked. None =
no auto-compaction (the default; /compact still works).
Resolved from the model’s auto_compact_at fraction against
context_window_tokens so the comparison downstream is a plain token
count, and the fraction is validated once, at startup.
Trait Implementations§
impl Eq for ModelSpec
impl StructuralPartialEq for ModelSpec
Auto Trait Implementations§
impl Freeze for ModelSpec
impl RefUnwindSafe for ModelSpec
impl Send for ModelSpec
impl Sync for ModelSpec
impl Unpin for ModelSpec
impl UnsafeUnpin for ModelSpec
impl UnwindSafe for ModelSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.