pub struct ProviderProfile {
pub name: String,
pub tool_choice: bool,
pub stream_usage: bool,
pub max_tokens_field: Option<String>,
pub supports_tools: bool,
pub send_reasoning: bool,
pub body: Value,
pub reasoning: Option<Policy>,
pub models: BTreeMap<String, ModelReasoning>,
pub request: RequestPolicy,
pub vision: Option<bool>,
}Expand description
How a request is shaped for one backend dialect. Everything here is wire detail: the conversation, the tools and the prompt never depend on it.
Built in: openai and llamacpp. A plugin may declare more, and a plugin profile with a
built-in’s name replaces it, so a backend quirk needs no code change.
Fields§
§name: String§tool_choice: boolSend tool_choice: "auto" alongside tools.
stream_usage: boolAsk for stream_options: {include_usage: true} (OpenAI reports token usage that way;
some local servers reject the field).
max_tokens_field: Option<String>Field name for ProviderConfig::max_tokens: max_tokens or
max_completion_tokens.
supports_tools: boolAdvertise tools at all. false for backends that break on the tools array.
send_reasoning: boolRound-trip the assistant’s reasoning into the next request’s message body.
body: ValueMerged into every request body last, so it wins over the fields above. This is the
escape hatch for chat_template_kwargs, reasoning_effort and friends.
reasoning: Option<Policy>How this backend takes a reasoning effort, when a manifest declares it. Absent = nobody said,
and then a configured level is sent as reasoning_effort verbatim and an unset one is not
sent at all — the behaviour from before this existed.
models: BTreeMap<String, ModelReasoning>Per-model overrides, keyed by the model id this profile serves. A model that reasons on/off only, or not at all, is one entry in a manifest — not a code change.
request: RequestPolicyStanding request policy: context size, output cap, temperature mode, formats this route rejects, and the cheap model it publishes. Declared, never compiled in.
vision: Option<bool>What this route can do that the request body does not say. Reported by config check and
tools schema, so “can this backend see an image” is answerable without reading a manifest.
Implementations§
Source§impl ProviderProfile
impl ProviderProfile
Sourcepub fn builtin(name: &str) -> Option<Self>
pub fn builtin(name: &str) -> Option<Self>
One of the profiles compiled in, or None if there is no such built-in.
Sourcepub fn resolve(name: &str, from_plugins: &[ProviderProfile]) -> Result<Self>
pub fn resolve(name: &str, from_plugins: &[ProviderProfile]) -> Result<Self>
Resolve name against the built-ins and the profiles plugins declared, plugins
winning on a name collision.
Source§impl ProviderProfile
impl ProviderProfile
Sourcepub fn reasoning_for(&self, model: &str) -> Reasoning
pub fn reasoning_for(&self, model: &str) -> Reasoning
The reasoning control for model: its own manifest entry, else the profile’s.