Skip to content

Commit d73e696

Browse files
author
Kory Boyd
committed
fix(ollama): generate variants for Ollama reasoning models
Allow variants (low/medium/high) to be generated for Ollama models that were previously blocked by the deepseek/minimax/glm/mistral/kimi check in ProviderTransform.variants()
1 parent 034ada2 commit d73e696

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/opencode/src/provider/transform.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,14 @@ export namespace ProviderTransform {
345345
id.includes("kimi") ||
346346
// TODO: Remove this after models.dev data is fixed to use "kimi-k2.5" instead of "k2p5"
347347
id.includes("k2p5")
348-
)
348+
) {
349+
// Skip variants for certain providers that need special handling in options()
350+
// but allow variants for Ollama models since they use @ai-sdk/openai-compatible
351+
if (model.providerID === "ollama") {
352+
return Object.fromEntries(WIDELY_SUPPORTED_EFFORTS.map((effort) => [effort, { reasoningEffort: effort }]))
353+
}
349354
return {}
355+
}
350356

351357
// see: https://docs.x.ai/docs/guides/reasoning#control-how-hard-the-model-thinks
352358
if (id.includes("grok") && id.includes("grok-3-mini")) {

0 commit comments

Comments
 (0)