[feature request] support openrouter presets #998

Closed
opened 2026-02-16 17:29:03 -05:00 by yindo · 2 comments
Owner

Originally created by @michabbb on GitHub (Jul 30, 2025).

so this is of course not working:

"model": "openrouter/@preset/qwen3-235-b-a22-b-thinking-2507"

it would be amazing to use custom presets, at least those that only have one LLM configured.

suggestions for the config file:

"model" : "something"
"presets" : {
   "openrouter" :  [
       {
             "preset":  "openrouter/@preset/qwen3-235-b-a22-b-thinking-2507",
             "maps_to": "huggingface/Qwen/Qwen3-235B-A22B-Thinking-2507"
       }
   ]
}

so the "preset" is the model that is used with the communication with openrouter and "maps_to" is a model known from "models.dev" just so openrouter knows the model specifics.

Originally created by @michabbb on GitHub (Jul 30, 2025). so this is of course not working: ```json "model": "openrouter/@preset/qwen3-235-b-a22-b-thinking-2507" ``` it would be amazing to use custom presets, at least those that only have one LLM configured. suggestions for the config file: ```json "model" : "something" "presets" : { "openrouter" : [ { "preset": "openrouter/@preset/qwen3-235-b-a22-b-thinking-2507", "maps_to": "huggingface/Qwen/Qwen3-235B-A22B-Thinking-2507" } ] } ``` so the "preset" is the model that is used with the communication with openrouter and "maps_to" is a model known from "models.dev" just so openrouter knows the model specifics.
yindo closed this issue 2026-02-16 17:29:03 -05:00
Author
Owner

@michabbb commented on GitHub (Jul 31, 2025):

Image

okay, it's already possible with a custom config i was able to find out 😏

"provider": {
                "coolnewprovider": {
                        "npm": "@ai-sdk/openai-compatible",
                        "options": {
                                "baseURL": "https://openrouter.ai/api/v1",
                                "apiKey": "xxxxxxxxxxxxx"
                        },
                        "models": {
                                "@preset/qwen3-235-b-a22-b-thinking-2507": {}
                        }
                }
        },
@michabbb commented on GitHub (Jul 31, 2025): <img width="618" height="317" alt="Image" src="https://github.com/user-attachments/assets/2b7036fd-4a7b-4fe7-8dd0-299c671afd2b" /> okay, it's already possible with a custom config i was able to find out 😏 ```json "provider": { "coolnewprovider": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://openrouter.ai/api/v1", "apiKey": "xxxxxxxxxxxxx" }, "models": { "@preset/qwen3-235-b-a22-b-thinking-2507": {} } } }, ```
Author
Owner

@segfly commented on GitHub (Dec 31, 2025):

For anyone else stumbling upon this as I did, a slightly simpler solution is to add a preset option to the existing provider models, avoiding duplication:

    "provider": {
        "openrouter": {
            "models": {
                "anthropic/claude-opus-4.5": {
                    "options": {
                        "preset": "@preset/opencode",
                    }
                },
            }
        },    
    }
@segfly commented on GitHub (Dec 31, 2025): For anyone else stumbling upon this as I did, a slightly simpler solution is to add a preset option to the existing provider models, avoiding duplication: ```json "provider": { "openrouter": { "models": { "anthropic/claude-opus-4.5": { "options": { "preset": "@preset/opencode", } }, } }, } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#998