Release 0.2.0 #4
@@ -356,7 +356,13 @@ impl LlmManager {
|
||||
pub async fn reasoning_mode_for(&self, provider_id: i64, model_id: &str) -> Option<ReasoningMode> {
|
||||
let record = self.state.read().await.providers.get(&provider_id).cloned()?;
|
||||
let provider = self.registry.get(&record.provider)?;
|
||||
provider.reasoning_mode(model_id, &[])
|
||||
// Capability-gated modes need the model's real capabilities: resolve
|
||||
// them from the provider's catalog. Empty when unlisted — id-glob
|
||||
// rules still match.
|
||||
let caps = self.fetch_model_info(provider_id, model_id).await
|
||||
.map(|m| m.capabilities)
|
||||
.unwrap_or_default();
|
||||
provider.reasoning_mode(model_id, &caps)
|
||||
}
|
||||
|
||||
pub async fn list_models_info(&self) -> Vec<LlmModelInfo> {
|
||||
|
||||
@@ -588,6 +588,17 @@ impl ApiProvider for DeclaredProvider {
|
||||
Ok(Some(self.list_models(record).await?))
|
||||
}
|
||||
|
||||
async fn llm_model_info(
|
||||
&self,
|
||||
record: &LlmProviderRecord,
|
||||
model_id: &str,
|
||||
) -> Result<Option<RemoteLlmModelInfo>> {
|
||||
if self.spec.models.is_none() {
|
||||
return Ok(None);
|
||||
}
|
||||
Ok(self.list_models(record).await?.into_iter().find(|m| m.id == model_id))
|
||||
}
|
||||
|
||||
fn reasoning_mode(&self, model_id: &str, capabilities: &[String]) -> Option<ReasoningMode> {
|
||||
let spec = self.spec.reasoning.as_ref()?;
|
||||
let rule = spec
|
||||
|
||||
+6
-2
@@ -190,13 +190,17 @@ providers:
|
||||
base_capabilities: [function_calling]
|
||||
reasoning:
|
||||
# Flat reasoning_effort (none/minimal/low/medium/high/xhigh/max);
|
||||
# "none" disables reasoning where the model supports it. Models tagged
|
||||
# `reasoning` but not `reasoning_effort` always think — no knob.
|
||||
# "none" disables reasoning where the model supports it.
|
||||
request: { kind: effort, remap: { disabled: none } }
|
||||
modes:
|
||||
- when: { capability: reasoning_effort }
|
||||
values: [disabled, minimal, low, medium, high, xhigh, max]
|
||||
default: high
|
||||
# Models tagged only `reasoning` (R1, DeepSeek-V4-…) accept the plain
|
||||
# levels — graded steps are a `reasoning_effort`-tag affair.
|
||||
- when: { capability: reasoning }
|
||||
values: [disabled, low, medium, high]
|
||||
default: high
|
||||
|
||||
- id: lm_studio
|
||||
name: "LM Studio"
|
||||
|
||||
Reference in New Issue
Block a user