Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

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

Byte arrays and base64 strings are sent as base64 with their media type. data: URLs are sent unchanged. 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"]