Skip to content

feat: add model aliases - #11352

Closed
pakerfeldt wants to merge 1 commit into
anomalyco:devfrom
pakerfeldt:model-aliases
Closed

pakerfeldt wants to merge 1 commit into
anomalyco:devfrom
pakerfeldt:model-aliases

Conversation

@pakerfeldt

@pakerfeldt pakerfeldt commented Jan 30, 2026 •

Copy link
Copy Markdown

Closes #3439

This is my first PR to OpenCode. I've done my best to follow the contributing guidelines and code style, but I fully expect maintainers may want adjustments to the code, documentation, or both. Happy to iterate based on feedback.

Summary

Adds model_aliases config option to map short names to provider/model strings. Aliases work anywhere a model ID is accepted.
Example

{
  model_aliases: {
    cheap: anthropic/claude-3-haiku,
    acme/reasoning: openai/gpt-5
  },
  model: cheap
}

One concern: I introduced an async resolveModel() function (since it needs config access). Most call sites were already async, but I'd appreciate a sanity check that this doesn't cause issues I'm not aware of.

Verification

  • Added 12 unit tests for resolveAlias() and resolveModel()
  • Tested manually

Add model_aliases config option to map short names to provider/model
strings. Aliases can be used anywhere a model ID is accepted, enabling
team workflows where shared agents reference aliases that each developer
resolves in their personal config.
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@pakerfeldt pakerfeldt changed the title feat: add global model aliases feat: add model aliases Jan 31, 2026
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Apr 1, 2026
@pakerfeldt
pakerfeldt deleted the model-aliases branch April 1, 2026 06:49
@renaudcerrato renaudcerrato mentioned this pull request Sep 1, 2026
1 task done
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.

[FEATURE]: custom model aliases

1 participant