You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dce88e3
Browse filesBrowse the repository at this point in the historyBrowse files
**Multi-key proxy for NVIDIA NIM with a native desktop dashboard.**
12
12
@@ -123,10 +123,16 @@ NVIDIA's free NIM tier limits each API key to ~40 RPM. Aggressive bursts trigger
123
123
-**Per-key cooldown timers** — on real 429s, trusts `Retry-After` exactly (no multiplication); distinguishes transient worker saturation (`ResourceExhausted`) from true RPM limits and never burns key cooldowns for the former
124
124
-**Network-error circuit breaker** — `ConnectTimeout`/`ConnectError` don't trigger key cooldown (the key is fine). After 3 consecutive network errors across different keys, rotation stops entirely and returns 503 (the network is down, no key can help)
125
125
-**504 model timeouts don't burn keys** — gateway timeouts cool the key for 30s but don't consume the attempt budget, since the model (not the key) is the bottleneck
126
-
-**Sliding-window RPM limiting** — keeps each key under 28 RPM (safe margin below 40)
126
+
-**Sliding-window RPM limiting** — keeps each key under 28 RPM (safe margin below 40); the ceiling self-tunes down from real `Retry-After` headers, so the pool never spends its full budget against a tighter upstream limit
127
127
-**Health checks** — revives keys whose cooldowns have expired, but skips 401/403 invalid keys (dead keys stay dead)
128
128
-**No silent model substitution** — the model you select is the model that answers; if it fails on every key you are told so, never handed output from a different model
129
129
-**Auto-compaction** — summarizes long histories so requests never fail on context overflow ([details](#auto-compaction))
130
+
-**Per-key × per-model scoring** — rotation is ordered by a composite score (success rate + median time to first token) learned per key and per model from live traffic: the best key for the requested model goes first
131
+
-**Multi-endpoint routing** — extra NVIDIA endpoints (`endpoints.json` or `OPENVIDIA_UPSTREAM_ENDPOINTS`), a 60s blacklist on ≥500 errors, automatic recovery
132
+
-**Multi-node sync via Redis (opt-in)** — cooldowns, invalid keys, pool throttling and model circuit breakers shared across instances ([details](#resilience--scale))
133
+
-**Embedding cache** — `/v1/embeddings` hits are served from memory (TTL 300s) without touching upstream quota
134
+
-**Free-tier provider fallback** — when every NVIDIA key is exhausted, requests fail over to OpenAI-compatible providers declared in `providers.json` ([details](#resilience--scale))
135
+
-**Graph engine** — programmatic multi-agent orchestration (Hub, run_agent, generator-verifier loops) on top of the proxy ([details](#graph-engine))
Label: `wayfinder:map` — tracker local-markdown (GitHub issues disabilitati sul repo).
4
+
5
+
## Destination
6
+
7
+
Modulo `openvidia/graph_engine.py` (~400 righe, async) che implementa il Graph Loop su DeepSeek locale (localhost:1919): Hub + run_agent + tool spawn/status/collect/kill + generate_and_verify, con test pytest verdi e ruff pulito.
- OVERRIDE: effort in **full-delivery** — i ticket si risolvono nella sessione stessa, non solo decisioni. Chart minimale, poi implementazione completa.
14
+
15
+
## Decisions so far
16
+
17
+
-[wf-001 full-delivery approved](tickets/wf-001-full-delivery.md) — l'utente ha richiesto mappa + implementazione completa nella stessa sessione ("E POI PARTI FULL DELIVERY").
18
+
-[wf-002 API pubblica graph_engine](tickets/wf-002-API-pubblica-graph-engine.md) — `openvidia/graph_engine.py` implementato e verificato: Hub + run_agent + graph_tools + generate_and_verify, 10/10 test, ruff pulito, export da `__init__.py`.
19
+
20
+
## Not yet specified
21
+
22
+
- Provider alternativi (non-DeepSeek) via env/CLI
23
+
- Persistenza sessioni graph su disco
24
+
25
+
## Out of scope
26
+
27
+
- Multi-nodo Redis / HTTP2 pool upstream (roadmap separata del proxy)
Label: `wayfinder:task` · HITL (deciso dall'utente in sessione) · **CLOSED**
4
+
5
+
## Question
6
+
7
+
L'utente carica wayfinder e dice "E POI PARTI FULL DELIVERY": l'effort Graph Engine deve essere sia mappato sia implementato per intero nella stessa sessione.
8
+
9
+
## Resolution
10
+
11
+
Approvato. La mappa (docs/wayfinder/map.md) è chart minima, la costruzione del grafo parte subito: graph_engine.py + tests + verify pytest/ruff.
Quale public API espone `openvidia/graph_engine.py`? Design già deciso in sessione: `Hub` (register/new_name/close/snapshot), `run_agent`, `generate_and_verify`, `ToolSpec`/`WorkerSpec`/`Provider` dataclass, `graph_tools` (get_status, send_message, wait_for_message, create_subagents, kill_subagents), export da `__init__.py`.
10
+
11
+
## Resolution
12
+
13
+
Implementata e verificata (10/10 test, ruff pulito): `openvidia/graph_engine.py` con `Provider` (chat async OpenAI-style), `ToolSpec`, `WorkerSpec`, `Hub` (status/mailbox/task/events), `run_agent` (loop con max_iterations, budget_tokens, timeout, crash su risposta vuota, tool error recovery), `graph_tools` (closure con factory per spawn/kill, depth bound: i worker non spawnano), `generate_and_verify` (rubric esplicita, APPROVED/REJECTED, feedback nel round successivo). Export public da `openvidia/__init__.py`. Test: `tests/test_graph_engine.py` (10 test, ScriptedProvider).
0 commit comments