[PR #9258] feat: add OPENCODE_MODELS_URL so the models.dev domain configurable for offline environments #13043

Closed
opened 2026-02-16 18:17:55 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9258

State: closed
Merged: Yes


What does this PR do?

There are several issues and pull requests (#8860 #4959 #8830 #8814 #8642 #7313) that discuss the issue that the models.dev domain can't be reached in offline environments. Even if you would use a local Ollama instance, the project tries to fetch https://models.dev/api.json.

The solution I propose is making the models.dev URL configurable, so you can use something in your local network to host the api.json file. A typical corporate environment might have products like Sonatype Nexus Repository that allow for proxying of specific files on the internet. It would be nice if a MODELS_DEV_URL could be configured to contain the path to an internal host with the right files.

How did you verify your code works?

I put my computer in airplane mode, configured the MODELS_DEV_URL environment variable to http://localhost:8000/, ran python3 -m http.server in a directory with api.json, and tried to use a local model.

Fixes: #7313

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9258 **State:** closed **Merged:** Yes --- ### What does this PR do? There are several issues and pull requests (#8860 #4959 #8830 #8814 #8642 #7313) that discuss the issue that the models.dev domain can't be reached in offline environments. Even if you would use a local Ollama instance, the project tries to fetch `https://models.dev/api.json`. The solution I propose is making the models.dev URL configurable, so you can use something in your local network to host the `api.json` file. A typical corporate environment might have products like Sonatype Nexus Repository that allow for proxying of specific files on the internet. It would be nice if a `MODELS_DEV_URL` could be configured to contain the path to an internal host with the right files. ### How did you verify your code works? I put my computer in airplane mode, configured the `MODELS_DEV_URL` environment variable to `http://localhost:8000/`, ran `python3 -m http.server` in a directory with `api.json`, and tried to use a local model. Fixes: #7313
yindo added the pull-request label 2026-02-16 18:17:55 -05:00
yindo closed this issue 2026-02-16 18:17:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13043