[PR #12779] feat: add use_models_dev for model inheritance from models.dev #14368

Closed
opened 2026-02-16 18:19:10 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12779

State: closed
Merged: No


What does this PR do?

Add ability for custom models to inherit metadata from models.dev using the use_models_dev field with 'provider/model' format.

Changes:

  • Extract mergeModel() helper with variadic merge function for cleaner priority-based field resolution (explicit > inherited > existing > defaults)
  • Add comprehensive tests for inheritance and invalid reference handling

Models can now inherit base properties from models.dev while overriding specific fields:
{ use_models_dev: 'anthropic/claude-sonnet-4-20250514', limit: {...} }

This address and fixes #9311

How did you verify your code works?

  1. Added appropriate CI tests
  2. Performed local manual tests with overrides and use_models_dev and confirmed that inherited options (like variants, context size, etc) were respected despite not being explicitly defined.
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12779 **State:** closed **Merged:** No --- ### What does this PR do? Add ability for custom models to inherit metadata from models.dev using the use_models_dev field with 'provider/model' format. Changes: - Extract mergeModel() helper with variadic merge function for cleaner priority-based field resolution (explicit > inherited > existing > defaults) - Add comprehensive tests for inheritance and invalid reference handling Models can now inherit base properties from models.dev while overriding specific fields: `{ use_models_dev: 'anthropic/claude-sonnet-4-20250514', limit: {...} }` This address and fixes #9311 ### How did you verify your code works? 1. Added appropriate CI tests 2. Performed local manual tests with overrides and `use_models_dev` and confirmed that inherited options (like variants, context size, etc) were respected despite not being explicitly defined.
yindo added the pull-request label 2026-02-16 18:19:10 -05:00
yindo closed this issue 2026-02-16 18:19:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14368