superbrain-server 1.0.43 → 1.0.44

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superbrain-server",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "1-Line Auto-Installer and Server Execution wrapper for SuperBrain",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "groq_gpt_oss_20b": {
3
3
  "key": "groq_gpt_oss_20b",
4
- "avg_response_s": 1.5378954618382221,
5
- "success_count": 71,
4
+ "avg_response_s": 1.3695804152320605,
5
+ "success_count": 75,
6
6
  "fail_count": 6,
7
7
  "down_until": null,
8
- "last_used": "2026-04-09T12:10:09.765726",
8
+ "last_used": "2026-04-09T17:22:29.473141",
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": 0,
177
- "down_until": null,
176
+ "fail_count": 1,
177
+ "down_until": "2026-04-09T17:58:36.014066",
178
178
  "last_used": null,
179
- "last_error": null,
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": 0,
187
- "down_until": null,
186
+ "fail_count": 1,
187
+ "down_until": "2026-04-09T17:33:36.707801",
188
188
  "last_used": null,
189
- "last_error": null,
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": 0,
197
- "down_until": null,
196
+ "fail_count": 1,
197
+ "down_until": "2026-04-09T17:33:37.048296",
198
198
  "last_used": null,
199
- "last_error": null,
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": 0,
207
- "down_until": null,
206
+ "fail_count": 1,
207
+ "down_until": "2026-04-09T17:58:37.929800",
208
208
  "last_used": null,
209
- "last_error": null,
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": null,
215
- "success_count": 0,
214
+ "avg_response_s": 2.2982780933380127,
215
+ "success_count": 1,
216
216
  "fail_count": 0,
217
217
  "down_until": null,
218
- "last_used": null,
218
+ "last_used": "2026-04-09T17:28:40.228078",
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": 21,
327
- "down_until": "2026-04-09T12:14:58.761896",
326
+ "fail_count": 23,
327
+ "down_until": "2026-04-09T17:27:18.288352",
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": 24,
337
- "down_until": "2026-04-09T12:14:58.758850",
336
+ "fail_count": 26,
337
+ "down_until": "2026-04-09T17:27:18.284460",
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": 23,
357
- "down_until": "2026-04-09T12:14:58.760897",
356
+ "fail_count": 25,
357
+ "down_until": "2026-04-09T17:27:18.287968",
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": 22,
367
- "down_until": "2026-04-09T12:14:58.762895",
366
+ "fail_count": 24,
367
+ "down_until": "2026-04-09T17:27:18.288352",
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": 21,
377
- "down_until": "2026-04-09T12:14:58.764895",
376
+ "fail_count": 23,
377
+ "down_until": "2026-04-09T17:27:18.288352",
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": 21,
387
- "down_until": "2026-04-09T12:14:58.765718",
386
+ "fail_count": 23,
387
+ "down_until": "2026-04-09T17:27:18.288352",
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": 21,
397
- "down_until": "2026-04-09T12:14:58.765718",
396
+ "fail_count": 23,
397
+ "down_until": "2026-04-09T17:27:18.288352",
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.7195895721505887,
405
- "success_count": 46,
404
+ "avg_response_s": 1.7122235645153911,
405
+ "success_count": 50,
406
406
  "fail_count": 5,
407
407
  "down_until": null,
408
- "last_used": "2026-04-09T12:10:03.943317",
408
+ "last_used": "2026-04-09T17:22:22.089868",
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
- raise RateLimitError("Quota limit hit")
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
- if "429" in str(e) or "quota" in str(e).lower():
1107
- raise RateLimitError("Quota limit hit")
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
- if "429" in str(e) or "quota" in str(e).lower():
1153
- raise RateLimitError("Quota limit hit")
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)
@@ -0,0 +1,12 @@
1
+ import os, sys
2
+ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
3
+ from core.model_router import get_router
4
+ router = get_router()
5
+ try:
6
+ router._api_keys['GROQ_API_KEY'] = None
7
+ router._api_keys['GEMINI_API_KEY'] = None
8
+ print('Testing OpenRouter...')
9
+ response = router.generate_text('Say exactly: OpenRouter is working!')
10
+ print('Response:', response)
11
+ except Exception as e:
12
+ print('Error:', e)