offgrid-ai 0.14.1 → 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 +17 -4
package/package.json
CHANGED
package/src/backends.mjs
CHANGED
|
@@ -99,12 +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
|
-
return
|
|
103
|
-
|
|
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 = [];
|
|
109
|
+
for (const model of body.data.filter(isChatOmlxModel)) {
|
|
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);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return deduped
|
|
104
119
|
.map((model) => {
|
|
105
120
|
const info = lookupOmlxModelInfo(model.id, infoMap);
|
|
106
|
-
// If the API ID doesn't already include a publisher (no / or --),
|
|
107
|
-
// prepend the publisher found on disk.
|
|
108
121
|
const hasPublisher = model.id.includes("/") || model.id.includes("--");
|
|
109
122
|
const fullName = (!hasPublisher && info?.publisher) ? `${info.publisher}/${model.id}` : model.id;
|
|
110
123
|
const parsed = parseModelName(fullName, "omlx");
|