A coding agent can live on your PC while its model lives in somebody else’s data center. The terminal window, project files and even the API address your agent talks to may all look local. None of that settles where inference happens.
Ollama is a useful example because it supports both arrangements. Its local models run on the user’s hardware, but Ollama says its cloud models run inference on Ollama’s cloud service. Those cloud models can still be called through the Ollama app, command line, official libraries or the local Ollama API.[1] A request to localhost can therefore be the first hop, not the final destination.
That is not evidence of secret uploading. It is a reason to audit the active model path before pasting private code into an agent.
Start with the model that is actually selected
Find the model identifier shown by the agent for the current session. In OpenCode, /models lists available models and selections use a provider/model form, such as ollama/gemma3:4b or a model under Anthropic, OpenAI or another provider.[5] The provider prefix is the first useful clue: it tells you which integration will handle the request.
Do not stop at the default in a config file. OpenCode documents that a model selected for a session takes precedence over the configured default, and agents or commands can select their own models.[5] It can also fall back to the newest available supported model when the configured default is unavailable.[5] The model visible in the live session matters more than the model you remember setting last week.
A familiar model name is not enough either. The same Qwen, Gemma or Llama-family model can be hosted on your computer, a server in another room or a commercial API. The provider and endpoint decide where the request goes.
Follow the endpoint
OpenCode automatically discovers Ollama at http://127.0.0.1:11434; it also discovers LM Studio and vLLM at their default local addresses.[4][5] A loopback address such as 127.0.0.1 points back to the same computer. If the selected model is served there and the weights are loaded by that local runtime, inference is local to that machine.
Now inspect the provider’s baseURL or equivalent endpoint. OpenCode lets users replace a provider’s endpoint, route requests through a proxy, point Ollama at another host, or define any OpenAI-compatible server.[4] An address on a home network may lead to your own GPU server. A public HTTPS address may lead to a cloud provider. The URL tells you the destination; it does not, by itself, tell you who operates that server or what data it retains.
Credentials are another clue, not a verdict. A commercial API usually needs an API key or account connection, but OpenCode also supports authentication on remote or proxied Ollama servers.[4] Conversely, a signed-in local Ollama installation can invoke Ollama cloud models.[3] “I did not paste an API key into this window” is not a privacy test.
For sensitive work, record three things together: the exact active provider/model, the resolved endpoint, and who controls the machine at that endpoint. If any one is unknown, the inference location is still unknown.
Ollama’s cloud switch has a precise job
Ollama says it does not see prompts or data when a model runs locally. For cloud-hosted models, it processes prompts and responses to provide the service.[2] Ollama also states that cloud prompt and response content is not stored or logged and is not used for training, while limited account and usage metadata is collected.[2][3] Those are Ollama’s published data-handling claims, not an independent audit.
Users who want an Ollama installation to remain local-only can set disable_ollama_cloud in ~/.ollama/server.json. Ollama says this removes access to its cloud models and web search.[2] That is a useful guardrail because it prevents the Ollama server from using those cloud features.
It does not magically make every part of a coding agent local. The agent may have other providers configured. A web-search tool, repository integration or telemetry system can also use the network without moving model inference to the cloud. Model locality and total network silence are separate questions.
Permissions are separate too. A setting that controls whether an agent may read files, run shell commands or call tools governs what context it can collect. It does not determine where the selected model computes its answer. Changing a permission can reduce exposure, but it cannot turn a remote endpoint into a GPU under your desk.
A five-minute audit before sensitive code
First, open the agent’s current model selector and write down the full provider/model identifier. Check for a session-specific or agent-specific override.
Second, inspect that provider’s endpoint. Loopback is the clearest same-machine case. A private LAN address can still be local in the broader home-lab sense, but only if you control the destination. Treat an unfamiliar hostname as remote until you identify it.
Third, verify that the local runtime is really serving the named model. The model should appear in the runtime’s inventory, and the runtime should remain necessary for the request to succeed. CPU, GPU or memory activity can support the diagnosis, though activity alone does not prove that no other request left the machine.
Fourth, review cloud-feature controls and every enabled tool. Disabling Ollama cloud features narrows Ollama’s path; it says nothing about a separately configured OpenAI, Anthropic or proxy provider. Decide whether browsing, hosted code search or other network tools belong in this session.
Finally, run a harmless test prompt before opening a sensitive repository. If the model is meant to be local, disconnecting the internet while leaving the local runtime running is a strong practical check: local generation should still work. A failure is informative, but success only proves that this test completed offline. It does not certify every plugin or future session configuration.
Local inference still has a hardware bill
Cloud inference is attractive partly because the home machine does not need enough GPU or system memory to hold the model. Ollama describes its cloud service as a way to run larger models without a powerful GPU.[1]
A local setup moves that requirement back home. The needed RAM or VRAM depends on model size, quantization, context length and runtime overhead, so there is no honest universal minimum. The useful test is whether the exact model and context fit your machine at an acceptable speed. If they do not, a smaller local model, a home server or a clearly disclosed cloud provider are all defensible choices.
Cloud inference is a deliberate trade when the local machine cannot run the model you need. Accidental cloud use is not. Before sending proprietary code, credentials or an unreleased design, make the route legible: active model, provider, endpoint and operator. If you cannot name all four, treat the session as remote until you can.