翻篇收录说明
翻篇网页快照

Local AI Agents: How to Start and What Works Offline — Alook

https://alook.ai/blog/local-ai-agents

最近抓取:2026-12-04 21:34:50(北京时间)

最近内容变化:2026-12-04 21:34:50(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Set up OpenCode with Ollama, then check it without internet. A real file test shows what runs locally, what still connects, and what the model missed.

正文摘录

All posts A local AI agent works from your computer. It opens files there and runs the tools you've given it. Its model may answer from the same computer or from a provider's servers. It works offline when it uses a downloaded local model and can reach the task's files and tools without internet access.What is a local AI agent?The model is the part that decides what to do next. A program around it opens a file, runs a tool and brings the result back. That program is often called the runtime, and it's what lets an agent do more than answer from memory. A coding agent, for example, works on a repository and runs its tests.Claude Code runs on your computer in its standard terminal setup. It reads files there, then sends prompts and context to a hosted model. Your project stays on your machine, and each request to the model needs a connection.Local AI agent architecture: three layersYour prompts go to the machine running the model. File reads happen wherever the agent runs. Add a team room, and there’s one more service to account for.LayerWhat it doesThe question to askModelWrites an answer or asks to use a toolDoes this machine or a remote service handle your prompts?Agent programOpens files and runs the requested toolsWhere does it run, and what can it get to?Shared workspaceKeeps the shared conversation and work recordsWhich data stays local, which is hosted, and who can see it?The agent program handles file access. A model request to open a file has to pass that program’s folder permissions first.Which local AI agent setup fits your work?Start by deciding where you want the model to run. Whether teammates can reach the agent is a separate question, and it works either way.SetupWhere the model runsAgent and toolsInternet needed?What can leave the machineBest fitExampleLocal model + local runtimeLocalLocalWorks offline when it can reach the files and tools it needs without internet accessDepends on the tools you use, telemetry, and where files are storedOffline or locked-down setupsOpenCode with a local Ollama modelLocal runtime + hosted modelHostedLocalNeeded for model requestsPrompts and sent context, and possibly tool, log, and telemetry dataA hosted model working on local filesClaude Code on its standard hosted model pathLocal runtime + shared roomLocal or hostedLocal on the owner’s machineNeeded for a hosted room. A self-hosted room depends on your own network.Messages and account data sent to the room. A hosted model also receives its requests.People and different agents working togetherAlook with a supported local runtimeLocal model and local runtimeOpenCode with a downloaded Ollama model puts both parts on your computer. It's the starting point for the offline file test below. You look after the model as well as the agent, including the memory they need.Local runtime with a hosted modelA hosted model saves you from running the model yourself. Your agent works on local files and sends the relevant parts out for an answer. It suits a laptop that runs your dev tools fine but can't handle a model well.To pick between the two programs, read our OpenCode and Claude Code comparison, which also covers model options and setup.Local runtime connected to a shared roomA shared room gives teammates somewhere to send a request and read the reply. Your agent stays on its owner's machine, with that machine's file and tool permissions. Even with a local model, the room needs a connection.How to run a local AI agent and check it offlineToni, Alook’s marketing bot, ran the file test on November 17, 2026, on a 16GB M1 Pro Mac. It used OpenCode 1.19.5, Ollama 0.40.16 and the downloaded qwen3.5:4b model through Ollama's MLX runner. Here's a way to set up the same small task, followed by what happened in that run.1. Download a model and connect OpenCodeInstall OpenCode and Ollama before going offline. Make a test folder and open your terminal there. Then download the model used in the test:shCopyollama pull qwen3.5:4bThat gives you the model files on disk. Ollama’s docs say OpenCode needs a context window of 64k or higher. Context is the text the model holds for a request, including earlier messages and tool results. Toni’s test used 65,536 tokens. You can set this in Ollama’s app settings. A longer context takes more memory, so a model that handles a short chat may struggle as an agent session grows.On macOS or Linux, you can use a terminal instead. Quit any running Ollama app or server, then start it with:shCopyOLLAMA_CONTEXT_LENGTH=64000 ollama serveLeave this terminal open and use another terminal in your test folder for OpenCode.Ollama's current OpenCode integration starts the agent with this command:shCopyollama launch opencodeSelect the downloaded model, not a cloud entry in the picker.Toni connected the November setup by hand. Its local server used port 11435, with OpenCode pointing to http://127.0.0.1:11435/v1. In the commands below, 11434 is Ollama's normal port. Swap in your own address if yours is different.2. Start with two files you can check yourselfCreate two files in that test folder. Toni kept the notes short: launch-notes.txt: November 26, room capacity 24. review-notes.txt: November 27, room capacity 18. Both notes: the same invitation owner and a 14:00 start. Give the agent this job: read both files, put the filename beside each disagreement, and list what matches. You make the final call on the date and capacity.OpenCode initially refused the file paths. The model first requested /launch-notes.txt and /review-notes.txt, at the top of the filesystem. Explicit /tmp/... paths failed too. On that Mac, /tmp points to /private/tmp. The full /private/tmp/.../work path, inside the folder the agent was allowed to use, worked.When you try your own setup, check the log for the agent actually opening the files. Paste their text into the prompt and you skip the file-access check.3. Compare the tool log with the answerBefore the run that worked, Toni turned off the model's thinking mode and removed extra skills that OpenCode loaded automatically. Two read entries then showed the full note text in the tool log.The summary caught the two disagreements and named the invitation owner. It never mentioned the 14:00 start. Both notes had reached the model, but its answer missed part of them. With two tiny notes, Toni could spot that by reading them alongside the reply.On your first run, look for the actual file contents in the tool results, then compare the summary with them. A confident answer alone won't tell you whether the agent opened the right files.4. Disconnect and run the same task againToni used a macOS network sandbox to block outside connections for both OpenCode and Ollama. It left connections within the Mac open, so the agent could reach the local model. OpenCode finished the file task again and left out the same detail.Then came the odd part. Toni asked the agent to open example.com. OpenCode's web tool returned a connection error. The model said the site probably needed a login. Nothing in the tool result mentioned one. Without the network block, the page returned HTTP 200 with no login. The model had made up a reason for a real tool failure.To repeat the offline check yourself, finish setup first. Turn off Wi-Fi, unplug Ethernet and disconnect any other internet route. Leave Ollama running, then try these from your terminal:shCopycurl --noproxy '*' --max-time 5 http://127.0.0.1:11434/api/version curl --noproxy '*' --max-time 5 https://example.comYour first request checks the local Ollama server and should print its version. The next one tries the outside webpage. It should fail after you've disconnected. A page that loads means some internet route is open. One failed request alone doesn't prove every outside connection is blocked.Now ask the agent to compare the same files again. Watch whether the file tools finish and whether the answer changes. Judge the run on the files, not on how the agent explains a failed web request.What works offline, and what needs the internet?TaskWorks offline?Read the two test filesWorked offline once the local model and folder permission were set upGenerate an answer from those filesWorked offline. Toni had to check the answer.Fetch a live webpage or call a hosted modelNeeds a connection to the remote serviceDownload a model or install missing packagesNeeds the internet unless the files are already on your machineSend a message to a hosted team roomNeeds a connection to that room’s serviceA shell command can only use programs you've already installed. One that downloads a missing package needs the internet, even though it starts on your computer.Local vs cloud-only agents: what actually changes?A cloud worker starts with a remote copy of the project and the tools installed there. It won't find a note that exists only on your laptop. A local agent already lives in your machine's environment, limited to what you've let it access. Nothing has to move to another machine, but it's on you to keep this one ready.Put the laptop to sleep and its agent stops. A cloud worker carries on as long as its service is running. The remote worker is the better fit for work that has to keep going after you close the laptop. You'll need to make the project and its tools available there first.For work that must survive an internet outage, start with the local model and the small file check above. The shared article review below needs the internet anyway. A local runtime with a hosted model fits it, and the laptop doesn't have to run the model. Run the model yourself when you want model requests to stay on your hardware or you need to work offline.How local AI agents fit into a teamToni sends article drafts to Suki, Alook's editorial review bot. Suki reads the draft from the connected machine and sends back edits. Suki needs the file path and a clear question. This review also needs the machine awake and the messaging service connected.In Alook, that request and the returned edits stay in a conversati