pub struct ModelPreferences {
pub cost_priority: Option<f64>,
pub hints: Vec<ModelHint>,
pub intelligence_priority: Option<f64>,
pub speed_priority: Option<f64>,
}
Expand description
The server’s preferences for model selection, requested of the client during sampling. Because LLMs can vary along multiple dimensions, choosing the “best” model is rarely straightforward. Different models excel in different areas—some are faster but less capable, others are more capable but more expensive, and so on. This interface allows servers to express their priorities across multiple dimensions to help clients make an appropriate selection for their use case. These preferences are always advisory. The client MAY ignore them. It is also up to the client to decide how to interpret these preferences and how to balance them against other considerations.
JSON schema
{
"description": "The server's preferences for model selection, requested of the client during sampling.\n\nBecause LLMs can vary along multiple dimensions, choosing the \"best\" model is\nrarely straightforward. Different models excel in different areas—some are\nfaster but less capable, others are more capable but more expensive, and so\non. This interface allows servers to express their priorities across multiple\ndimensions to help clients make an appropriate selection for their use case.\n\nThese preferences are always advisory. The client MAY ignore them. It is also\nup to the client to decide how to interpret these preferences and how to\nbalance them against other considerations.",
"type": "object",
"properties": {
"costPriority": {
"description": "How much to prioritize cost when selecting a model. A value of 0 means cost\nis not important, while a value of 1 means cost is the most important\nfactor.",
"type": "number",
"maximum": 1.0,
"minimum": 0.0
},
"hints": {
"description": "Optional hints to use for model selection.\n\nIf multiple hints are specified, the client MUST evaluate them in order\n(such that the first match is taken).\n\nThe client SHOULD prioritize these hints over the numeric priorities, but\nMAY still use the priorities to select from ambiguous matches.",
"type": "array",
"items": {
"$ref": "#/definitions/ModelHint"
}
},
"intelligencePriority": {
"description": "How much to prioritize intelligence and capabilities when selecting a\nmodel. A value of 0 means intelligence is not important, while a value of 1\nmeans intelligence is the most important factor.",
"type": "number",
"maximum": 1.0,
"minimum": 0.0
},
"speedPriority": {
"description": "How much to prioritize sampling speed (latency) when selecting a model. A\nvalue of 0 means speed is not important, while a value of 1 means speed is\nthe most important factor.",
"type": "number",
"maximum": 1.0,
"minimum": 0.0
}
}
}
Fields§
§cost_priority: Option<f64>
§hints: Vec<ModelHint>
Optional hints to use for model selection. If multiple hints are specified, the client MUST evaluate them in order (such that the first match is taken). The client SHOULD prioritize these hints over the numeric priorities, but MAY still use the priorities to select from ambiguous matches.
intelligence_priority: Option<f64>
§speed_priority: Option<f64>
Trait Implementations§
Source§impl Clone for ModelPreferences
impl Clone for ModelPreferences
Source§fn clone(&self) -> ModelPreferences
fn clone(&self) -> ModelPreferences
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more