Spaces:
Running
Running
graphify
This project has a knowledge graph at graphify-out/ with god nodes, community structure, and cross-file relationships.
When the user types /graphify, invoke the skill tool with skill: "graphify" before doing anything else.
Rules:
- For codebase questions, first run
graphify query "<question>"when graphify-out/graph.json exists. Usegraphify path "<A>" "<B>"for relationships andgraphify explain "<concept>"for focused concepts. These return a scoped subgraph, usually much smaller than GRAPH_REPORT.md or raw grep output. - Dirty graphify-out/ files are expected after hooks or incremental updates; dirty graph files are not a reason to skip graphify. Only skip graphify if the task is about stale or incorrect graph output, or the user explicitly says not to use it.
- If graphify-out/wiki/index.md exists, use it for broad navigation instead of raw source browsing.
- Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context.
- After modifying code, run
graphify update .to keep the graph current (AST-only, no API cost).
OpenAI API Proxy
FastAPI proxy that routes OpenAI-compatible chat requests to NVIDIA NIM based on the sk-nvidia key the client uses.
Setup & run
- Install:
pip install -r requirements.txt - Copy
.env.exampleto.envand fill in real provider API keys + proxy keys - Run:
python main.py(uvicorn, http://127.0.0.1:8000) - Client calls
POST /v1/chat/completionswithAuthorization: Bearer sk-{provider}-...
Architecture
config.py— loads.env, exposesPROVIDER_KEYS(proxy→real key mapping) andREAL_KEYSproxy/providers.py—Providerdataclass registry; addsenv_real_keyfield name,auth_header,handles_202flagproxy/auth.py—resolve_provider()matches Bearer token againstPROVIDER_KEYS;get_real_key()reads the real API key from envproxy/client.py—forward_request()streams or polls upstream; NVIDIA returns HTTP 202 then polls/v1/status/{id}proxy/router.py— FastAPI router with/v1/models,/v1/chat/completions,/v1/health,/v1/keys;create_app()factory mounts static files
Provider quirks
- NVIDIA: Bearer token auth, async (202→poll), base URL
https://integrate.api.nvidia.com
Adding a new provider
- Add
Provider(...)toproxy/providers.py:PROVIDERSdict - Add
REAL_*_KEYandSK_*_KEYenv vars inconfig.pyand.env.example - Add model list to
MODELSdict inproxy/router.py
Constraints
- No tests, no CI, no linter/formatter config — not yet set up
- No database — pure HTTP proxy
- Timeouts: connect=10s, read=180s; NVIDIA poll interval=2s, max 60 attempts