





















@@ -78,12 +78,26 @@ or npm install metadata. Those belong in your plugin code and `package.json`.
7878"modelSupport": {
7979"modelPrefixes": ["router-"]
8080 },
81+"modelIdNormalization": {
82+"providers": {
83+"openrouter": {
84+"prefixWhenBare": "openrouter"
85+ }
86+ }
87+ },
8188"providerEndpoints": [
8289 {
83-"endpointClass": "xai-native",
84-"hosts": ["api.x.ai"]
90+"endpointClass": "openrouter",
91+"hostSuffixes": ["openrouter.ai"]
8592 }
8693 ],
94+"providerRequest": {
95+"providers": {
96+"openrouter": {
97+"family": "openrouter"
98+ }
99+ }
100+ },
87101"cliBackends": ["openrouter-cli"],
88102"syntheticAuthRefs": ["openrouter-cli"],
89103"providerAuthEnvVars": {
@@ -145,7 +159,9 @@ or npm install metadata. Those belong in your plugin code and `package.json`.
145159| `modelSupport` | No | `object` | Manifest-owned shorthand model-family metadata used to auto-load the plugin before runtime. |
146160| `modelCatalog` | No | `object` | Declarative model catalog metadata for providers owned by this plugin. This is the control-plane contract for future read-only listing, onboarding, model pickers, aliases, and suppression without loading plugin runtime. |
147161| `modelPricing` | No | `object` | Provider-owned external pricing lookup policy. Use it to opt local/self-hosted providers out of remote pricing catalogs or map provider refs to OpenRouter/LiteLLM catalog ids without hardcoding provider ids in core. |
162+| `modelIdNormalization` | No | `object` | Provider-owned model-id alias/prefix cleanup that must run before provider runtime loads. |
148163| `providerEndpoints` | No | `object[]` | Manifest-owned endpoint host/baseUrl metadata for provider routes that core must classify before provider runtime loads. |
164+| `providerRequest` | No | `object` | Cheap provider-family and request-compatibility metadata used by generic request policy before provider runtime loads. |
149165| `cliBackends` | No | `string[]` | CLI inference backend ids owned by this plugin. Used for startup auto-activation from explicit config refs. |
150166| `syntheticAuthRefs` | No | `string[]` | Provider or CLI backend refs whose plugin-owned synthetic auth hook should be probed during cold model discovery before runtime loads. |
151167| `nonSecretAuthMarkers` | No | `string[]` | Bundled-plugin-owned placeholder API key values that represent non-secret local, OAuth, or ambient credential state. |
@@ -749,6 +765,87 @@ Do not put runtime-only data in `modelCatalog`. If a provider needs account
749765state, an API request, or local process discovery to know the complete model
750766set, declare that provider as `refreshable` or `runtime` in `discovery`.
751767768+## modelIdNormalization reference
769+770+Use `modelIdNormalization` for cheap provider-owned model-id cleanup that must
771+happen before provider runtime loads. This keeps aliases such as short model
772+names, provider-local legacy ids, and proxy prefix rules in the owning plugin
773+manifest instead of in core model-selection tables.
774+775+```json
776+{
777+"providers": ["anthropic", "openrouter"],
778+"modelIdNormalization": {
779+"providers": {
780+"anthropic": {
781+"aliases": {
782+"sonnet-4.6": "claude-sonnet-4-6"
783+ }
784+ },
785+"openrouter": {
786+"prefixWhenBare": "openrouter"
787+ }
788+ }
789+ }
790+}
791+```
792+793+Provider fields:
794+795+| Field | Type | What it means |
796+| ------------------------------------ | ----------------------- | ----------------------------------------------------------------------------------------- |
797+| `aliases` | `Record<string,string>` | Case-insensitive exact model-id aliases. Values are returned as written. |
798+| `stripPrefixes` | `string[]` | Prefixes to remove before alias lookup, useful for legacy provider/model duplication. |
799+| `prefixWhenBare` | `string` | Prefix to add when the normalized model id does not already contain `/`. |
800+| `prefixWhenBareAfterAliasStartsWith` | `object[]` | Conditional bare-id prefix rules after alias lookup, keyed by `modelPrefix` and `prefix`. |
801+802+## providerEndpoints reference
803+804+Use `providerEndpoints` for endpoint classification that generic request policy
805+must know before provider runtime loads. Core still owns the meaning of each
806+`endpointClass`; plugin manifests own the host and base URL metadata.
807+808+Endpoint fields:
809+810+| Field | Type | What it means |
811+| ------------------------------ | ---------- | ---------------------------------------------------------------------------------------------- |
812+| `endpointClass` | `string` | Known core endpoint class, such as `openrouter`, `moonshot-native`, or `google-vertex`. |
813+| `hosts` | `string[]` | Exact hostnames that map to the endpoint class. |
814+| `hostSuffixes` | `string[]` | Host suffixes that map to the endpoint class. Prefix with `.` for domain suffix-only matching. |
815+| `baseUrls` | `string[]` | Exact normalized HTTP(S) base URLs that map to the endpoint class. |
816+| `googleVertexRegion` | `string` | Static Google Vertex region for exact global hosts. |
817+| `googleVertexRegionHostSuffix` | `string` | Suffix to strip from matching hosts to expose the Google Vertex region prefix. |
818+819+## providerRequest reference
820+821+Use `providerRequest` for cheap request-compatibility metadata that generic
822+request policy needs without loading provider runtime. Keep behavior-specific
823+payload rewriting in provider runtime hooks or shared provider-family helpers.
824+825+```json
826+{
827+"providers": ["vllm"],
828+"providerRequest": {
829+"providers": {
830+"vllm": {
831+"family": "vllm",
832+"openAICompletions": {
833+"supportsStreamingUsage": true
834+ }
835+ }
836+ }
837+ }
838+}
839+```
840+841+Provider fields:
842+843+| Field | Type | What it means |
844+| --------------------- | ------------ | -------------------------------------------------------------------------------------- |
845+| `family` | `string` | Provider family label used by generic request compatibility decisions and diagnostics. |
846+| `compatibilityFamily` | `"moonshot"` | Optional provider-family compatibility bucket for shared request helpers. |
847+| `openAICompletions` | `object` | OpenAI-compatible completions request flags, currently `supportsStreamingUsage`. |
848+752849## modelPricing reference
753850754851Use `modelPricing` when a provider needs control-plane pricing behavior before
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。