dsh-model-params 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/modelsdev.js +21 -8
- package/package.json +1 -1
package/lib/modelsdev.js
CHANGED
|
@@ -110,17 +110,30 @@ export function lookupModels(index, ids, hints = {}) {
|
|
|
110
110
|
const modelId = clean(raw)
|
|
111
111
|
if (!modelId) continue
|
|
112
112
|
const bare = modelId.slice(modelId.lastIndexOf('/') + 1)
|
|
113
|
-
|
|
113
|
+
// Prefer un-prefixed (official vendor) records over gateway mirrors whose
|
|
114
|
+
// catalog keys embed the same prefix ("deepseek/deepseek-v4-flash").
|
|
115
|
+
const seen = new Set()
|
|
116
|
+
const candidates = []
|
|
117
|
+
for (const key of [bare, modelId]) {
|
|
118
|
+
const lower = key.toLowerCase()
|
|
119
|
+
const exact = index.get(lower)
|
|
120
|
+
if (exact) {
|
|
121
|
+
for (const entry of exact) {
|
|
122
|
+
if (!seen.has(entry.providerId)) {
|
|
123
|
+
seen.add(entry.providerId)
|
|
124
|
+
candidates.push(entry)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
114
129
|
const hinted = hintedProviderOf(modelId, bare, hints)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
selected = hintedEntry || exact[0]
|
|
119
|
-
} else if (hinted) {
|
|
130
|
+
const hintedEntry = candidates.find((entry) => entry.providerId === hinted)
|
|
131
|
+
let selected = hintedEntry || candidates[0]
|
|
132
|
+
if (!selected && hinted) {
|
|
120
133
|
// Near match inside the hinted vendor only: versioned ids such as
|
|
121
134
|
// `deepseek-v4-flash-0731` resolve to the family's facts.
|
|
122
|
-
const
|
|
123
|
-
|
|
135
|
+
const near = [...index.values()].flat()
|
|
136
|
+
.filter((entry) => entry.providerId === hinted)
|
|
124
137
|
.filter((entry) => entry.modelId.includes(bare) || bare.includes(entry.modelId))
|
|
125
138
|
.sort((a, b) => a.modelId.length - b.modelId.length)[0]
|
|
126
139
|
selected = near
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-model-params",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "EN: models.dev parameter assistant for the official DeepSeek Harness Models page: per-provider one-click context / max-output / reasoning-effort fill. ZH: 官方模型设置页的 models.dev 参数助手:按 provider 一键补全上下文、max 输出与推理档位。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|