ソースを参照

fix: use OpenCode model catalog URL (#39672)

Co-authored-by: Dax Raad <d@ironbay.co>
opencode-agent[bot] 1 ヶ月 前
コミット
a4f25a94b4

+ 1 - 1
packages/cli/script/generate.ts

@@ -1,4 +1,4 @@
-const modelsUrl = process.env.OPENCODE_MODELS_URL || "https://models.dev"
+const modelsUrl = process.env.OPENCODE_MODELS_URL || "https://models.opencode.ai"
 
 export const modelsData = process.env.MODELS_DEV_API_JSON
   ? await Bun.file(process.env.MODELS_DEV_API_JSON).text()

+ 2 - 2
packages/core/src/models-dev.ts

@@ -151,10 +151,10 @@ const layer = Layer.effect(
       ),
     )
 
-    const source = Flag.OPENCODE_MODELS_URL || "https://models.dev"
+    const source = Flag.OPENCODE_MODELS_URL || "https://models.opencode.ai"
     const filepath = path.join(
       Global.Path.cache,
-      source === "https://models.dev" ? "models.json" : `models-${Hash.fast(source)}.json`,
+      source === "https://models.opencode.ai" ? "models.json" : `models-${Hash.fast(source)}.json`,
     )
     const ttl = Duration.minutes(5)
     const lockKey = `models-dev:${filepath}`

+ 1 - 1
packages/llm/script/recording-cost-report.ts

@@ -2,7 +2,7 @@ import * as fs from "node:fs/promises"
 import * as path from "node:path"
 
 const RECORDINGS_DIR = path.resolve(import.meta.dir, "..", "test", "fixtures", "recordings")
-const MODELS_DEV_URL = "https://models.dev/api.json"
+const MODELS_DEV_URL = "https://models.opencode.ai/api.json"
 
 type JsonRecord = Record<string, unknown>
 

+ 3 - 3
packages/stats/app/src/routes/model-catalog.ts

@@ -1,8 +1,8 @@
 import { query } from "@solidjs/router"
 
-export const modelCatalogSourceUrl = "https://models.dev/catalog.json"
-export const modelCatalogPricingUrl = "https://models.dev/api.json"
-export const modelCatalogLabSourceUrl = "https://models.dev/labs"
+export const modelCatalogSourceUrl = "https://models.opencode.ai/catalog.json"
+export const modelCatalogPricingUrl = "https://models.opencode.ai/api.json"
+export const modelCatalogLabSourceUrl = "https://models.opencode.ai/labs"
 
 export type ModelCatalogCost = {
   input: number

+ 1 - 1
packages/ui/vite.config.ts

@@ -45,7 +45,7 @@ function providerIconsPlugin() {
 }
 
 async function fetchProviderIcons() {
-  const url = process.env.OPENCODE_MODELS_URL || "https://models.dev"
+  const url = process.env.OPENCODE_MODELS_URL || "https://models.opencode.ai"
   const providers = await fetch(`${url}/api.json`)
     .then((res) => res.json())
     .then((json) => Object.keys(json))