Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit d71153e

Browse files
committed
fix(core): loading models.dev in dev
1 parent e60ded0 commit d71153e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/opencode/src/provider/models.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ export namespace ModelsDev {
8181
const file = Bun.file(filepath)
8282
const result = await file.json().catch(() => {})
8383
if (result) return result as Record<string, Provider>
84-
const json = await data()
84+
if (typeof data === "function") {
85+
const json = await data()
86+
return JSON.parse(json) as Record<string, Provider>
87+
}
88+
const json = await fetch("https://models.dev/api.json").then((x) => x.text())
8589
return JSON.parse(json) as Record<string, Provider>
8690
}
8791

0 commit comments

Comments
 (0)