fix: Add pony-alpha model and fix model lookup for prefixed model IDs
- Add openrouter/pony-alpha model to models-api.json fixture - Fix getModel() to lookup models with provider prefix (e.g., openrouter/pony-alpha) When user specifies openrouter/pony-alpha, the code now correctly looks for the full model ID including prefix in the provider's models object This fixes the 'ModelNotFoundError' when using OpenRouter models that have prefixed IDs in the database.
This commit is contained in:
@@ -1200,7 +1200,11 @@ export namespace Provider {
|
||||
throw new ModelNotFoundError({ providerID, modelID, suggestions })
|
||||
}
|
||||
|
||||
const info = provider.models[modelID]
|
||||
let info = provider.models[modelID]
|
||||
// Try with provider prefix if not found (e.g., "openrouter/pony-alpha")
|
||||
if (!info && !modelID.includes("/")) {
|
||||
info = provider.models[`${providerID}/${modelID}`]
|
||||
}
|
||||
if (!info) {
|
||||
const availableModels = Object.keys(provider.models)
|
||||
const matches = fuzzysort.go(modelID, availableModels, { limit: 3, threshold: -10000 })
|
||||
|
||||
@@ -27310,6 +27310,23 @@
|
||||
"cost": { "input": 0, "output": 0 },
|
||||
"limit": { "context": 1840000, "output": 0 }
|
||||
},
|
||||
"openrouter/pony-alpha": {
|
||||
"id": "openrouter/pony-alpha",
|
||||
"name": "Stealth",
|
||||
"family": "pony",
|
||||
"attachment": false,
|
||||
"reasoning": true,
|
||||
"tool_call": true,
|
||||
"structured_output": true,
|
||||
"temperature": true,
|
||||
"release_date": "2026-02-06",
|
||||
"last_updated": "2026-02-06",
|
||||
"modalities": { "input": ["text"], "output": ["text"] },
|
||||
"open_weights": false,
|
||||
"cost": { "input": 0, "output": 0 },
|
||||
"limit": { "context": 200000, "output": 131000 },
|
||||
"status": "alpha"
|
||||
},
|
||||
"z-ai/glm-4.7": {
|
||||
"id": "z-ai/glm-4.7",
|
||||
"name": "GLM-4.7",
|
||||
|
||||
Reference in New Issue
Block a user