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
Transparency: undocumented LLM providers + kimi default in extract_files_direct() #1086
Two related transparency/disclosure concerns discovered while reviewing v0.8.25:
1. extract_files_direct() defaults to kimi (Moonshot AI) in the Python API
In llm.py, the public function signature is:
defextract_files_direct(
files: list[Path],
backend: str="kimi", # ← defaults to Moonshot AI (Chinese provider)
...
)
If a user calls this function directly — or integrates graphify as a library — their source code is sent to api.moonshot.ai/v1 without any explicit consent or warning.
The CLI (graphify extract) handles this better: it picks "whichever API key is set." But that logic is in __main__.py, not in the underlying API. Users who import graphify programmatically hit the kimi default.
Why this matters: Moonshot AI (Kimi) is a Chinese AI company. Users with data residency requirements, enterprise policies, or open-source IP to protect may not be aware their code is leaving their jurisdiction.
2. README doesn't mention LLM providers or external API calls at all
The README describes graphify as a knowledge graph builder but does not mention:
That semantic extraction sends source code to external LLM APIs
Which providers are supported (Anthropic, Gemini, OpenAI, DeepSeek, Kimi, Ollama)
What data is sent (file contents? full AST dumps?)
How to run in a fully local/offline mode (Ollama)
This is a significant omission for a tool that reads private codebases.
Suggested fixes
Change the extract_files_direct() default from "kimi" to None or "anthropic" — require explicit opt-in for third-party providers, especially non-Western ones
Add a providers section to the README listing all supported backends, what data they receive, and how to use Ollama for fully local extraction
Emit a warning when a backend other than the one implied by the user's active API key is selected
My setup (for context)
MOONSHOT_API_KEY is NOT set in my environment — so no data went to moonshot.ai
The CLI correctly picked Claude (Anthropic) since ANTHROPIC_API_KEY is set
The PostToolUse hooks I have only check if graph.json exists — they don't call LLM extraction
This is a disclosure request, not a bug report. The code works correctly — but users deserve to know what it connects to.
1. extract_files_direct() default changed — signature is now backend: str | None = None. When unset it calls detect_backend(), which picks whichever API key you have set (same priority order as the CLI: Gemini → Kimi → Claude → OpenAI → DeepSeek → Bedrock → Ollama). If nothing is configured, it raises a clear ValueError listing every env var option rather than silently routing to kimi. Explicit backend= arguments still work identically — backward-compatible change.
2. README Privacy section updated — added a Data residency bullet that explains the auto-detect priority order, points at --backend ollama for fully local runs, and explicitly names Kimi as a Chinese provider routing to Moonshot AI servers.
Good catch — the CLI and library were inconsistent and this closes the gap. Note: even before this fix, calling extract_files_direct() without MOONSHOT_API_KEY set would raise a ValueError before any network call (the key check at llm.py:662), so no data was actually leaving the machine. But the implicit default was still wrong design and worth fixing on principle.
Activity
safishamsi commentedon May 30, 2026
Both points addressed in commit 006e159.
1.
extract_files_direct()default changed — signature is nowbackend: str | None = None. When unset it callsdetect_backend(), which picks whichever API key you have set (same priority order as the CLI: Gemini → Kimi → Claude → OpenAI → DeepSeek → Bedrock → Ollama). If nothing is configured, it raises a clearValueErrorlisting every env var option rather than silently routing to kimi. Explicitbackend=arguments still work identically — backward-compatible change.2. README Privacy section updated — added a Data residency bullet that explains the auto-detect priority order, points at
--backend ollamafor fully local runs, and explicitly names Kimi as a Chinese provider routing to Moonshot AI servers.Good catch — the CLI and library were inconsistent and this closes the gap. Note: even before this fix, calling
extract_files_direct()withoutMOONSHOT_API_KEYset would raise aValueErrorbefore any network call (the key check at llm.py:662), so no data was actually leaving the machine. But the implicit default was still wrong design and worth fixing on principle.fix extract_files_direct backend default: auto-detect instead of kimi (…
fix extract_files_direct backend default: auto-detect instead of kimi (…