superbrain-server 1.0.43 → 1.0.45
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/payload/config/model_rankings.json +35 -35
- package/payload/core/model_router.py +13 -8
- package/payload/start.py +12 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"groq_gpt_oss_20b": {
|
|
3
3
|
"key": "groq_gpt_oss_20b",
|
|
4
|
-
"avg_response_s": 1.
|
|
5
|
-
"success_count":
|
|
4
|
+
"avg_response_s": 1.3635670783103586,
|
|
5
|
+
"success_count": 77,
|
|
6
6
|
"fail_count": 6,
|
|
7
7
|
"down_until": null,
|
|
8
|
-
"last_used": "2026-04-
|
|
8
|
+
"last_used": "2026-04-09T17:35:12.529719",
|
|
9
9
|
"last_error": null,
|
|
10
10
|
"base_priority": 0.5
|
|
11
11
|
},
|
|
@@ -173,49 +173,49 @@
|
|
|
173
173
|
"key": "openrouter_llama33_70b",
|
|
174
174
|
"avg_response_s": null,
|
|
175
175
|
"success_count": 0,
|
|
176
|
-
"fail_count":
|
|
177
|
-
"down_until":
|
|
176
|
+
"fail_count": 1,
|
|
177
|
+
"down_until": "2026-04-09T17:58:36.014066",
|
|
178
178
|
"last_used": null,
|
|
179
|
-
"last_error":
|
|
179
|
+
"last_error": "429 rate limit: {\"error\":{\"message\":\"Provider returned error\",\"code\":429,\"metadata\":{\"raw\":\"meta-llama/llama-3.3-70b-instruct:free is temporarily rate-limited upstream. Please retry shortly, or add yo",
|
|
180
180
|
"base_priority": 7
|
|
181
181
|
},
|
|
182
182
|
"openrouter_deepseek_r1_0528": {
|
|
183
183
|
"key": "openrouter_deepseek_r1_0528",
|
|
184
184
|
"avg_response_s": null,
|
|
185
185
|
"success_count": 0,
|
|
186
|
-
"fail_count":
|
|
187
|
-
"down_until":
|
|
186
|
+
"fail_count": 2,
|
|
187
|
+
"down_until": "2026-04-09T17:42:02.945931",
|
|
188
188
|
"last_used": null,
|
|
189
|
-
"last_error":
|
|
189
|
+
"last_error": "404 Client Error: Not Found for url: https://openrouter.ai/api/v1/chat/completions",
|
|
190
190
|
"base_priority": 7.5
|
|
191
191
|
},
|
|
192
192
|
"openrouter_qwen3_235b": {
|
|
193
193
|
"key": "openrouter_qwen3_235b",
|
|
194
194
|
"avg_response_s": null,
|
|
195
195
|
"success_count": 0,
|
|
196
|
-
"fail_count":
|
|
197
|
-
"down_until":
|
|
196
|
+
"fail_count": 2,
|
|
197
|
+
"down_until": "2026-04-09T17:42:03.575625",
|
|
198
198
|
"last_used": null,
|
|
199
|
-
"last_error":
|
|
199
|
+
"last_error": "404 Client Error: Not Found for url: https://openrouter.ai/api/v1/chat/completions",
|
|
200
200
|
"base_priority": 8
|
|
201
201
|
},
|
|
202
202
|
"openrouter_hermes3_405b": {
|
|
203
203
|
"key": "openrouter_hermes3_405b",
|
|
204
204
|
"avg_response_s": null,
|
|
205
205
|
"success_count": 0,
|
|
206
|
-
"fail_count":
|
|
207
|
-
"down_until":
|
|
206
|
+
"fail_count": 1,
|
|
207
|
+
"down_until": "2026-04-09T17:58:37.929800",
|
|
208
208
|
"last_used": null,
|
|
209
|
-
"last_error":
|
|
209
|
+
"last_error": "429 rate limit: {\"error\":{\"message\":\"Provider returned error\",\"code\":429,\"metadata\":{\"raw\":\"nousresearch/hermes-3-llama-3.1-405b:free is temporarily rate-limited upstream. Please retry shortly, or add",
|
|
210
210
|
"base_priority": 8.5
|
|
211
211
|
},
|
|
212
212
|
"openrouter_gpt_oss_120b": {
|
|
213
213
|
"key": "openrouter_gpt_oss_120b",
|
|
214
|
-
"avg_response_s":
|
|
215
|
-
"success_count":
|
|
214
|
+
"avg_response_s": 3.9147901058197023,
|
|
215
|
+
"success_count": 2,
|
|
216
216
|
"fail_count": 0,
|
|
217
217
|
"down_until": null,
|
|
218
|
-
"last_used":
|
|
218
|
+
"last_used": "2026-04-09T17:37:11.262276",
|
|
219
219
|
"last_error": null,
|
|
220
220
|
"base_priority": 9
|
|
221
221
|
},
|
|
@@ -323,8 +323,8 @@
|
|
|
323
323
|
"key": "gemini_25_flash_lite_vision",
|
|
324
324
|
"avg_response_s": 6.709401964075168,
|
|
325
325
|
"success_count": 14,
|
|
326
|
-
"fail_count":
|
|
327
|
-
"down_until": "2026-04-
|
|
326
|
+
"fail_count": 24,
|
|
327
|
+
"down_until": "2026-04-09T17:40:03.986631",
|
|
328
328
|
"last_used": "2026-02-24T09:45:09.831171",
|
|
329
329
|
"last_error": "No module named 'google.generativeai'",
|
|
330
330
|
"base_priority": 1.5
|
|
@@ -333,8 +333,8 @@
|
|
|
333
333
|
"key": "gemini_25_pro_vision",
|
|
334
334
|
"avg_response_s": null,
|
|
335
335
|
"success_count": 0,
|
|
336
|
-
"fail_count":
|
|
337
|
-
"down_until": "2026-04-
|
|
336
|
+
"fail_count": 27,
|
|
337
|
+
"down_until": "2026-04-09T17:40:03.984360",
|
|
338
338
|
"last_used": null,
|
|
339
339
|
"last_error": "No module named 'google.generativeai'",
|
|
340
340
|
"base_priority": 2
|
|
@@ -353,8 +353,8 @@
|
|
|
353
353
|
"key": "gemini_3_pro_vision",
|
|
354
354
|
"avg_response_s": null,
|
|
355
355
|
"success_count": 0,
|
|
356
|
-
"fail_count":
|
|
357
|
-
"down_until": "2026-04-
|
|
356
|
+
"fail_count": 26,
|
|
357
|
+
"down_until": "2026-04-09T17:40:03.984360",
|
|
358
358
|
"last_used": null,
|
|
359
359
|
"last_error": "No module named 'google.generativeai'",
|
|
360
360
|
"base_priority": 3
|
|
@@ -363,8 +363,8 @@
|
|
|
363
363
|
"key": "gemini_31_pro_vision",
|
|
364
364
|
"avg_response_s": null,
|
|
365
365
|
"success_count": 0,
|
|
366
|
-
"fail_count":
|
|
367
|
-
"down_until": "2026-04-
|
|
366
|
+
"fail_count": 25,
|
|
367
|
+
"down_until": "2026-04-09T17:40:03.987716",
|
|
368
368
|
"last_used": null,
|
|
369
369
|
"last_error": "No module named 'google.generativeai'",
|
|
370
370
|
"base_priority": 3.5
|
|
@@ -373,8 +373,8 @@
|
|
|
373
373
|
"key": "gemini_20_flash_vision",
|
|
374
374
|
"avg_response_s": null,
|
|
375
375
|
"success_count": 0,
|
|
376
|
-
"fail_count":
|
|
377
|
-
"down_until": "2026-04-
|
|
376
|
+
"fail_count": 24,
|
|
377
|
+
"down_until": "2026-04-09T17:40:03.987716",
|
|
378
378
|
"last_used": null,
|
|
379
379
|
"last_error": "No module named 'google.generativeai'",
|
|
380
380
|
"base_priority": 4
|
|
@@ -383,8 +383,8 @@
|
|
|
383
383
|
"key": "gemini_20_flash_lite_vision",
|
|
384
384
|
"avg_response_s": null,
|
|
385
385
|
"success_count": 0,
|
|
386
|
-
"fail_count":
|
|
387
|
-
"down_until": "2026-04-
|
|
386
|
+
"fail_count": 24,
|
|
387
|
+
"down_until": "2026-04-09T17:40:03.987716",
|
|
388
388
|
"last_used": null,
|
|
389
389
|
"last_error": "No module named 'google.generativeai'",
|
|
390
390
|
"base_priority": 4.5
|
|
@@ -393,19 +393,19 @@
|
|
|
393
393
|
"key": "gemini_15_flash_vision",
|
|
394
394
|
"avg_response_s": null,
|
|
395
395
|
"success_count": 0,
|
|
396
|
-
"fail_count":
|
|
397
|
-
"down_until": "2026-04-
|
|
396
|
+
"fail_count": 24,
|
|
397
|
+
"down_until": "2026-04-09T17:40:03.987716",
|
|
398
398
|
"last_used": null,
|
|
399
399
|
"last_error": "No module named 'google.generativeai'",
|
|
400
400
|
"base_priority": 4.8
|
|
401
401
|
},
|
|
402
402
|
"groq_llama4_scout_vision": {
|
|
403
403
|
"key": "groq_llama4_scout_vision",
|
|
404
|
-
"avg_response_s": 1.
|
|
405
|
-
"success_count":
|
|
404
|
+
"avg_response_s": 1.5534682586944504,
|
|
405
|
+
"success_count": 52,
|
|
406
406
|
"fail_count": 5,
|
|
407
407
|
"down_until": null,
|
|
408
|
-
"last_used": "2026-04-
|
|
408
|
+
"last_used": "2026-04-09T17:35:07.357177",
|
|
409
409
|
"last_error": null,
|
|
410
410
|
"base_priority": 5
|
|
411
411
|
},
|
|
@@ -489,6 +489,9 @@ def _has_image_input(m: Dict) -> bool:
|
|
|
489
489
|
return "image" in str(mods)
|
|
490
490
|
|
|
491
491
|
|
|
492
|
+
class RateLimitError(Exception):
|
|
493
|
+
pass
|
|
494
|
+
|
|
492
495
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
493
496
|
# MODEL ROUTER
|
|
494
497
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -707,10 +710,10 @@ class ModelRouter:
|
|
|
707
710
|
resp.raise_for_status()
|
|
708
711
|
all_models = resp.json().get("data", [])
|
|
709
712
|
except Exception as e:
|
|
710
|
-
if "429" in str(e) or "quota" in str(e).lower():
|
|
711
|
-
|
|
712
|
-
raise e
|
|
713
|
-
print(f"⚠️ OpenRouter model discovery failed: {e}")
|
|
713
|
+
# if "429" in str(e) or "quota" in str(e).lower():
|
|
714
|
+
# raise RateLimitError("Quota limit hit")
|
|
715
|
+
# raise e
|
|
716
|
+
print(f"⚠️ OpenRouter free model discovery failed: {e}")
|
|
714
717
|
return
|
|
715
718
|
|
|
716
719
|
# Filter for free models (pricing.prompt == 0 or :free suffix)
|
|
@@ -1103,8 +1106,9 @@ class ModelRouter:
|
|
|
1103
1106
|
return result
|
|
1104
1107
|
|
|
1105
1108
|
except Exception as e:
|
|
1106
|
-
|
|
1107
|
-
|
|
1109
|
+
# Do not immediately abort on quota, try next model
|
|
1110
|
+
# if "429" in str(e) or "quota" in str(e).lower():
|
|
1111
|
+
# raise RateLimitError("Quota limit hit")
|
|
1108
1112
|
status = 429 if "429" in str(e) else 0
|
|
1109
1113
|
self._record_failure(key, str(e), status_code=status)
|
|
1110
1114
|
print(f" ✗ Failed ({type(e).__name__}), trying next …", flush=True)
|
|
@@ -1149,8 +1153,9 @@ class ModelRouter:
|
|
|
1149
1153
|
return result
|
|
1150
1154
|
|
|
1151
1155
|
except Exception as e:
|
|
1152
|
-
|
|
1153
|
-
|
|
1156
|
+
# Do not immediately abort on quota, try next model
|
|
1157
|
+
# if "429" in str(e) or "quota" in str(e).lower():
|
|
1158
|
+
# raise RateLimitError("Quota limit hit")
|
|
1154
1159
|
status = 429 if "429" in str(e) else 0
|
|
1155
1160
|
self._record_failure(key, str(e), status_code=status)
|
|
1156
1161
|
print(f" ✗ Failed ({type(e).__name__}), trying next …", flush=True)
|
package/payload/start.py
CHANGED
|
@@ -410,6 +410,12 @@ OLLAMA_MODEL = "qwen3-vl:4b" # vision-language model, fits ~6 GB VRAM / ~8 GB
|
|
|
410
410
|
def setup_ollama():
|
|
411
411
|
h1("Step 4 of 7 — Offline AI Model (Ollama)")
|
|
412
412
|
|
|
413
|
+
machine = platform.machine().lower()
|
|
414
|
+
is_arm = any(arch in machine for arch in ["arm", "aarch64"])
|
|
415
|
+
if is_arm:
|
|
416
|
+
info(f"ARM device detected ({machine}) — skipping Ollama local installation (heavy resource/unsupported).")
|
|
417
|
+
return
|
|
418
|
+
|
|
413
419
|
keys = _load_saved_api_keys()
|
|
414
420
|
has_cloud_key = any(keys.get(k) for k in ("GEMINI_API_KEY", "GROQ_API_KEY", "OPENROUTER_API_KEY"))
|
|
415
421
|
|
|
@@ -547,6 +553,12 @@ WHISPER_MODELS = {
|
|
|
547
553
|
def setup_whisper():
|
|
548
554
|
h1("Step 5 of 7 — Offline Audio Transcription (Whisper)")
|
|
549
555
|
|
|
556
|
+
machine = platform.machine().lower()
|
|
557
|
+
is_arm = any(arch in machine for arch in ["arm", "aarch64"])
|
|
558
|
+
if is_arm:
|
|
559
|
+
info(f"ARM device detected ({machine}) — skipping local Whisper installation to prevent wheel build failures.")
|
|
560
|
+
return
|
|
561
|
+
|
|
550
562
|
keys = _load_saved_api_keys()
|
|
551
563
|
has_groq_key = bool(keys.get("GROQ_API_KEY") or os.getenv("GROQ_API_KEY"))
|
|
552
564
|
|