betterwithage commited on
Commit
322c7d9
·
verified ·
1 Parent(s): b58ef1e

chore(sync): mirror backend .py + Dockerfile to Space (hf-sync-backend)

Browse files

Automated backend sync from szl-holdings/a11oy main via hf-sync-backend.
Updated (differed from the Space): a11oy_deva_feeds.py, szl3d_holographic.py
Deleted (gone from the repo + Dockerfile COPY set): (none)

Keeps the Space-built backend (serve.py + the Dockerfile-COPY'd .py
modules) identical to GitHub main so the Space never rebuilds from a
stale backend, new endpoints don't 404 there, and orphaned modules
removed from the repo don't linger in the Space tree.

Files changed (2) hide show
  1. a11oy_deva_feeds.py +57 -0
  2. szl3d_holographic.py +2 -0
a11oy_deva_feeds.py CHANGED
@@ -236,6 +236,57 @@ def feed_polymarket(limit: int = 16) -> dict[str, Any]:
236
  return _cached_fetch("polymarket", url, ttl=60, parser=parse)
237
 
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  def feed_nvd_fintech(limit: int = 16) -> dict[str, Any]:
240
  url = ("https://services.nvd.nist.gov/rest/json/cves/2.0?keywordSearch=financial"
241
  "&resultsPerPage=" + str(limit))
@@ -414,6 +465,12 @@ def register(app: FastAPI, ns: str = "a11oy") -> dict[str, Any]:
414
  cve = feed_nvd_fintech(limit)
415
  return JSONResponse({"tab": "risk", "fintech_cve": cve, "doctrine": DOCTRINE})
416
 
 
 
 
 
 
 
417
  # ---------- REAL ESTATE ----------
418
  @app.get(base + "/re/pulse", include_in_schema=False)
419
  async def _re_pulse():
 
236
  return _cached_fetch("polymarket", url, ttl=60, parser=parse)
237
 
238
 
239
+ def feed_openrouter_models(limit: int = 24) -> dict[str, Any]:
240
+ """FRONTIER — live public OpenRouter model catalog (keyless /api/v1/models).
241
+
242
+ Returns the widest-context models plus per-lab rollups (count, max context
243
+ window, count of free-priced models). 100% MEASURED — the catalog's own
244
+ published context windows and prices; no invented benchmark or ranking.
245
+ """
246
+ url = "https://openrouter.ai/api/v1/models"
247
+
248
+ def parse(d):
249
+ arr = d.get("data") if isinstance(d, dict) else (d if isinstance(d, list) else [])
250
+
251
+ def _flt(x):
252
+ try:
253
+ return float(x)
254
+ except Exception:
255
+ return 0.0
256
+
257
+ models = []
258
+ for m in (arr or []):
259
+ mid = m.get("id") or ""
260
+ lab = mid.split("/")[0] if "/" in mid else (mid or "other")
261
+ tp = m.get("top_provider") or {}
262
+ ctx = m.get("context_length") or tp.get("context_length") or 0
263
+ pr = m.get("pricing") or {}
264
+ arch = m.get("architecture") or {}
265
+ models.append({
266
+ "id": mid,
267
+ "name": m.get("name") or mid,
268
+ "lab": lab,
269
+ "ctx": int(ctx or 0),
270
+ "price_prompt": _flt(pr.get("prompt")),
271
+ "price_completion": _flt(pr.get("completion")),
272
+ "modality": arch.get("modality"),
273
+ })
274
+ total = len(models)
275
+ top = sorted(models, key=lambda x: x["ctx"], reverse=True)[:limit]
276
+ labs: dict[str, Any] = {}
277
+ for m in models:
278
+ g = labs.setdefault(m["lab"], {"lab": m["lab"], "count": 0, "maxCtx": 0, "free": 0})
279
+ g["count"] += 1
280
+ if m["ctx"] > g["maxCtx"]:
281
+ g["maxCtx"] = m["ctx"]
282
+ if m["price_prompt"] == 0.0 and m["price_completion"] == 0.0:
283
+ g["free"] += 1
284
+ labs_list = sorted(labs.values(), key=lambda x: (x["count"], x["maxCtx"]), reverse=True)
285
+ return {"models": top, "labs": labs_list, "total": total}
286
+
287
+ return _cached_fetch("openrouter_models", url, ttl=900, parser=parse)
288
+
289
+
290
  def feed_nvd_fintech(limit: int = 16) -> dict[str, Any]:
291
  url = ("https://services.nvd.nist.gov/rest/json/cves/2.0?keywordSearch=financial"
292
  "&resultsPerPage=" + str(limit))
 
465
  cve = feed_nvd_fintech(limit)
466
  return JSONResponse({"tab": "risk", "fintech_cve": cve, "doctrine": DOCTRINE})
467
 
468
+ # ---------- FRONTIER (live AI model landscape) ----------
469
+ @app.get(base + "/frontier/models", include_in_schema=False)
470
+ async def _frontier_models(limit: int = 24):
471
+ orm = feed_openrouter_models(limit)
472
+ return JSONResponse({"tab": "models", "openrouter": orm, "doctrine": DOCTRINE})
473
+
474
  # ---------- REAL ESTATE ----------
475
  @app.get(base + "/re/pulse", include_in_schema=False)
476
  async def _re_pulse():
szl3d_holographic.py CHANGED
@@ -150,6 +150,8 @@ SURFACES: List[Dict[str, str]] = [
150
  {"id": "brainexplain", "cat": "brain", "title": "Brain Explain · transparent explanation of WHY the brain retrieved what it did · MODELED descriptive trace over the REAL retrieval subgraph (which query terms matched which seed nodes, per-node ppr-vs-salience rationale, communities traversed, each node's OWN label VERBATIM) → EXPLAINABLE/PARTIALLY-EXPLAINABLE/OPAQUE (never invents a rationale; honest OPAQUE beats a fake one), unsigned SHA-256 receipt-on-write", "owner": "WaveT-Dev1"},
151
  {"id": "braingaps", "cat": "brain", "title": "Brain Gaps · an honest map of what the brain does NOT know · MEASURED thin (sparse) communities + weakly-connected island nodes (degree≤1) + weak-label share over the live graph, and per-query COVERED/THIN/GAP grounding → estate verdict WELL-COVERED/PATCHY/SPARSE (a GAP is never fabricated into coverage), unsigned SHA-256 receipt-on-write (MODELED)", "owner": "WaveT-Dev1"},
152
  {"id": "brainconstitution", "cat": "brain", "title": "Brain Constitution · the honest, machine-checkable ruleset the brain is graded against per query · an explicit ordered set of ARTICLES (grounding sufficiency, calibrated confidence, honest corroboration, contradictions surfaced, traceable to source, freshness honesty, coverage gaps admitted, doctrine invariants) each graded COMPLIANT/VIOLATED/UNAVAILABLE against whatever sibling brain-honesty surfaces are importable (an absent surface is UNAVAILABLE, never a fabricated pass) → CONSTITUTIONAL/IN-VIOLATION/INSUFFICIENT-SIGNAL, never CONSTITUTIONAL while any evaluable Article is VIOLATED, unsigned SHA-256 receipt-on-write (MODELED)", "owner": "WaveT-Dev1"},
 
 
153
  ]
154
 
155
  # Content-type by extension (the only extensions we serve from the 3d tree).
 
150
  {"id": "brainexplain", "cat": "brain", "title": "Brain Explain · transparent explanation of WHY the brain retrieved what it did · MODELED descriptive trace over the REAL retrieval subgraph (which query terms matched which seed nodes, per-node ppr-vs-salience rationale, communities traversed, each node's OWN label VERBATIM) → EXPLAINABLE/PARTIALLY-EXPLAINABLE/OPAQUE (never invents a rationale; honest OPAQUE beats a fake one), unsigned SHA-256 receipt-on-write", "owner": "WaveT-Dev1"},
151
  {"id": "braingaps", "cat": "brain", "title": "Brain Gaps · an honest map of what the brain does NOT know · MEASURED thin (sparse) communities + weakly-connected island nodes (degree≤1) + weak-label share over the live graph, and per-query COVERED/THIN/GAP grounding → estate verdict WELL-COVERED/PATCHY/SPARSE (a GAP is never fabricated into coverage), unsigned SHA-256 receipt-on-write (MODELED)", "owner": "WaveT-Dev1"},
152
  {"id": "brainconstitution", "cat": "brain", "title": "Brain Constitution · the honest, machine-checkable ruleset the brain is graded against per query · an explicit ordered set of ARTICLES (grounding sufficiency, calibrated confidence, honest corroboration, contradictions surfaced, traceable to source, freshness honesty, coverage gaps admitted, doctrine invariants) each graded COMPLIANT/VIOLATED/UNAVAILABLE against whatever sibling brain-honesty surfaces are importable (an absent surface is UNAVAILABLE, never a fabricated pass) → CONSTITUTIONAL/IN-VIOLATION/INSUFFICIENT-SIGNAL, never CONSTITUTIONAL while any evaluable Article is VIOLATED, unsigned SHA-256 receipt-on-write (MODELED)", "owner": "WaveT-Dev1"},
153
+ {"id": "markets", "cat": "finance", "flag": True, "title": "Markets & Finance · live Polymarket prediction book (top markets by 24h volume, pillar height = 24h vol, bead = YES probability) + crypto majors orbiting by market cap · 100% MEASURED same-origin deva finance feeds, no mocked spend/keys, log-scaling is display-only", "owner": "Forge"},
154
+ {"id": "leaders", "cat": "more", "flag": True, "title": "Frontier Models · Live AI Leaders · MEASURED live OpenRouter model catalog — one pillar per lab (height = max context window, bead = open/free share); widest-context models orbit as satellites (teal = free, amber = paid); log-scaling is display-only, no invented benchmark or ranking", "owner": "Forge"},
155
  ]
156
 
157
  # Content-type by extension (the only extensions we serve from the 3d tree).