Jarvis2345 commited on
Commit
fe987b7
Β·
verified Β·
1 Parent(s): 717a841

deploy(S4): Blender headless pipeline + WebAR client + backend fixes

Browse files
backend/routes/system_routes.py CHANGED
@@ -93,7 +93,12 @@ async def key_diagnostics(probe: bool = False):
93
  parsing. A key can list models fine and still fail to generate (quota
94
  exhausted, model retired, safety block), which an auth ping hides.
95
  """
96
- model = "gemini-3.5-flash"
 
 
 
 
 
97
  url = (f"https://generativelanguage.googleapis.com/v1beta/models/{model}"
98
  f":generateContent?key=" + urllib.parse.quote(key))
99
  body = json.dumps({
 
93
  parsing. A key can list models fine and still fail to generate (quota
94
  exhausted, model retired, safety block), which an auth ping hides.
95
  """
96
+ # Probe whatever the system is ACTUALLY configured to use, so this
97
+ # diagnostic can never drift from production behaviour.
98
+ try:
99
+ from backend.services.token_manager import MODEL as model
100
+ except Exception:
101
+ model = "gemini-3.1-flash-lite"
102
  url = (f"https://generativelanguage.googleapis.com/v1beta/models/{model}"
103
  f":generateContent?key=" + urllib.parse.quote(key))
104
  body = json.dumps({
backend/services/token_manager.py CHANGED
@@ -80,7 +80,18 @@ except Exception as e:
80
  GEMINI_API_KEY = ""
81
 
82
  EXHAUSTED_GOOGLE_KEYS = set()
83
- MODEL = "gemini-3.5-flash"
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  # ─────────────────────────────────────────────────────────────────────────────
86
  # DB Helpers
 
80
  GEMINI_API_KEY = ""
81
 
82
  EXHAUSTED_GOOGLE_KEYS = set()
83
+ # Measured live against a real key, 2026-07-21:
84
+ # gemini-3.5-flash HTTP 503 "currently experiencing high demand" <- was set here
85
+ # gemini-2.0-flash HTTP 429 free-tier request cap
86
+ # gemini-2.5-flash-lite HTTP 404 retired
87
+ # gemini-3-flash-preview OK but 35.5s
88
+ # gemini-3.1-flash-lite OK in 1.1s, correct answer <- chosen
89
+ #
90
+ # The 503 is Google-side capacity, NOT quota consumption: these keys were unused
91
+ # for weeks. Because the primary model always failed, every request fell through
92
+ # to the NVIDIA tier β€” which is why chat worked at all, and why research paid for
93
+ # a doomed Gemini attempt before doing any real work.
94
+ MODEL = "gemini-3.1-flash-lite"
95
 
96
  # ─────────────────────────────────────────────────────────────────────────────
97
  # DB Helpers