Skip to content

Commit 384873b

Browse files
fix(cloudflare-ai-gateway): restore host capability, reasoning, and limit deltas
Curation could not author tool_call/attachment/modalities, so several Workers AI @cf entries silently re-inherited lab capabilities the same @cf peer marks false. Extend the curation schema + hosted generation to carry those host disables, and restore them for the six affected models (matching cloudflare-workers-ai peers). Align thinkingmachines/inkling reasoning_options with the lab toggle+effort shape (with the required wire-path note), and curate its served output ceiling (65_536) instead of inheriting the lab canon's 1M. Proxied limit now merges catalog context with curated fields so context stays catalog-derived. Regenerated live; gpt-5.5's flat catalog pricing (no cache/tier) confirmed as what Cloudflare's catalog returns, not dropped data. Co-Authored-By: Claude Opus 4.8 <[email protected]>
1 parent f7b7d28 commit 384873b

9 files changed

Lines changed: 53 additions & 6 deletions

File tree

‎packages/core/script/generate-cloudflare-ai-gateway.ts‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ const CuratedModel = z
6767
.object({
6868
base_model: z.string().min(1).optional(),
6969
structured_output: z.boolean().optional(),
70+
// Host-specific capability deltas the docs/catalog cannot express as a negative: a @cf
71+
// deployment often disables tool calling or vision that the lab model supports, and the
72+
// docs only ever advertise capabilities as `true` (absence != false). Curation carries the
73+
// verified host disable so it survives regeneration instead of re-inheriting the lab value.
74+
tool_call: z.boolean().optional(),
75+
attachment: z.boolean().optional(),
76+
modalities: z
77+
.object({ input: z.array(z.string()).optional(), output: z.array(z.string()).optional() })
78+
.strict()
79+
.optional(),
7080
reasoning_options: z.array(ReasoningOption).optional(),
7181
limit: z.record(z.number()).optional(),
7282
interleaved: z
@@ -421,8 +431,8 @@ async function main() {
421431
// 4-8x). Only context_length has checked out, so that's all we auto-derive; output is
422432
// either curated explicitly or left to inherit from base_model.
423433
const limit: Record<string, number> = {};
424-
if (cur.limit) Object.assign(limit, cur.limit);
425-
else if (m.context_length != null) limit.context = m.context_length;
434+
if (m.context_length != null) limit.context = m.context_length;
435+
if (cur.limit) Object.assign(limit, cur.limit); // curation overrides/adds (e.g. served output)
426436
if (Object.keys(limit).length) model.limit = limit;
427437

428438
const npm = nativeNpm(id);
@@ -450,8 +460,13 @@ async function main() {
450460
// name/description inherit from base_model; docs only expose the raw @cf id as "name".
451461
const model: Record<string, unknown> = { base_model: cur.base_model };
452462

453-
if (hostedProp(docs, "function_calling") === "true") model.tool_call = true;
454-
if (hostedProp(docs, "vision") === "true") model.attachment = true;
463+
// Docs advertise capabilities only as `true` (absence != false), so a curated explicit value
464+
// — typically a verified host disable the same @cf peer marks false — overrides the docs.
465+
if (cur.tool_call !== undefined) model.tool_call = cur.tool_call;
466+
else if (hostedProp(docs, "function_calling") === "true") model.tool_call = true;
467+
if (cur.attachment !== undefined) model.attachment = cur.attachment;
468+
else if (hostedProp(docs, "vision") === "true") model.attachment = true;
469+
if (cur.modalities !== undefined) model.modalities = cur.modalities;
455470
if (cur.structured_output !== undefined) model.structured_output = cur.structured_output;
456471
// interleaved: whether this @cf deployment returns reasoning content as a separate wire
457472
// field. Not part of the docs schema and not inheritable from base_model (the lab's own

‎providers/cloudflare-ai-gateway/curation.toml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,12 @@ note = [
210210
reasoning_options = [{ type = "toggle" }, { type = "effort", values = ["low", "high", "max"] }]
211211

212212
[models."thinkingmachines/inkling"]
213-
reasoning_options = []
213+
note = [
214+
"Tinker's Anthropic-compatible route: thinking.type = adaptive|disabled toggles reasoning;",
215+
"output_config.effort = low|medium|high|xhigh|max sets effort.",
216+
]
217+
reasoning_options = [{ type = "toggle" }, { type = "effort", values = ["low", "medium", "high", "xhigh", "max"] }]
218+
limit = { output = 65_536 }
214219

215220
[models."workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it"]
216221
base_model = "aisingapore/gemma-sea-lion-v4-27b-it"
@@ -253,11 +258,13 @@ limit = { output = 131_000 }
253258

254259
[models."workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8"]
255260
base_model = "meta/llama-3.1-8b-instruct"
261+
tool_call = false
256262
structured_output = false
257263
limit = { output = 32_000 }
258264

259265
[models."workers-ai/@cf/meta/llama-3.2-11b-vision-instruct"]
260266
base_model = "meta/llama-3.2-11b-vision-instruct"
267+
tool_call = false
261268
structured_output = false
262269
limit = { output = 128_000 }
263270

@@ -273,6 +280,7 @@ limit = { output = 80_000 }
273280

274281
[models."workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast"]
275282
base_model = "meta/llama-3.3-70b-instruct"
283+
attachment = false
276284
structured_output = false
277285
limit = { output = 24_000 }
278286

@@ -287,6 +295,8 @@ limit = { output = 131_072 }
287295

288296
[models."workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct"]
289297
base_model = "mistral/mistral-small-3-1-24b-instruct-2503"
298+
attachment = false
299+
modalities = { input = ["text"], output = ["text"] }
290300
structured_output = false
291301
limit = { output = 128_000 }
292302

@@ -340,6 +350,7 @@ limit = { output = 16_384 }
340350

341351
[models."workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct"]
342352
base_model = "alibaba/qwen2.5-coder-32b-instruct"
353+
tool_call = false
343354
structured_output = false
344355
limit = { output = 32_768 }
345356

@@ -351,6 +362,7 @@ limit = { output = 32_768 }
351362

352363
[models."workers-ai/@cf/qwen/qwq-32b"]
353364
base_model = "alibaba/qwq-32b"
365+
tool_call = false
354366
structured_output = false
355367
reasoning_options = []
356368
limit = { output = 24_000 }

‎providers/cloudflare-ai-gateway/models/thinkingmachines/inkling.toml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
# Tinker's Anthropic-compatible route: thinking.type = adaptive|disabled toggles reasoning;
2+
# output_config.effort = low|medium|high|xhigh|max sets effort.
3+
14
base_model = "thinkingmachines/inkling"
2-
reasoning_options = []
5+
6+
[[reasoning_options]]
7+
type = "toggle"
8+
9+
[[reasoning_options]]
10+
type = "effort"
11+
values = ["low", "medium", "high", "xhigh", "max"]
312

413
[cost]
514
input = 1.87
@@ -9,3 +18,4 @@ cache_write = 1.87
918

1019
[limit]
1120
context = 64_000
21+
output = 65_536

‎providers/cloudflare-ai-gateway/models/workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
base_model = "meta/llama-3.1-8b-instruct"
2+
tool_call = false
23
structured_output = false
34

45
[cost]

‎providers/cloudflare-ai-gateway/models/workers-ai/@cf/meta/llama-3.2-11b-vision-instruct.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
base_model = "meta/llama-3.2-11b-vision-instruct"
22
attachment = true
3+
tool_call = false
34
structured_output = false
45

56
[cost]

‎providers/cloudflare-ai-gateway/models/workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
base_model = "meta/llama-3.3-70b-instruct"
2+
attachment = false
23
tool_call = true
34
structured_output = false
45

‎providers/cloudflare-ai-gateway/models/workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
base_model = "mistral/mistral-small-3-1-24b-instruct-2503"
2+
attachment = false
23
tool_call = true
34
structured_output = false
45

@@ -9,3 +10,7 @@ output = 0.56
910
[limit]
1011
context = 128_000
1112
output = 128_000
13+
14+
[modalities]
15+
input = ["text"]
16+
output = ["text"]

‎providers/cloudflare-ai-gateway/models/workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
base_model = "alibaba/qwen2.5-coder-32b-instruct"
2+
tool_call = false
23
structured_output = false
34

45
[cost]

‎providers/cloudflare-ai-gateway/models/workers-ai/@cf/qwen/qwq-32b.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
base_model = "alibaba/qwq-32b"
2+
tool_call = false
23
structured_output = false
34
reasoning_options = []
45

0 commit comments

Comments
 (0)