Spaces:
Running
Download docs/architecture/ARCHITECTURE.md from Sdm0/opencodereview: direct link, hf CLI and curl.
- Browser
- Download file 1.97 kB
-
https://huggingface.co/spaces/Sdm0/opencodereview/resolve/main/docs/architecture/ARCHITECTURE.md
- Command line
-
hf download hf://spaces/Sdm0/opencodereview/docs/architecture/ARCHITECTURE.md
-
curl -L -o ARCHITECTURE.md https://huggingface.co/spaces/Sdm0/opencodereview/resolve/main/docs/architecture/ARCHITECTURE.md
OpenCodeReview architecture
The deployed path is intentionally remote-inference only. The API and Gradio process orchestrate GitHub retrieval and LangGraph; Gemini, Groq, or another configured OpenAI-compatible provider performs model inference. No model is downloaded or executed by the hosted API by default.
Runtime boundaries
backend/api.py: authenticated HTTP job lifecycle, persistence, approval, and posting receipts.backend/app.py: Gradio UI and review orchestration adapter.backend/graph.py,nodes/,backend/state.py: LangGraph workflow and typed state.backend/integrations/github_client.py: GitHub reads, caching, and writes.backend/integrations/llm_factory.pyandbackend/integrations/endpoints.py: remote provider selection and fallback.backend/integrations/auth.pyandconfig.py: authentication and settings.- Root modules such as
main.py,app.py, andcombined_server.pyare compatibility entry points. The application implementation lives inbackend/. frontend/: Vercel React client; review requests use FastAPI, while provider connectivity tests use the Vercel function.eval_data/: offline benchmark scorer and RAGAS evaluation utilities.prompts/: review prompts kept outside orchestration code.
Local model policy
Local embeddings are disabled unless OPENCODEREVIEW_ALLOW_LOCAL_EMBEDDINGS=true
is explicitly set. This keeps laptops and hosted containers from pulling
PyTorch or embedding models. Retrieval gracefully returns no extra context and
the review continues with the PR diff when the flag is disabled.
Persistence boundary
The API stores job records in Supabase Postgres when SUPABASE_DB_URL is
configured and otherwise uses SQLite. LangGraph checkpoints use a separate
SQLite saver. Process-local worker and session state is not shared between
replicas, so a durable queue and shared checkpoint/session storage are needed
before horizontal scaling.