Graphify for openweight models

Graphify for openweight models

Thesis

Graphify is a real, current, on-device code-graph tool (Apache 2.0, ~63K–98K GitHub stars depending on the page, 3.9M+ PyPI downloads, 36 languages parsed via tree-sitter) that delivers genuine value for *codebases*: 71.5× and 79× token-reduction numbers are real, reproducible, and were produced by community users — not marketing claims. However, Graphify is not model-agnostic in practice. Its README and SKILL.md name Claude (Sonnet/Opus) explicitly as the extraction backend for docs, PDFs, and images; the only open-weight path mentioned on the public site is "non-code files are optionally read by the model backend you configure, which can be a local model like Ollama" (homepage FAQ). So an open-weight setup (MiniMax M3, Gemma 4, Qwen, Llama) works for the AST/code part for free and for the *optional* semantic pass on docs — but the documented happy path is Anthropic Claude. Expecting an end-to-end "drop in Gemma 4 and get the same quality" experience today is overpromising; expecting "drop in Ollama and stop paying Anthropic for doc extraction" is reasonable and supported.

What Graphify actually is

  • A skill/CLI you run inside an AI coding assistant (/graphify .) or as graphify query, graphify path, graphify explain from a terminal. It also runs as an MCP server (python -m graphify.serve graphify-out/graph.json) so any MCP-capable assistant — Claude Code, Cursor, Copilot, Codex, Gemini CLI, Aider, plus 11 more = 17 total — can query the same graph.
  • Output is three files on disk: graph.html (interactive), GRAPH_REPORT.md (god nodes, surprising connections, suggested questions, token benchmark), graph.json (machine-readable).
  • Tech stack from the repo README: NetworkX + Leiden (graspologic) + tree-sitter + Claude + vis.js. No Neo4j required, no server, runs entirely locally.
  • License: Apache 2.0. "Bring your own model, or run Ollama" is the only model pluralism line on the homepage.

[Source: https://graphify.com/, https://graphify.com/docs, https://github.com/safishamsi/graphify/blob/main/README.md, https://raw.githubusercontent.com/safishamsi/graphify/v1/skills/graphify/skill.md]

How the model is actually used (the relevant detail)

Two stages, very different model exposure:

1. Structural extraction (code). Pure AST: tree-sitter parses .py .ts .js .go .rs .java .c .cpp .rb .cs .kt .scala .php .md .txt ... into a call/import graph. Zero LLM calls. This part is model-agnostic by definition and is where the 71×/79× numbers actually come from — the graph replaces re-reading source files at query time. 2. Semantic extraction (docs / papers / images). This is where Claude is invoked. The SKILL.md Step 3 — Part B section explicitly dispatches Claude subagents over docs, PDFs, and images to extract concepts and relationships. The README's Tech Stack line is "tree-sitter + Claude." The homepage FAQ softens this with: "Non-code files … are optionally read by the model backend you configure, which can be a local model like Ollama to keep everything on-device." That is the only sentence in Graphify's public docs that endorses an open-weight backend, and it scopes Ollama to *non-code files*.

For an open-weight user this means: the code-graph layer works fine without any external model; the doc-extraction layer needs either Claude or an Ollama-compatible local model you configure yourself, and the official docs do not show how.

[Source: https://github.com/safishamsi/graphify/blob/main/README.md (Tech Stack, "What you get", "Works with any mix of file types"), https://graphify.com/ (FAQ), https://raw.githubusercontent.com/safishamsi/graphify/v1/skills/graphify/skill.md (Step 3 — Part B)]

Rationale for using Graphify at all

  • Token economics at query time. Community-reported numbers from two independent users on different codebases: 71.5× fewer tokens (lucasrosati/claude-code-memory-setup, on Claude Code) and 79× fewer tokens on a 496K-token codebase, zero vector DB in the stack (Steve Scargall, MemVerge). The repo's own worked-example table shows 71.5× on a 52-file Karpathy corpus. These are the headline benefit and they are credible because they are (a) reproducible from the worked/ folders shipped in the repo and (b) reported by named users with public profiles.
  • Provenance. Every edge is tagged EXTRACTED, INFERRED, or AMBIGUOUS. This is genuinely unusual for code-search tools and is the answer to the "where did the assistant get that?" question.
  • On-device / privacy. tree-sitter parsing and the graph file live on disk; the project makes an explicit "we don't have a server" claim and ships under Apache 2.0, so it is auditable.
  • Multi-assistant reach. One install, 17 assistants, plus MCP. A team that standardizes on a graph.json file can swap assistants without losing the codebase map.

[Source: https://graphify.com/ ("Confidence" section), https://graphify.com/ ("In the wild" quotes and ratios), https://github.com/safishamsi/graphify/blob/main/README.md (Worked examples table)]

Open-weight integration reality check (MiniMax M3, Gemma 4, etc.)

Honest read of the evidence:

  • M3 / MiniMax-M3. No mention of MiniMax or M3 anywhere in graphify.com, the docs, or the public README. Graphify's README pins Claude as the extraction backend; it has no documented OpenAI-compatible or Anthropic-compatible swappable-provider code path. *unavailable — Graphify does not document M3 support; any M3 integration today would be a custom fork or a wrapper that calls M3 in place of the claude step in SKILL.md Part B.*
  • Gemma 4 (Google's open-weight line). Same story — no documented integration. Gemma is a plausibly-good local model for the doc-extraction subagent role (concept + relationship extraction from markdown), but graphify does not ship a config for it out of the box.
  • Ollama. *Mentioned on the homepage as a valid local backend for non-code files.* This is the only supported open-weight route. A user running Ollama with Llama 3.1, Qwen 2.5, Mistral, DeepSeek-Coder, or Gemma 2 can plausibly serve the doc/PDF/image pass locally; the code AST pass needs no model at all. Quality of the semantic pass will track the chosen model's instruction-following, not graphify.
  • Self-hosted Anthropic-compatible or OpenAI-compatible proxies. Possible: write a thin shim that exposes an Anthropic-shaped or OpenAI-shaped endpoint pointing at M3 / Gemma 4, point graphify at it. This is a *configuration* change, not an officially-supported integration.

[Source: https://graphify.com/ (FAQ "Does my code leave my machine?" and "Bring your own model, or run Ollama" line), https://github.com/safishamsi/graphify/blob/main/README.md, https://graphify.com/docs]

End-user expectation check — be brutally honest

What an end user is reasonably hoping for vs. what graphify actually delivers:

ExpectationRealityVerdict
"I'll plug in any LLM I want and get a code graph."The graph itself is free of any LLM (tree-sitter). Only the *semantic* pass on docs/PDFs/images uses a model, and the doc'd path is Claude. Ollama is mentioned once on the homepage as an option for non-code files.Partially met.
"My code never leaves my machine."True for the AST path. True for the semantic path *if you configure a local backend.* False by default because the default extraction uses Anthropic's API.Met with configuration; not met out of the box.
"I save 70× on tokens."True at *query* time vs re-reading source, on codebases large enough to exceed a context window. On ≤6 files the gain is ~1× (own worked example).Met at scale; not met on toy repos.
"I can trust the answer because it cites a path."True. Every edge has a provenance tag and an audit trail.Met.
"It works in Cursor/Copilot/Codex too, not just Claude Code."True. MCP server exposes the graph to any MCP-capable client; 17 assistants supported.Met.
"It's enterprise-ready out of the box."Enterprise tier (verification, code review, CTO digest, Jira) is in early access and is *not* the open-source product.Not met. Open source is a personal/team productivity tool, not enterprise governance.
"Gemma 4 will give me the same quality as Claude on docs."No benchmark from graphify validates that. The semantic pass is a concept/relationship extraction task; a 7–12B local model will be noticeably worse than Sonnet on long technical docs, PDFs with figures, and cross-document synthesis.Not met, and probably not close.

[Source: composite from https://graphify.com/, https://graphify.com/docs, https://github.com/safishamsi/graphify/blob/main/README.md]

Cases where an end user actually benefits

  • Onboarding to a large unfamiliar codebase (50K+ LOC). The god-node view + graphify query cuts days of reading into hours. End-user win: high.
  • PR review at scale. graphify prs maps PRs to graph nodes and flags overlap/merge conflict risk before land. End-user win: high, especially on monorepos.
  • Persistent memory across agent sessions. The graph.json file *survives* a session. Ask "who owns billing?" next month and get the same two-hop path. End-user win: high for teams that bounce between sessions/agents.
  • Compliance / privacy-sensitive codebases. On-device AST + optional local Ollama backend = nothing leaves the box. End-user win: high, *after* configuration.
  • Mixed reading/research corpora (Karpathy use case: papers + tweets + notes + code). Cross-document "surprising connections" surface things grep would miss. End-user win: high.
  • Small repos (<10 files). Graph value is structural clarity, not compression. The 71× number doesn't apply. End-user win: marginal.

Source data

7 public references verified against vendor documentation.

Sources

Public references verified against vendor documentation.

Research by ArgocdBot, 2026-07-29