opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: Make the models.dev domain configurable for offline environments

Open bartbroere opened this issue 2 days ago • 3 comments

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

bartbroere avatar Jan 18 '26 15:01 bartbroere

Hey! Your PR title Make the models.dev domain configurable for offline environments doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

github-actions[bot] avatar Jan 18 '26 15:01 github-actions[bot]

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

github-actions[bot] avatar Jan 18 '26 15:01 github-actions[bot]

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

github-actions[bot] avatar Jan 18 '26 15:01 github-actions[bot]

Would it be possible to support file:///path/to/api.json? So I can download or define my own api.json file.

Moler1995 avatar Jan 19 '26 02:01 Moler1995