Open History to see the last commit
1{
2 "$schema": "node_modules/wrangler/config-schema.json",
3 "name": "modelschemas",
4 "compatibility_date": "2025-09-02",
5 "compatibility_flags": ["nodejs_compat", "enable_ctx_exports"],
6 "main": "src/worker.ts",
7 "vars": {
8 // Agent JWT audiences are origin-bound.
9 "BETTER_AUTH_URL": "https://modelschemas.com",
10 // FAL rate-card extract runs through this AI Gateway on Unified Billing
11 // (credits on the Cloudflare bill, no provider key). Created by hand in
12 // the dashboard.
13 "AI_GATEWAY_ID": "modelschemas",
14 },
15 "observability": {
16 "enabled": true,
17 },
18 // Workers Cache. Only the `CachedReads` entrypoint (catalog, schema and
19 // OpenAPI GETs; see src/worker.ts) is cached; the default entrypoint
20 // skips the cache lookup so HTML, auth, changes and status pay nothing.
21 // A request with Authorization is still cached because those responses
22 // say `public` (Cloudflare's rule). `enable_ctx_exports` is what lets
23 // the default entrypoint call CachedReads.
24 "cache": {
25 "enabled": false,
26 },
27 "exports": {
28 "default": { "type": "worker", "cache": { "enabled": false } },
29 "CachedReads": { "type": "worker", "cache": { "enabled": true } },
30 },
31 "workers_dev": true,
32 "routes": [{ "pattern": "modelschemas.com", "custom_domain": true }],
33 "triggers": {
34 // Fast tier: models poll. Slow tier: spec sync, sharded across four
35 // firings so each shard gets its own invocation budgets — keep in
36 // lockstep with SPEC_SYNC_SHARD_CRONS in src/server/ingest/sync.ts.
37 // FAL llms.txt rate-card extract is its own nightly invocation
38 // (FAL_PRICING_EXTRACT_CRON) so it does not spend the 15-min poll or
39 // FAL spec-sync shard's subrequest/CPU budget. Vercel per-model
40 // /endpoints prices are one daily firing (VERCEL_PRICING_EXTRACT_CRON)
41 // for the same reason: ~60 subrequests must not share the poll budget.
42 "crons": [
43 "*/15 * * * *",
44 "0 4 * * *",
45 "0 5 * * *",
46 "10 5 * * *",
47 "20 5 * * *",
48 "30 5 * * *",
49 "0 6 * * *",
50 "0 7 * * *",
51 "0 8 * * *",
52 "0 9 * * *",
53 "0 10 * * *",
54 "0 11 * * *",
55 ],
56 },
57 "limits": {
58 // Default is 30s CPU per invocation; FAL's shard parses and hashes
59 // ~1,400 per-model specs in one run, which can exceed that. Ceiling,
60 // not a floor — unused headroom costs nothing.
61 "cpu_ms": 300000,
62 },
63 "ai": {
64 "binding": "AI",
65 },
66 "browser": {
67 "binding": "BROWSER",
68 "remote": true,
69 },
70 "send_email": [
71 {
72 "name": "EMAIL",
73 },
74 ],
75 // Keyed Anthropic/Gemini listing calls, and Anthropic/OpenAI docs loads,
76 // egress through this object, placed in eastern North America: cron
77 // invocations run in any region and some hosts refuse some (issues #356,
78 // #482, #505). See src/server/providers/us-egress.ts.
79 "durable_objects": {
80 "bindings": [{ "name": "US_EGRESS", "class_name": "UsEgress" }],
81 },
82 "migrations": [{ "tag": "v1", "new_sqlite_classes": ["UsEgress"] }],
83 "kv_namespaces": [
84 {
85 "binding": "SCHEMA_CACHE",
86 "id": "8c8f93fc618242d9b92d37bba437580f",
87 },
88 ],
89 "d1_databases": [
90 {
91 "binding": "DB",
92 "database_name": "modelschemas",
93 "database_id": "557c12a0-dbad-4d46-8925-36315d8ecba9",
94 // Read replication is not a wrangler flag. Turn it on
95 // (`read_replication.mode: auto`) only after #554 recreates this
96 // database with a US primary. Public GETs already use
97 // withSession('first-unconstrained'); until then they run on the primary.
98 "migrations_dir": "drizzle",
99 },
100 ],
101}