Skip to content

feat(litellm): expose dynamic reasoning effort variants in OpenCode provider - #3217

Merged
1Solon merged 2 commits into
mainfrom
feat/opencode-reasoning-variants
Dec 4, 2026
Merged

1Solon merged 2 commits into
mainfrom
feat/opencode-reasoning-variants

Conversation

@1Solon

@1Solon 1Solon commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Populate variants dynamically in litellm-opencode-provider's /config.json so OpenCode doesn't fall back to the default low/medium/high trio for @ai-sdk/openai-compatible models.
  • Spark models: read reasoning.supported_efforts from the Sparks' /v1/models (exposing minimal, low, medium, high, xhigh, max for inkling-2-small).
  • LiteLLM/cloud models: read LiteLLM /model/info effort metadata (reasoning_effort_levels and supports_*_reasoning_effort flags), exposing low, medium, high, xhigh, max for Claude 5.5 models.

Verification

  • Tested build_models() against live Spark /v1/models and LiteLLM /model/info.
  • Loaded the generated config in opencode --standalone and confirmed /api/model registers all expected variants (minimal..max on inkling-2-small, low..max on Claude 5.5) with matching reasoningEffort settings.
  • Validated kubectl kustomize kubernetes/ai/litellm/app/opencode-provider.

@milton-mla

milton-mla Bot commented Dec 4, 2026

Copy link
Copy Markdown

No release notes - no sign of a migration

Self-authored feature change (not an upstream version bump), branch feat/opencode-reasoning-variants -> main, 1 file changed (+67/-2).

This is a new-feature update to the in-repo litellm-opencode-provider:

  • build_models() now populates OpenCode variants dynamically in /config.json instead of relying on the default low/medium/high trio for @ai-sdk/openai-compatible models.
  • Spark models read reasoning.supported_efforts from the Sparks' /v1/models (e.g. minimal..max for inkling-2-small).
  • LiteLLM/cloud models read /model/info metadata (reasoning_effort_levels and supports_*_reasoning_effort flags), exposing low..max for Claude 5.5 models.
  • New get_reasoning_efforts() helper orders efforts low-to-high, dedupes, and treats effort metadata as empty when reasoning is false; only emits an explicit list when extra tiers beyond the default trio are supported.
  • Verification per PR body: tested build_models() against live Spark /v1/models and LiteLLM /model/info, loaded the generated config in opencode --standalone, and validated kubectl kustomize kubernetes/ai/litellm/app/opencode-provider.

No migration or manual upgrade step is evident: the change is additive (populates variants in a generated config), touches no database, no config schema, and renames or removes nothing. That's my reading of the diff, not an upstream statement. If anything, apply via the normal Flux sync and confirm OpenCode picks up the new variants; restart the opencode-provider pod if it caches /config.json.

Sources: PR body, diff

@1Solon
1Solon merged commit 00510b7 into main Dec 4, 2026
3 checks passed
@1Solon
1Solon deleted the feat/opencode-reasoning-variants branch December 4, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant