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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/backends.mjs +17 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offgrid-ai",
3
- "version": "0.14.1",
3
+ "version": "0.14.3",
4
4
  "description": "Privacy-first CLI for running local LLMs — discover, configure, run, benchmark",
5
5
  "author": "Eeshan Srivastava (https://eeshans.com)",
6
6
  "type": "module",
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 body.data
103
- .filter((model) => isChatOmlxModel(model))
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");