systemprompt_wire/limits.rs
1//! Token limits of one upstream model.
2//!
3//! [`ModelLimits`] is the per-model ceiling a codec clamps a request to: the
4//! context window, the output-token cap and the optional thinking budget. The
5//! provider catalog carries one per model; the codecs read it when they render
6//! an upstream request.
7//!
8//! Copyright (c) systemprompt.io — Business Source License 1.1.
9//! See <https://systemprompt.io> for licensing details.
10
11use serde::{Deserialize, Serialize};
12
13#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, schemars::JsonSchema)]
14pub struct ModelLimits {
15 #[serde(default)]
16 pub context_window: u32,
17
18 #[serde(default)]
19 pub max_output_tokens: u32,
20
21 #[serde(default, skip_serializing_if = "Option::is_none")]
22 pub max_thinking_budget: Option<u32>,
23}