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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/backends.mjs +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "offgrid-ai",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
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,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 body.data
103
- .filter((model) => isChatOmlxModel(model))
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 --),