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> {
|
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 record = self.state.read().await.providers.get(&provider_id).cloned()?;
|
||||||
let provider = self.registry.get(&record.provider)?;
|
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> {
|
pub async fn list_models_info(&self) -> Vec<LlmModelInfo> {
|
||||||
|
|||||||
@@ -588,6 +588,17 @@ impl ApiProvider for DeclaredProvider {
|
|||||||
Ok(Some(self.list_models(record).await?))
|
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> {
|
fn reasoning_mode(&self, model_id: &str, capabilities: &[String]) -> Option<ReasoningMode> {
|
||||||
let spec = self.spec.reasoning.as_ref()?;
|
let spec = self.spec.reasoning.as_ref()?;
|
||||||
let rule = spec
|
let rule = spec
|
||||||
|
|||||||
+6
-2
@@ -190,13 +190,17 @@ providers:
|
|||||||
base_capabilities: [function_calling]
|
base_capabilities: [function_calling]
|
||||||
reasoning:
|
reasoning:
|
||||||
# Flat reasoning_effort (none/minimal/low/medium/high/xhigh/max);
|
# Flat reasoning_effort (none/minimal/low/medium/high/xhigh/max);
|
||||||
# "none" disables reasoning where the model supports it. Models tagged
|
# "none" disables reasoning where the model supports it.
|
||||||
# `reasoning` but not `reasoning_effort` always think — no knob.
|
|
||||||
request: { kind: effort, remap: { disabled: none } }
|
request: { kind: effort, remap: { disabled: none } }
|
||||||
modes:
|
modes:
|
||||||
- when: { capability: reasoning_effort }
|
- when: { capability: reasoning_effort }
|
||||||
values: [disabled, minimal, low, medium, high, xhigh, max]
|
values: [disabled, minimal, low, medium, high, xhigh, max]
|
||||||
default: high
|
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
|
- id: lm_studio
|
||||||
name: "LM Studio"
|
name: "LM Studio"
|
||||||
|
|||||||
Reference in New Issue
Block a user