Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Hey team
been just a little bit intoxicated, but I love OpenCode and use it daily with local models (Ollama/vLLM mostly), but air-gapped / fully offline environments are still a pain in 2026.
Right now even with a custom provider and local-only config, startup often fails because of:
- Mandatory fetch to https://models.dev/api.json → errors like "Failed to fetch models.dev" or "Unable to connect"
- LSP manifest downloads (pyright etc.) trying to hit the net
- Web UI /
opencode serveproxying assets from CDNs or failing handshake - Occasional other sneaky calls (update checks? telemetry?)
This breaks things in restricted networks (defense, finance, some gov/corp setups) even when the LLM endpoint is 100% internal.
Related issues I've seen piling up:
- Suppport for airgapped installation #2224 (the original airgapped request from 2025 – still open!)
- Failed to fetch models.dev #10766, error: FailedToOpenSocket downloading package manifest pyright #9932, nix build fails because it tries to access models.dev #10989 (models.dev fetch failing offline)
- When deploying open-source code offline, encountering the error message: "Unable to connect. Is the computer able to access the URL?" #9788, Cannot use opencode in private network #8830, 【intranet 】Unable to connect. Is the computer able to access the URL? #12083 (connection errors / web UI dead in private VLANs)
- Does OpenCode Require Internet APIs? #7313 ("Does OpenCode require internet APIs?")
- Folks are even linking to forks like opencode-sentinel because nothing upstream fully solves it yet
What I'd love (and I think a lot of enterprise users would too):
A simple, reliable offline mode toggle, something like:
opencode --offline/ envOPENCODE_OFFLINE=1/ config"offline": true- When on → skip all non-LLM network requests (models.dev, manifests, CDNs, updates, etc.)
- Graceful fallback: just use whatever providers/models are already defined locally
- Maybe a startup message like "Offline mode active – only talking to your local LLM"
- Bonus: optional internal mirror for models list if someone wants it (
OPENCODE_MODELS_URL=http://...)
Workarounds like firewall blocks or OPENCODE_DISABLE_MODELS_FETCH=1 help partially but aren't complete and sometimes still cause crashes/500s.
This would make OpenCode way more adoptable in high-security places without everyone having to fork or patch. The core already works great offline once you bypass the startup noise.
Thanks for all the awesome work – hoping this can get some love! 🙏
Activity
github-actions commentedon Mar 21, 2026
This issue might be a duplicate of existing issues. Please check:
OPENCODE_OFFLINEenv var, config flag, and CLI flag to disable non-essential outbound connections — proposed by a different user just days ago with very similar motivation and solution design.Consider adding a
+1or comment on one of those issues rather than opening a new one, so discussion stays consolidated.solarkraft commentedon Mar 21, 2026
I would like to pile on that this is important to me and a lot of others trying to run OpenCode in sensitive environments (it keeps coming up, the recent Hacker News thread is filled with “this project is a joke with its security stance” comments: https://news.ycombinator.com/item?id=47460525).
Considering all of the open issues regarding this complex, I would like to ask for official clarification:
Is this use case a project priority or even a project interest?
Statements suggest that maintainers aren’t necessarily opposed to privacy but actions suggest that it’s not a priority (definitely below out-of-the-box UX). Yet there seem to be some plans for enterprise compatibility, which this would be essential for.
I’d really like to find a solution for this because I really like OpenCode. But this is a gigantic issue making adoption way harder than it would have to be.
xpat07 commentedon Mar 23, 2026
Thanx for your comment.
I am working for local government and we have a lot of young developers and devops guys.
I would be very happy to introduce opencode as very potent tool and as future way of work on our code and infrastructure.
But our organisation is prohibiting use of cloud models and provider for now. We have small but good local AI infrastructure. For now and for us would be the best for now to be able to use opencode in offline mode with local models. I hink also for education will be such offline mode also very good.
I’m not very skilled opensource developer but the future of our devs, devops is very important to me.
I don’t think if I would be able to fully fork or to implement such a feature. Maybe I can try?
For my personal use I can configure it such and be every happy.
Em I missing something?
What do you think?
thdxr commentedon Mar 26, 2026
Fixed by #19299 - The WebUI is now embedded directly in the binary, so it works fully offline without requiring any CDN assets. This addresses the air-gapped/offline use case for the web interface. Note: Other non-LLM network calls (models.dev, update checks) may still require additional configuration via existing environment variables like OPENCODE_DISABLE_MODELS_FETCH.
thdxr commentedon Mar 26, 2026
Closing as fixed by #19299
xpat07 commentedon Mar 26, 2026
And what about TUI? Thanks for the effort. I am trying to implement opencode --offline.