offgrid-ai 0.14.1 → 0.14.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/package.json +1 -1
- package/src/backends.mjs +11 -2
package/package.json
CHANGED
package/src/backends.mjs
CHANGED
|
@@ -99,8 +99,17 @@ async function scanOmlxModels() {
|
|
|
99
99
|
// The oMLX API doesn't return model sizes or publishers — look them up from disk.
|
|
100
100
|
const infoMap = await scanOmlxModelSizes();
|
|
101
101
|
|
|
102
|
-
return
|
|
103
|
-
|
|
102
|
+
// The oMLX API can return the same model twice — once loaded (with
|
|
103
|
+
// max_model_len) and once available (without). Deduplicate by ID,
|
|
104
|
+
// keeping the entry with context window info.
|
|
105
|
+
const byId = new Map();
|
|
106
|
+
for (const model of body.data.filter(isChatOmlxModel)) {
|
|
107
|
+
const existing = byId.get(model.id);
|
|
108
|
+
if (existing && existing.max_model_len) continue; // keep loaded entry
|
|
109
|
+
byId.set(model.id, model);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return Array.from(byId.values())
|
|
104
113
|
.map((model) => {
|
|
105
114
|
const info = lookupOmlxModelInfo(model.id, infoMap);
|
|
106
115
|
// If the API ID doesn't already include a publisher (no / or --),
|