diff options
| author | Benjamin Bartels <[email protected]> | 2026-01-31 01:37:37 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-30 19:37:37 -0600 |
| commit | f1caf840641e5a98995f14e809ad79b2d7f22eea (patch) | |
| tree | 0bbc041e12be4409b78b004730eee761084c45a7 /packages | |
| parent | 85126556b868b713cf14c10f8b4a6d861e42326e (diff) | |
| download | opencode-f1caf840641e5a98995f14e809ad79b2d7f22eea.tar.gz opencode-f1caf840641e5a98995f14e809ad79b2d7f22eea.zip | |
feat(build): respect OPENCODE_MODELS_URL env var (#11384)
Diffstat (limited to 'packages')
| -rwxr-xr-x | packages/opencode/script/build.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index 84a278224..f0b3fa828 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -14,11 +14,11 @@ process.chdir(dir) import pkg from "../package.json" import { Script } from "@opencode-ai/script" - +const modelsUrl = process.env.OPENCODE_MODELS_URL || "https://models.dev" // Fetch and generate models.dev snapshot const modelsData = process.env.MODELS_DEV_API_JSON ? await Bun.file(process.env.MODELS_DEV_API_JSON).text() - : await fetch(`https://models.dev/api.json`).then((x) => x.text()) + : await fetch(`${modelsUrl}/api.json`).then((x) => x.text()) await Bun.write( path.join(dir, "src/provider/models-snapshot.ts"), `// Auto-generated by build.ts - do not edit\nexport const snapshot = ${modelsData} as const\n`, |
