feat(ai): add Cloudflare Clef classifiers to Workers AI (#10316)

builds on https://github.com/earendil-works/pi/pull/10322 by @RealAlexandreAI
This commit is contained in:
Nathan Disidore 2026-10-02 09:52:58 -05:00 • committed by GitHub
parent c10bfb0d79
commit 4812cb268e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 83 additions and 9 deletions

View file

@ -2738,6 +2738,32 @@ const OPENCODE_CLASSIFIER_MODELS: ClassifierModel<"typesafe-system-one">[] = [
];
const CLOUDFLARE_WORKERS_AI_CLASSIFIER_MODELS: ClassifierModel<"cloudflare-workers-ai-system-one">[] = [
// Cloudflare-hosted Clef decision models. They accept images, but classifier
// contexts carry text or JSON state only, so the catalog advertises text.
// Pricing: https://developers.cloudflare.com/workers-ai/models/clef/
// and https://developers.cloudflare.com/workers-ai/models/clef-flash/
{
type: "classifier",
id: "@cf/cloudflare/clef",
name: "Clef",
api: "cloudflare-workers-ai-system-one",
provider: "cloudflare-workers-ai",
baseUrl: CLOUDFLARE_WORKERS_AI_REST_BASE_URL,
input: ["text"],
cost: { input: 0.24, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 65536,
},
{
type: "classifier",
id: "@cf/cloudflare/clef-flash",
name: "Clef Flash",
api: "cloudflare-workers-ai-system-one",
provider: "cloudflare-workers-ai",
baseUrl: CLOUDFLARE_WORKERS_AI_REST_BASE_URL,
input: ["text"],
cost: { input: 0.09, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 65536,
},
{
type: "classifier",
id: "typesafe/jev",