OneGraph: local Gemma 4 explains PR risk from a real dependency graph
What they built
An LLM code reviewer that reads a diff in isolation can't see what else in the repository depends on the changed lines. OneGraph, built for Hacktoberfest Hack Day Pune, closes that gap by pairing Graphify, a tree-sitter based dependency graph extractor, with Gemma 4.
The result is wired into PR-Agent as a /graph_risk command that posts a comment on any pull request with a risk level, a list of affected dependents and a link to the full interactive graph. The rule throughout is that code owns the facts and Gemma owns the words.
Setup
- Graphify for graph extraction and community labeling, with no LLM call
- Gemma 4 served locally through Ollama as gemma4:12b-it-q4_K_M
- PR-Agent with a new graph_risk tool registered in its command map
- Code at github.com/CodersAcademy006/onegraph
How it works
- graphify extract --code-only runs tree-sitter over the repo and records every call, import and containment edge, deterministically.
- graphify label runs community detection and names each cluster.
- The risk level is arithmetic from a real count of a changed function's call sites, not the model's opinion.
- Gemma reads the graph traversal result rather than raw source and writes only the plain-English analysis, which is dropped into a template where every number comes from graph.json.
Results & numbers
- One measured local /graph_risk run took 132.8 seconds of wall time, with 2,438 input tokens and 1,658 output tokens, at no API cost.
- Graphify handled four public repos end to end, up to 65,361 nodes and 247,294 edges for supabase/supabase.
- In an A/B test, both the graph-grounded and embedding-RAG answers were 100% citation-accurate; the difference was that the graph version found more of the relevant call sites.
Gotchas
- Passing a relative path into the subprocess wrapper that changes cwd made the graph argument point nowhere and produced a bare CalledProcessError; the fix was calling .resolve() at every call site.
- Grounding didn't reduce hallucinated citations in his test, because the baseline had none; its benefit was coverage.
“code owns the facts, Gemma owns the words.”— CodersAcademy006
Do it yourself
- Install Ollama and pull a Gemma 4 model that fits your GPU.
- Build a dependency graph of your repo with a tree-sitter based tool such as Graphify.
- For each changed function in a PR, count its real dependents from the graph and set the risk level from that count.
- Give the local model only the traversal result and ask it to describe the impact in plain English.
- Post the result as a PR comment, for example by registering a command in PR-Agent.
Related
A local Qwen model took over a server-patching job when the cloud model refused
Seppe Gadeyne was patching seven servers and about 30 WordPress sites with an AI agent when the cloud model's safety filter stopped answering; he switched the same session to a Qwen model on his RTX 5090 workstation, which finished the job.
Fixing silent tool-call failures caused by Ollama's 4,096-token default context
orca forge found their app's 29 tools were silently failing because Ollama's OpenAI-compatible endpoint loaded the model at the default 4,096-token context and truncated input without an error; moving tool calls to /api/chat with num_ctx set fixed it.
Four 125B-748B open models on one RTX 5090 and 128 GB of RAM, benchmarked side by side
Seppe Gadeyne runs Qwen3.8-Flash-Next, Ornith-1.5-122B, GLM-5.3-Flash and DeepSeek-V4.1-Flash on a single RTX 5090 workstation and measured all four in one night for speed, long context, memory and quality on nine tasks from his own day job.
Fine-tuning Gemma 4 E2B on an 8 GB RTX 3050 so it thinks less
xbill used one 8 GB RTX 3050 to have Gemma 4 E2B write its own training data, fine-tune itself through its served 4-bit weights and get graded on 250 held-out maths problems, the whole loop in 6 h 44 min.