Choosing an AI backend
Local models via Ollama and LM Studio, or your own Anthropic, OpenAI, Gemini and Kimi keys — what each choice means for your code, and how routing per feature works.
Every AI feature in DiffGuardian flows through one router, and you pick the backend per job. That choice decides exactly where your code goes — nothing else does.
#The two kinds of backend
#Local models — code never leaves your machine
Point DiffGuardian at Ollama or
LM Studio running on your machine. Requests go to localhost
only. Nothing is transmitted anywhere.
- Available on every plan, including Basic.
- Works with no internet connection at all.
- The strongest privacy posture, and always available as a fallback.
- Quality and speed depend on the model and the hardware you run it on.
To set it up: start Ollama or LM Studio, load a model, then enable that provider in DiffGuardian's AI settings. The app connects over the local HTTP endpoint the tool exposes and lists the models it finds.
You can also point DiffGuardian at a model endpoint you host yourself, which keeps everything inside your own infrastructure.
#Cloud providers — bring your own key
Enter your own Anthropic, OpenAI, Google Gemini or Kimi API key and your code is sent from your machine directly to that provider, authenticated with your key. It is never relayed through DiffGuardian.
- Requires Pro. On Basic the provider toggles and key fields stay visible — so you can see what Pro unlocks — but enabling one opens an upgrade prompt, and a key saved there will not be used.
- Billed by the provider, on your existing account — DiffGuardian does not resell tokens.
- Because it is your key, the data is governed by your own agreement with that provider. Commercial APIs, unlike the consumer chat products, generally do not train on API inputs by default; check each provider's API data-usage terms for specifics.
- For this flow DiffGuardian is not a data processor. The provider is your subprocessor.
Your keys are encrypted in your operating system's credential store (the Keychain on macOS) and used only on your device. They are never transmitted to DiffGuardian's servers, and you can remove them at any time.
#Which to use when
| Situation | Backend |
|---|---|
| Reviewing code you cannot send anywhere | Local model |
| Offline — on a plane, on a locked-down network | Local model |
| A large PR where you want the strongest reasoning available | Your own cloud provider key |
| Your employer already has a provider agreement | Your own key under that agreement |
You are not locked in either way. Reassign a feature to a different backend, or fall back to local, at any time.
#One model per kind of work
Routing is per feature, not per account, so an expensive model does not end up doing cheap work. In Settings → Model routing you assign a vendor and model to each of:
| Feature | What it covers |
|---|---|
| AI Reviewing | The review pass, suggested comments, and the final summary. |
| Deep PR analysis | Trace It flow tours, per-hunk overviews, PR summaries. |
| Chats and explanations | Ask and Explain — interactive, conversational answers. |
| Input Assistant | Polish and dictation clean-up. A small, cheap model is usually plenty. |
| Comparisons | Compare summaries, acceptance-criteria verdicts, move/rename detection. |
| Architecture diagrams | Placing each changed file on the architecture layers. |
| Review planner | Decides where a multi-pass review should look first. |
| Finding checker | Tries to disprove each finding, so fewer false alarms reach you. |
The planner and the finding checker only run at the higher review-effort settings, and both are good places for a small, fast model.
#Benchmarking your local models
Local model performance is wildly uneven on the same hardware — one model can be an order of magnitude slower than another, and the fastest is rarely the one that reviews best. Settings → Local model benchmark runs the same sample diff through every reachable local model and puts time-to-first-token, tokens per second and the actual output side by side, so you can assign models on evidence rather than by guessing.
#Embeddings
Knowledge-base and repository embeddings are generated on-device by default, using a built-in local model and a local vector store. They are only sent to a cloud provider if you explicitly select a cloud embedding model.