Feature: scoped auto model (provider + pattern)
#524
DevGuyRash
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@TUGOhost
The new
automodel selection is great, but right now it picks the newest available model globally. Please add a way to scopeautoby provider/handler and by name pattern so we can target “latest that matches X”.Proposed syntax (back‑compat):
auto:<glob-or-regex>→ newest model whose alias/upstream name matches (e.g.,auto:gpt-5*orauto:/^gpt-5/).auto@<provider>:<pattern>→ restrict to a specific OpenAI‑compat provider name from config (e.g.,auto@openrouter:gpt-5*).auto#<handler>:<pattern>→ restrict to handler type (openai|claude|gemini|codex), e.g.auto#openai:gpt-5-codex.Resolution rules (minimal):
handlerand/orprovider,createddesc (current behavior),auto(to remain backward compatible).Implementation sketch:
ResolveAutoModel()to parse the string form and call a newGetFirstAvailableModelWithFilter(handler string, provider string, match func(string) bool)built on the existing registry/get‑providers helpers.Why: Keeps the simplicity of
autowhile letting users pin to a family (e.g.,gpt-5*) and/or a provider without hardcoding exact model names.refs: initial
autocommit and PR (v6.3.35). (GitHub)(Optional) “better idea” if you want to suggest an alternative
If you’re open to a small API extension (while keeping the string form above), consider supporting an auxiliary selector field that many clients will ignore safely:
{ "model": "auto", "x-router": { "provider": "openrouter", "match": "gpt-5*", "regex": false, "handler": "openai" } }The proxy can read
x-router(orrouter) server‑side without breaking OpenAI‑compatible clients; if absent, fall back to parsingmodelas proposed above. This keeps the model string clean and gives structured knobs for UIs and power users. (The underlying selection still sorts bycreated, same as the currentautoimplementation.) (GitHub)Beta Was this translation helpful? Give feedback.
All reactions