Skip to content

Commit ff08f1f

Browse files
authored
Merge branch 'sst:dev' into update
2 parents 400d090 + db75a6d commit ff08f1f

File tree

342 files changed

+6079
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+6079
-160
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
run: bun install
2222

2323
- name: Run validation script
24-
run: script/validate.ts
24+
run: bun validate

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ temperature = true # or false - supports temperature control
9595
knowledge = "2024-04" # Knowledge-cutoff date
9696
release_date = "2025-02-19" # First public release date
9797
last_updated = "2025-02-19" # Most recent update date
98+
open_weights = true # or false - model’s trained weights are publicly available
9899

99100
[cost]
100101
input = 3.00 # Cost per million input tokens (USD)
@@ -152,6 +153,7 @@ Models must conform to the following schema, as defined in `app/schemas.ts`.
152153
- `knowledge` _(optional)_: String — Knowledge-cutoff date in `YYYY-MM` or `YYYY-MM-DD` format
153154
- `release_date`: String — First public release date in `YYYY-MM` or `YYYY-MM-DD`
154155
- `last_updated`: String — Most recent update date in `YYYY-MM` or `YYYY-MM-DD`
156+
- `open_weights`: Boolean - Indicate the model's trained weights are publicly available
155157
- `cost.input` _(optional)_: Number — Cost per million input tokens (USD)
156158
- `cost.output` _(optional)_: Number — Cost per million output tokens (USD)
157159
- `cost.reasoning` _(optional)_: Number — Cost per million reasoning tokens (USD)
@@ -163,6 +165,8 @@ Models must conform to the following schema, as defined in `app/schemas.ts`.
163165
- `limit.output`: Number — Maximum output tokens
164166
- `modalities.input`: Array of strings — Supported input modalities (e.g., ["text", "image", "audio", "video", "pdf"])
165167
- `modalities.output`: Array of strings — Supported output modalities (e.g., ["text"])
168+
- `status` _(optional)_: Array of strings — Supported status:
169+
- `deprecated` - Indicate the model is no longer served by the provider's public API
166170

167171
### Examples
168172

bun.lock

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
},
1717
"devDependencies": {
1818
"@tsconfig/bun": "catalog:",
19+
"@types/bun": "catalog:",
20+
"@types/node": "catalog:",
1921
},
2022
},
2123
"packages/function": {
@@ -29,6 +31,7 @@
2931
"name": "@models.dev/web",
3032
"dependencies": {
3133
"hono": "^4.8.0",
34+
"models.dev": "workspace:*",
3235
},
3336
"devDependencies": {
3437
"@types/bun": "^1.2.16",
@@ -37,6 +40,7 @@
3740
},
3841
"catalog": {
3942
"@tsconfig/bun": "^1.0.8",
43+
"@types/bun": "1.3.0",
4044
"@types/node": "22.13.9",
4145
"ai": "4.3.16",
4246
"typescript": "5.8.2",
@@ -55,7 +59,9 @@
5559

5660
"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.16" } }, "sha512-1aCZJ/6nSiViw339RsaNhkNoEloLaPzZhxMOYEa7OzRzO41IGg5n/7I43/ZIAW/c+Q6cT12Vf7fOZOoVIzb5BQ=="],
5761

58-
"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg=="],
62+
"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="],
63+
64+
"@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="],
5965

6066
"accepts": ["[email protected]", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="],
6167

@@ -91,6 +97,8 @@
9197

9298
"cors": ["[email protected]", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g=="],
9399

100+
"csstype": ["[email protected]", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
101+
94102
"debug": ["[email protected]", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ=="],
95103

96104
"define-data-property": ["[email protected]", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="],
@@ -281,7 +289,7 @@
281289

282290
"type-is": ["[email protected]", "", { "dependencies": { "content-type": "^1.0.5", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw=="],
283291

284-
"undici-types": ["undici-types@7.8.0", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="],
292+
"undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
285293

286294
"unpipe": ["[email protected]", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],
287295

@@ -309,12 +317,24 @@
309317

310318
"@models.dev/function/@cloudflare/workers-types": ["@cloudflare/[email protected]", "", {}, "sha512-9RIffHobc35JWeddzBguGgPa4wLDr5x5F94+0/qy7LiV6pTBQ/M5qGEN9VA16IDT3EUpYI0WKh6VpcmeVEtVtw=="],
311319

320+
"bun-types/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg=="],
321+
312322
"http-errors/statuses": ["[email protected]", "", {}, "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="],
313323

324+
"models.dev/@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.3.0" } }, "sha512-+lAGCYjXjip2qY375xX/scJeVRmZ5cY0wyHYyCYxNcdEXrQ4AOe3gACgd4iQ8ksOslJtW4VNxBJ8llUwc3a6AA=="],
325+
314326
"opencontrol/@tsconfig/bun": ["@tsconfig/[email protected]", "", {}, "sha512-udGrGJBNQdXGVulehc1aWT73wkR9wdaGBtB6yL70RJsqwW/yJhIg6ZbRlPOfIUiFNrnBuYLBi9CSmMKfDC7dvA=="],
315327

316328
"opencontrol/hono": ["[email protected]", "", {}, "sha512-Pst8FuGqz3L7tFF+u9Pu70eI0xa5S3LPUmrNd5Jm8nTHze9FxLTK9Kaj5g/k4UcwuJSXTP65SyHOPLrffpcAJg=="],
317329

318330
"openid-client/jose": ["[email protected]", "", {}, "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA=="],
331+
332+
"bun-types/@types/node/undici-types": ["[email protected]", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="],
333+
334+
"models.dev/@types/bun/bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-u8X0thhx+yJ0KmkxuEo9HAtdfgCBaM/aI9K90VQcQioAmkVp3SG3FkwWGibUFz3WdXAdcsqOcbU40lK7tbHdkQ=="],
335+
336+
"models.dev/@types/bun/bun-types/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg=="],
337+
338+
"models.dev/@types/bun/bun-types/@types/node/undici-types": ["[email protected]", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="],
319339
}
320340
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"catalog": {
99
"typescript": "5.8.2",
1010
"@types/node": "22.13.9",
11+
"@types/bun": "1.3.0",
1112
"zod": "3.24.2",
1213
"ai": "4.3.16",
1314
"@tsconfig/bun": "^1.0.8"
1415
}
1516
},
1617
"scripts": {
17-
"validate": "bun script/validate.ts"
18+
"validate": "bun ./packages/core/script/validate.ts"
1819
},
1920
"dependencies": {
2021
"@cloudflare/workers-types": "^4.20250801.0",

packages/core/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
},
99
"main": "./src/index.ts",
1010
"devDependencies": {
11-
"@tsconfig/bun": "catalog:"
11+
"@tsconfig/bun": "catalog:",
12+
"@types/bun": "catalog:",
13+
"@types/node": "catalog:"
1214
}
1315
}

script/validate.ts renamed to packages/core/script/validate.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/usr/bin/env bun
22

3-
import { generate } from "models.dev";
3+
import { generate } from "../src/generate";
44
import path from "path";
55
import { ZodError } from "zod";
66

77
try {
8-
const result = await generate(path.join(import.meta.dir, "..", "providers"));
8+
const result = await generate(
9+
path.join(import.meta.dirname, "..", "..", "..", "providers"),
10+
);
911
console.log(JSON.stringify(result, null, 2));
1012
} catch (e: any) {
1113
if (e instanceof ZodError) {

packages/core/src/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const Model = z
5555
context: z.number().min(0, "Context window must be positive"),
5656
output: z.number().min(0, "Output tokens must be positive"),
5757
}),
58-
experimental: z.boolean().optional(),
58+
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
5959
provider: z
6060
.object({
6161
npm: z.string().optional(),

packages/web/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"build": "./script/build.ts"
77
},
88
"dependencies": {
9-
"hono": "^4.8.0"
9+
"hono": "^4.8.0",
10+
"models.dev": "workspace:*"
1011
},
1112
"devDependencies": {
1213
"@types/bun": "^1.2.16"

packages/web/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function getColumnIndexByUrlName(name: string): number {
4343
let y = 0;
4444

4545
help.addEventListener("click", () => {
46-
scrollY = window.scrollY;
46+
y = window.scrollY;
4747
document.body.style.position = "fixed";
4848
document.body.style.top = `-${y}px`;
4949
modal.showModal();
@@ -53,7 +53,7 @@ function closeDialog() {
5353
modal.close();
5454
document.body.style.position = "";
5555
document.body.style.top = "";
56-
window.scrollTo(0, scrollY);
56+
window.scrollTo(0, y);
5757
}
5858

5959
modalClose.addEventListener("click", closeDialog);

packages/web/src/render.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ export const Providers = await generate(
1515
const loadProviderSvg = async (providerId: string): Promise<string | null> => {
1616
const providerLogoPath = path.join(
1717
import.meta.dir,
18-
"..", "..", "..",
18+
"..",
19+
"..",
20+
"..",
1921
"providers",
2022
providerId,
2123
"logo.svg"
2224
);
2325

2426
const defaultLogoPath = path.join(
2527
import.meta.dir,
26-
"..", "..", "..",
28+
"..",
29+
"..",
30+
"..",
2731
"providers",
2832
"logo.svg"
2933
);
@@ -336,7 +340,7 @@ export const Rendered = renderToString(
336340
)
337341
.flatMap(([providerId, provider]) =>
338342
Object.entries(provider.models)
339-
.filter(([, model]) => !model.experimental)
343+
.filter(([, model]) => model.status !== "alpha")
340344
.sort(([, modelA], [, modelB]) =>
341345
modelA.name.localeCompare(modelB.name)
342346
)
@@ -498,10 +502,16 @@ export const Rendered = renderToString(
498502
.
499503
</p>
500504
<h2>Logos</h2>
501-
<p>Provider logos are available at <code>/logos/{`{provider}`}.svg</code> where <code>{`{provider}`}</code> is the <b>Provider ID</b>.</p>
505+
<p>
506+
Provider logos are available at <code>/logos/{`{provider}`}.svg</code>{" "}
507+
where <code>{`{provider}`}</code> is the <b>Provider ID</b>.
508+
</p>
502509
<div class="code-block">
503510
<code>
504-
curl <a href="/logos/anthropic.svg">https://models.dev/logos/anthropic.svg</a>
511+
curl{" "}
512+
<a href="/logos/anthropic.svg">
513+
https://models.dev/logos/anthropic.svg
514+
</a>
505515
</code>
506516
</div>
507517
<p>

0 commit comments

Comments
 (0)