grep -r secret ./src
A Private Codebase Deserves a Private Model.
Using ai on private codebase work raises one question before any other: what exactly does the model read, and where does that text go. With a local model the answer can be nowhere.

Source code is the clearest case for local AI we know. It is a trade secret by definition, it often belongs to a client under contract, and it is full of things that should never be in a vendor's log: connection strings, internal hostnames, half-finished security fixes. This page sits under back to local ai code quality because privacy and quality are entangled: the more of your code the model may see, the better it works.
What the Model Actually Sees

A completion request sends the text around the cursor. A chat request sends the open file, maybe several. An agent sends whatever it chooses to read, which can be the whole tree. With a hosted service every one of those fragments leaves the building. With a local model they travel from your editor to a process on the same machine, or across your own LAN to a team server, and stop there. That is the whole privacy argument, and it is sufficient.
Giving It Context Without Giving It Everything
A model that only sees the current file is a poor assistant on a large codebase. The usual remedy is a local index: an embedding model turns every file into vectors stored on disk, and the editor retrieves the relevant snippets to attach to each request. Done locally, the index is just another file on your machine. Decide what goes in it. We exclude anything under a secrets directory, generated code, vendored dependencies and test fixtures that contain real-looking data.
Secrets Are Still Secrets

A local model will not leak your API key to a vendor, but it will cheerfully paste it into a new file if the key is visible in context. Keep secrets out of the repository, as you should anyway, and add a check in the commit hook for anything that looks like a credential. Also keep the model's logs in mind: some runners record every prompt to disk by default. Turn that off or point it somewhere encrypted.
Client Code Under Contract
Agencies and consultancies hold code they do not own. Many contracts forbid sharing it with third parties, and a hosted AI service is a third party whatever its terms say. A local setup lets you say to the client, truthfully, that their repository never left your network. That is a sentence worth being able to write, and it is the same sentence we offer to our own customers about their documents.
Once the model can see the code safely, the next question is what to let it do. Reading diffs as a first reviewer is the lowest-risk use, and we cover it in our guide to local ai code review.

Prove it on your documents.
Every engagement starts the same way: we run the system on a sample of your own files, under NDA/DPA, and hand you a written report with the scores, misses included. No commitment.