feat(plugin): surface reasoning-effort variants from /v1/model/info reported by LiteLLM - #14
Conversation
…eported by LiteLLM Read per-model reasoning effort support from LiteLLM's /v1/model/info and expose each supported level as an OpenCode variant with reasoningEffort set.
📝 WalkthroughWalkthroughThe plugin now fetches LiteLLM model metadata, detects supported reasoning-effort levels, and exposes corresponding OpenCode model variants with ChangesReasoning-effort model variants
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ModelDiscovery
participant LiteLLM
participant ModelConverter
participant OpenCodeConfig
ModelDiscovery->>LiteLLM: Fetch model list and /v1/model/info
LiteLLM-->>ModelDiscovery: Return models and optional metadata
ModelDiscovery->>ModelConverter: Pass matched model metadata
ModelConverter->>OpenCodeConfig: Create reasoning-effort variants
Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Warning |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/plugin/discover.ts`:
- Around line 193-194: Update the model construction flow around buildModelV2 to
merge the /v1/model/info metadata from infoByName into each /v1/models record
before building it, using the same field-precedence merge established in
src/plugin/index.ts. Pass the merged model so capabilities, limits, mode, and
reasoning-effort flags are reflected correctly while preserving the existing
resolvedApi, perModelApi, and model identity inputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4b9ed210-d541-48f2-b86c-23a5932ef8e0
📒 Files selected for processing (7)
CHANGELOG.mdREADME.mdsrc/plugin/build-model.tssrc/plugin/discover.tssrc/plugin/index.tssrc/types/index.tssrc/utils/litellm-api.ts
# [0.8.0](v0.7.1...v0.8.0) (2026-08-04) ### Features * **plugin:** surface reasoning-effort variants from /v1/model/info reported by LiteLLM ([#14](#14)) ([34db713](34db713))
Summary
Read per-model reasoning effort support from LiteLLM's /v1/model/info and expose each supported level as an OpenCode variant with reasoningEffort set.
Type of change
Checklist
npm run typecheckpassesCHANGELOG.mdupdated under## [Unreleased]How was this tested?
I tested a model that had other variants that didn't include OpenCode by default, and with this change, it now reads them correctly.
Screenshots / logs (optional)
Summary by CodeRabbit
New Features
Documentation