offgrid-ai 0.14.2 → 0.14.3
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 +14 -10
package/package.json
CHANGED
package/src/backends.mjs
CHANGED
|
@@ -99,21 +99,25 @@ 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
|
-
// The oMLX API can return the same model
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
|
|
102
|
+
// The oMLX API can return the same model multiple times with different
|
|
103
|
+
// ID formats (e.g. "Qwen3.6-35B-A3B-OptiQ-4bit" and
|
|
104
|
+
// "mlx-community--Qwen3.6-35B-A3B-OptiQ-4bit"). Deduplicate by the
|
|
105
|
+
// normalized full name (publisher/model), keeping the first entry
|
|
106
|
+
// (which has the most complete metadata from the loaded model).
|
|
107
|
+
const seen = new Set();
|
|
108
|
+
const deduped = [];
|
|
106
109
|
for (const model of body.data.filter(isChatOmlxModel)) {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
const info = lookupOmlxModelInfo(model.id, infoMap);
|
|
111
|
+
const hasPublisher = model.id.includes("/") || model.id.includes("--");
|
|
112
|
+
const fullName = (!hasPublisher && info?.publisher) ? `${info.publisher}/${model.id}` : model.id;
|
|
113
|
+
if (seen.has(fullName)) continue;
|
|
114
|
+
seen.add(fullName);
|
|
115
|
+
deduped.push(model);
|
|
110
116
|
}
|
|
111
117
|
|
|
112
|
-
return
|
|
118
|
+
return deduped
|
|
113
119
|
.map((model) => {
|
|
114
120
|
const info = lookupOmlxModelInfo(model.id, infoMap);
|
|
115
|
-
// If the API ID doesn't already include a publisher (no / or --),
|
|
116
|
-
// prepend the publisher found on disk.
|
|
117
121
|
const hasPublisher = model.id.includes("/") || model.id.includes("--");
|
|
118
122
|
const fullName = (!hasPublisher && info?.publisher) ? `${info.publisher}/${model.id}` : model.id;
|
|
119
123
|
const parsed = parseModelName(fullName, "omlx");
|