Skip to content
// EFFECT DAYS 2026

CloudflareDecisionModel unstable

Cloudflare Clef implementation of DecisionModel over Workers AI REST.

4 exports Since v4.0.0 Source

Constructors

make

unstable
Since v4.0.0

Builds a decision service with tolerance for four-decimal probability rounding.

Details

Base64 data is sent with its media type, and data: URLs are sent unchanged. Clef shows images before the state, so with images the state is sent as text that first lists each image's reference in order. The API enforces image limits.

Gotchas

  • Remote URLs fail with AiError.InvalidUserInputError because Clef does not fetch them.

Signature

declare const make: (...args: [options: {
readonly model: "clef" | "clef-flash" | string & {};
}]) => Effect<DecisionModel, never, CloudflareClient>

model

unstable
Since v4.0.0

Creates a decision model with Cloudflare provider metadata.

Signature

declare function model(model: "clef" | "clef-flash" | string & {}): Model<"cloudflare", DecisionModel, CloudflareClient>

Layers

layer

unstable
Since v4.0.0

Provides DecisionModel using an existing CloudflareClient.

Signature

declare function layer(options: {
readonly model: "clef" | "clef-flash" | string & {};
}): Layer<DecisionModel, never, CloudflareClient>

Models

Model

type unstable
Since v4.0.0

Cloudflare Clef model identifiers.

Signature

type Model = typeof CloudflareSchema.DecisionsRequest.Encoded["model"]