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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/backends.mjs +14 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offgrid-ai",
3
- "version": "0.14.2",
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,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 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();
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 existing = byId.get(model.id);
108
- if (existing && existing.max_model_len) continue; // keep loaded entry
109
- byId.set(model.id, model);
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 Array.from(byId.values())
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");