Skip to content

Support provider extensions with model aliases and improve search #5916

Description

@mindplay-dk

What happened?

Since there's no UI to configure OpenRouter providers, I configured models.json with an override:

{
  "providers": {
    "openrouter": {
      "apiKey": "sk-or-v1-63139...",
      "modelOverrides": {
        "minimax/minimax-m3": {
          "name": "MiniMax M3 [rasmus@openrouter, parasail]",
          "compat": {
            "openRouterRouting": {
              "only": ["parasail/fp8"],
              "allow_fallbacks": false
            }
          }
        },
        "deepseek/deepseek-v4-flash": {
          "name": "DeepSeek V4 Flash [rasmus@openrouter, baidu|gmicloud]",
          "compat": {
            "openRouterRouting": {
              "only": ["baidu/fp8", "gmicloud/fp8"],
              "allow_fallbacks": false
            }
          }
        }
      }
    }
  }
}

I just want to choose my providers on OpenRouter - and I want "proof" that it's working, so I'm overriding the name.

Unfortunately, this has no effect on search - so you can see:

Image

It does have the name override, so at least I have proof the config is working.

However:

Image

It does not seem to query the name? I can't find or keep track of my overrides.

I don't even know why any results come up at all? surely none of these have "rasmus" in the name. 😅

Could we either:

  1. just make the search work for names (why doesn't it?)
    1.b. display the names on the list (why do we have names that aren't displayed?)
  2. allow an id override, so we can change the ID that's actually visible on the list

I guess, ideally, I think the built-in providers should actually provide configuration UI? Since apparently it is very difficult to find documentation for the right keys/values to put in openrouter configuration.

I also tried adding a new openrouter provider, but neither Pi or I could find any way to make it respect the thinking option in Pi - it even plowed through the source code, and eventually concluded it couldn't make this work reliable with a custom provider.

So one other approach to consider: what if we could extend existing providers? Like an extends key for custom providers - which would make it work just like modelOverrides, but effectively creating a new provider in the listing rather than overriding. This would solve the search problem, and at the same time would give you easier and more reliable custom providers without needing to figure out how to replicate what Pi does internally.

It would probably fit the use case of "I just want to specify allowed providers on OpenRouter" better? Or really any scenario where you want to configure something without replacing the built-in options.

Steps to reproduce

🙂

Expected behavior

No response

Version

0.79.8

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginprogressIssue is being worked on

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions