diff --git a/src/components/models/ModelDetailPage.astro b/src/components/models/ModelDetailPage.astro index 39cdb393308..a0e72c90fb3 100644 --- a/src/components/models/ModelDetailPage.astro +++ b/src/components/models/ModelDetailPage.astro @@ -49,6 +49,7 @@ import DeepgramAura from "~/components/models/code/DeepgramAura.astro"; import BgeRerankerBase from "~/components/models/code/Bge-Reranker-Base.astro"; import Flux1Schnell from "~/components/models/code/Flux-1-Schnell.astro"; import ClefCode from "~/components/models/code/ClefCode.astro"; +import ClairicCode from "~/components/models/code/ClairicCode.astro"; interface Props { model: ModelView; @@ -77,6 +78,9 @@ const isClef = [ "@cf/cloudflare/clef-omni", ].includes(model.name); +// Clairic extraction models take typed fields, not chat messages. +const isClairic = model.name === "@cf/cloudflare/clairic"; + // Legacy code-example overrides (only used when there is no catalog usage). let CodeExamples: any = null; if (!hasCatalogUsage) { @@ -114,6 +118,9 @@ if (!hasCatalogUsage) { if (isClef) { CodeExamples = ClefCode; } + if (isClairic) { + CodeExamples = ClairicCode; + } } const hasCodeExamples = hasCatalogUsage || !!CodeExamples; @@ -145,7 +152,7 @@ function bannerAsideType( // exclusion (gpt-oss is not in our slice — kept as a documented dead branch). let hasPlayground = model.task === "Text Generation" && model.hosting === "hosted"; -if (model.name.includes("@cf/openai/gpt-oss") || isClef) { +if (model.name.includes("@cf/openai/gpt-oss") || isClef || isClairic) { hasPlayground = false; } @@ -240,6 +247,7 @@ const headings: MarkdownHeading[] = [ hasRemainingExamples && { depth: 2, slug: "examples", text: "Examples" }, hasSchema && { depth: 2, slug: "parameters", text: "Parameters" }, hasSchema && { depth: 2, slug: "api-schemas", text: "API Schemas (Raw)" }, + isClairic && { depth: 2, slug: "terms", text: "Terms" }, ].filter(Boolean) as MarkdownHeading[]; --- @@ -687,4 +695,24 @@ const headings: MarkdownHeading[] = [ )} + + {isClairic && ( + + +

+ You may access or use this model at your sole discretion. Cloudflare + does not make any representations, warranties, or guarantees regarding + the model, including, but not limited to, as to its continued + availability and integrity. If Cloudflare makes the model available to + you, it is on an “AS IS” and “AS AVAILABLE” basis, and Cloudflare has no + obligation to indemnify you for any claims arising from your use of the + model. Cloudflare may cease providing it without entitling you to any + refund, credit, or other compensation. Cloudflare will not be directly + or indirectly responsible or liable to you in any manner, for any harms, + damages, loss, lost profits, special or consequential damages, or + claims, arising out of or in connection with the use of, or reliance on + the performance of the model. +

+
+ )} diff --git a/src/components/models/ModelFeatures.astro b/src/components/models/ModelFeatures.astro index 85cd5d29a34..27f6655df85 100644 --- a/src/components/models/ModelFeatures.astro +++ b/src/components/models/ModelFeatures.astro @@ -89,9 +89,13 @@ const reasoning = formatModelReasoning( Terms and License - - link ↗ - + {String(properties.terms).startsWith("#") ? ( + link + ) : ( + + link ↗ + + )} )} diff --git a/src/components/models/code/ClairicCode.astro b/src/components/models/code/ClairicCode.astro new file mode 100644 index 00000000000..389d902c5ec --- /dev/null +++ b/src/components/models/code/ClairicCode.astro @@ -0,0 +1,157 @@ +--- +import { z } from "astro/zod"; +import { Code } from "~/components/ui/code"; +import { Tabs, TabItem } from "~/components/ui/tabs"; + +type Props = z.infer; + +const props = z.object({ + name: z.string(), +}); + +const { name } = props.parse(Astro.props); + +// Request body `model` selector is the last segment of the model ID. +const selector = name.split("/").at(-1); + +const state = + "Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 each, shipping $80.00. Contact: Dana Ruiz, Priya Shah."; + +const worker = ` +export interface Env { + AI: Ai; +} + +export default { + async fetch(request, env): Promise { + const response = await env.AI.run("${name}", { + model: "${selector}", + state: "${state}", + fields: { + invoice_number: { type: "text" }, + due_date: { + type: "date", + instructions: "Issue date plus the net payment days", + }, + total: { + type: "number", + decimals: 2, + unit: "USD", + instructions: "Amount due including shipping", + }, + contacts: { type: "list", items: "text" }, + po_number: { type: "text", instructions: "Purchase order number" }, + days_to_pay: { + type: "estimate", + min: 0, + max: 120, + step: 1, + instructions: "Days after issue until this invoice is paid", + }, + }, + }); + + // response.answers.invoice_number -> exact span of the state, with character offsets + // response.answers.due_date -> date worked out from the issue date and terms + // response.answers.po_number -> null: the invoice has no PO number + // response.answers.days_to_pay -> median and 80% interval (p10 to p90) + return Response.json(response); + }, +} satisfies ExportedHandler; +`; + +const python = ` +import os +import requests + +ACCOUNT_ID = "your-account-id" +AUTH_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN") + +response = requests.post( + f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/${name}", + headers={"Authorization": f"Bearer {AUTH_TOKEN}"}, + json={ + "model": "${selector}", + "state": "${state}", + "fields": { + "invoice_number": {"type": "text"}, + "due_date": { + "type": "date", + "instructions": "Issue date plus the net payment days", + }, + "total": { + "type": "number", + "decimals": 2, + "unit": "USD", + "instructions": "Amount due including shipping", + }, + "contacts": {"type": "list", "items": "text"}, + "po_number": {"type": "text", "instructions": "Purchase order number"}, + "days_to_pay": { + "type": "estimate", + "min": 0, + "max": 120, + "step": 1, + "instructions": "Days after issue until this invoice is paid", + }, + }, + }, +) +print(response.json()) +`; + +const curl = ` +curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/${name} \\ + -X POST \\ + -H "Authorization: Bearer $CLOUDFLARE_AUTH_TOKEN" \\ + -d '{ + "model": "${selector}", + "state": "${state}", + "fields": { + "invoice_number": { "type": "text" }, + "due_date": { "type": "date", "instructions": "Issue date plus the net payment days" }, + "total": { "type": "number", "decimals": 2, "unit": "USD", "instructions": "Amount due including shipping" }, + "contacts": { "type": "list", "items": "text" }, + "po_number": { "type": "text", "instructions": "Purchase order number" }, + "days_to_pay": { + "type": "estimate", + "min": 0, + "max": 120, + "step": 1, + "instructions": "Days after issue until this invoice is paid" + } + } + }' +`; + +// Real response to the request above (Workers AI wraps it in `result`); probabilities rounded. +const response = ` +{ + "model": "clairic", + "answers": { + "invoice_number": {"type": "text", "p_null": 3.8e-10, "span": [8, 16], "guess": "INV-2291", "confidence": 1, "value": "INV-2291"}, + "due_date": {"type": "date", "p_null": 1.9e-08, "guess": "2026-10-02", "confidence": 0.9999, "value": "2026-10-02"}, + "total": {"type": "number", "p_null": 2.3e-08, "guess": 1080, "confidence": 0.9999, "value": 1080}, + "contacts": {"type": "list", "value": ["Dana Ruiz", "Priya Shah"], "spans": [[120, 129], [131, 141]], "confidence": 0.9999}, + "po_number": {"type": "text", "p_null": 1, "span": [8, 16], "guess": "INV-2291", "confidence": 0.9995, "value": null}, + "days_to_pay": {"type": "estimate", "value": 30, "mean": 29.535, "median": 30, "p10": 21, "p90": 38, "p_below": 5.9e-06, "p_above": 1.2e-05} + }, + "truncated": false, + "usage": {"state_tokens": 61, "image_tokens": 0, "schema_tokens": 472, "input_tokens": 655, "output_tokens": 0, "passes": 3} +} +`; +--- + + + + + + + + + + + + + + diff --git a/src/content/changelog/workers-ai/2026-10-19-clairic-workers-ai.mdx b/src/content/changelog/workers-ai/2026-10-19-clairic-workers-ai.mdx new file mode 100644 index 00000000000..59e4b8d6178 --- /dev/null +++ b/src/content/changelog/workers-ai/2026-10-19-clairic-workers-ai.mdx @@ -0,0 +1,84 @@ +--- +title: "Introducing Clairic: an extraction model for typed values, now on Workers AI" +description: Clairic is a preview of a new class of System One models, extraction models. It extracts, computes, estimates, and forecasts values from your input, and returns typed answers with confidence scores in a single pass. +products: + - workers-ai +date: 2026-10-19 +--- + +import { TypeScriptExample } from "~/components"; + +[`@cf/cloudflare/clairic`](/workers-ai/models/clairic/) is now available on Workers AI as a preview. Clairic is the first [extraction model](/workers-ai/concepts/extraction-models/): a System One model that answers with values instead of text. We intend to release the model with open weights soon. + +Decision models such as [Clef](/workers-ai/models/clef/) choose among options you define up front. Many structured-output tasks do not have answers you can list in advance: an invoice total, a delivery date, the number of days a shipment is late, or what a repair will cost. Clairic handles these. You send a state and a schema of typed fields, and it returns one typed value per field. A value is read from the input, computed from it, or predicted beyond it. + +Clairic does not generate tokens. It reads your input in one pass and decodes each answer under the rules of its type, so every answer is a valid value of the type you asked for, or `null` when the input does not determine it. + +## Typed fields + +Define as many fields as you need. Fields that do not fit beside the input in one pass are split across parallel passes, so there is no upper limit. + +| Type | Returns | +| -------------------------- | ----------------------------------------------------------------------------------------- | +| `text` | An exact span of the input, with its character offsets | +| `number` | A number read or worked out from the input, honoring `integer` and `decimals` | +| `date`, `time`, `datetime` | Real calendar dates and valid times, in ISO form | +| `duration` | A length of time in the unit you choose | +| `list` | Every matching text, number, or date, in input order | +| `estimate` | A distribution inside your `min` and `max`, on your `step` grid, on a linear or log scale | +| `forecast` | One estimate per future step of a series, up to 64 steps | + +Every scalar answer includes `p_null`, the probability that the input does not determine the value, and a `confidence` score. Estimates and forecasts include a median and an 80% interval (`p10` to `p90`). Set `options.include_quantiles` to also get all 99 percentiles. Use these to decide what to automate and what to send to review. + +You can also pass up to four images alongside the state. + + + +```ts +const response = await env.AI.run("@cf/cloudflare/clairic", { + model: "clairic", + state: + "Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 each, shipping $80.00. Contact: Dana Ruiz, Priya Shah.", + fields: { + invoice_number: { type: "text" }, + issued: { type: "date" }, + due_date: { + type: "date", + instructions: "Issue date plus the net payment days", + }, + total: { + type: "number", + decimals: 2, + unit: "USD", + instructions: "Amount due including shipping", + }, + contacts: { type: "list", items: "text" }, + }, +}); + +// response.answers.invoice_number.value -> "INV-2291", with its span in the state +// response.answers.total.value -> the amount due, with p_null and confidence +``` + + + +## Preview + +The current endpoint is an early checkpoint, and we expect it to improve: + +- **Arithmetic**: One- and two-step calculations, such as totals, differences, conversions, and date arithmetic, are reliable. Long chains of dependent steps and aggregations across many table rows are not yet. Extract the inputs with Clairic and do the math in code. +- **Estimates**: Clairic estimates best when the input contains evidence such as comparables, history, or descriptive text. Without evidence, the interval is wide. +- **Forecasts**: Forecasting is basic. Next-step forecasts follow recent patterns, but forecasts several steps out flatten toward the average, and Clairic does not anticipate events the series does not show, such as holidays. It does not replace a time-series model trained on your data. +- **Calibration**: Intervals are trained to be calibrated and are on most held-out sets, but they can run narrow on unfamiliar data. +- **Confidence**: Every answer is well formed, not necessarily correct. Use `confidence`, `p_null`, and the intervals to decide what to automate and what to send to review. +- **Dates**: Dates without a year are resolved from context. If a field depends on the current date, set `reference_date` or add a line such as `Today: 2026-10-19` to the state. + +## Pricing + +Clairic costs $0.10 per million input tokens. Because it generates no tokens, there is no output token charge. + +## Get started + +Use Clairic through the [Workers AI binding](/workers-ai/configuration/bindings/) (`env.AI.run()`) or the REST API at `/ai/run`. You can also use [AI Gateway](/ai-gateway/) with these endpoints. + +For more information, refer to the [Clairic model page](/workers-ai/models/clairic/), [extraction models](/workers-ai/concepts/extraction-models/), [pricing](/workers-ai/platform/pricing/), and the [blog post](https://blog.cloudflare.com/clairic-extraction-model/). diff --git a/src/content/docs/workers-ai/concepts/extraction-models.mdx b/src/content/docs/workers-ai/concepts/extraction-models.mdx new file mode 100644 index 00000000000..86c78fe8ee9 --- /dev/null +++ b/src/content/docs/workers-ai/concepts/extraction-models.mdx @@ -0,0 +1,119 @@ +--- +pcx_content_type: concept +title: Extraction models +description: Understand how extraction models extract, compute, estimate, and forecast typed values, and how to interpret their results. +sidebar: + order: 1 +products: + - workers-ai +--- + +Extraction models turn information into specific values your application can use, such as an invoice total, a due date, or an estimated payment amount. They return typed values rather than choosing from a fixed set of options or producing open-ended content. This helps you connect AI predictions to application logic. + +You provide an input state and define the values you want the model to return, including each value's type and any additional constraints. The model uses these definitions and the input state to produce a corresponding typed result for each value. Typed results provide a predictable structure but do not guarantee correctness. + +## When to use extraction models + +Use an extraction model when your application needs to extract, compute, estimate, or forecast a value, such as an amount, date, or duration. Alternatively, use a decision model to select from known options, or a generative model to produce open-ended content. + +The following table compares these model types using invoice examples: + +| Model type | Use when you need | Invoice example | +| ---------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| Extraction | Extract, compute, estimate, or forecast values, such as amounts, dates, durations, or text. | Read the total and due date from an invoice. | +| Decision | Select from a predefined set of options. | Determine if an invoice requires approval, manual review, or rejection. | +| Generative | Produce open-ended content. | Summarize discrepancies between the invoice, purchase order, and delivery receipt. | + +Your application can use returned values in application logic or pass them as inputs to another model. + +## How extraction models work + +An extraction request combines an input state with a set of named field definitions. The input state supplies the information the model evaluates. Each field definition describes a value to return, specifies its type, and may include constraints. The model uses both to produce a corresponding result for each field. + +For example, you provide invoice text that states a total of $1,080 and a due date of 2026-11-01. Separately, you define an invoice total field as a number in USD and a due date field as a date. + +The model uses these definitions to identify the requested values in the invoice. It returns `1080` and `2026-11-01` as the corresponding typed results. + +Your application can then use the returned values. For example, it can compare the due date with the current date to flag an overdue invoice. + +## Extraction model capabilities + +Extraction models support extraction, computation, estimation, and forecasting. + +### Extraction + +Return a value explicitly present in the input, such as the total printed on an invoice. Extraction identifies an existing value rather than calculating or estimating one. + +### Computation + +Derive a value from facts in the input. For example, calculate how many days an invoice is overdue using its due date and a current date you provide. Unlike extraction, the result does not need to appear explicitly in the input. + +### Estimation + +Predict a value that the input does not determine, such as when an unpaid invoice will be paid. Unlike computation, estimation addresses an unknown outcome rather than deriving a result from supplied facts. + +### Forecasting + +Predict a sequence of future values over an interval, such as an invoice's outstanding balance each week for the next month. Unlike a single estimate, a forecast returns a value for each step in the requested period. + +## Interpret extraction results + +Types and constraints define the form a result can take. They do not guarantee that it answers your question correctly. + +### Missing results + +For fields that extract or compute a single value, a `null` result indicates that the model considers the input insufficient to determine the answer. The information may be missing, or the model may have failed to identify it. + +Lists return an empty list when the model finds no matching values. Estimates and forecasts return predictions even when the input provides little information. + +### Uncertainty + +The field type determines how uncertainty is represented and how it can be interpreted. Fields that extract and compute a single value include confidence scores for the returned answer. Estimates and forecasts include distributions over possible values. + +For example, an estimated payment date might have a 10th percentile of November 5 and a 90th percentile of November 20. These dates mark the middle 80% of the predicted distribution. The actual payment date can still fall outside that interval. + +### Constraints + +Constraints restrict the values the model can return. They do not guarantee that the answer is correct. + +For example, restricting an estimated payment date to November ensures that the returned date falls in November. The invoice could still be paid in December. + +### Source spans + +Extracted text includes a source span, which identifies its start and end positions in the input. You can use these positions to find the returned text in its original context. + +## Design extraction tasks + +### Define clear fields + +Give each field a descriptive name and use its instructions to explain what value to return. For example, a field named `invoice_total` could have the instructions "Total amount due, including tax and shipping, after discounts." Specify its type and unit separately as a number in USD. + +### Choose appropriate types and constraints + +Set each field's type according to how your application uses the result. For example, use a date for a payment deadline and a duration for days overdue. + +Use the available field settings to specify precision and value bounds. For example, request two decimal places for an invoice amount. When bounding an estimated payment date, choose a window that reflects plausible payment dates, not just your preferred deadline. + +### Include task-relevant context + +Include the information each task depends on in the input state. For example, calculating days overdue requires the invoice's due date and a current date you provide. State which date to use rather than assuming the model knows when the request runs. + +### Match safeguards to risk + +Choose safeguards based on the consequences of an incorrect result. Displaying an estimated payment date may require fewer checks than using an extracted amount to authorize a payment. + +Decide how your application handles missing or uncertain results. Before consequential or irreversible actions, check results against other evidence or require human review. + +## Limitations + +- Typed output does not guarantee correctness. A result can satisfy its type and constraints while still answering the question incorrectly. +- Results depend on the available information and field definitions. Returning an estimate does not mean the input provides enough information to predict the outcome accurately. +- Uncertainty estimates are not guarantees. Confidence scores and prediction intervals do not replace application-level checks. An interval's actual coverage can vary across tasks and datasets. +- Capabilities vary by model. Consult the [Clairic model documentation](/workers-ai/models/clairic/) for supported inputs, field types, metadata, context window, and model-specific limitations. + +## Next steps + +- Review the [Clairic model reference](/workers-ai/models/clairic/) for supported inputs, field types, model-specific limits, request and response schemas, and invoice examples. +- Consult the [Workers AI REST API reference](/api/resources/ai/methods/run/) for the inference endpoint. +- [Configure a Workers AI binding](/workers-ai/configuration/bindings/) to access Workers AI from a Worker. +- [Use the Workers AI REST API](/workers-ai/get-started/rest-api/) to authenticate and send requests over HTTP. diff --git a/src/content/docs/workers-ai/concepts/index.mdx b/src/content/docs/workers-ai/concepts/index.mdx new file mode 100644 index 00000000000..6540f7e662f --- /dev/null +++ b/src/content/docs/workers-ai/concepts/index.mdx @@ -0,0 +1,15 @@ +--- +pcx_content_type: navigation +title: Concepts +description: Understand the model types and key ideas behind building applications with Workers AI. +sidebar: + group: + hideIndex: true + order: 1.5 +products: + - workers-ai +--- + +import { DirectoryListing } from "~/components"; + + diff --git a/src/content/docs/workers-ai/platform/pricing.mdx b/src/content/docs/workers-ai/platform/pricing.mdx index 2c2059a4388..cc4fcf3e602 100644 --- a/src/content/docs/workers-ai/platform/pricing.mdx +++ b/src/content/docs/workers-ai/platform/pricing.mdx @@ -136,3 +136,4 @@ The Price in Tokens column is equivalent to the Price in Neurons column - the di | @cf/cloudflare/clef | $0.240 per M input tokens | 21818 neurons per M input tokens | | @cf/cloudflare/clef-omni | $0.150 per M input tokens | 13636 neurons per M input tokens | | @cf/cloudflare/clef-flash | $0.038 per M input tokens | 3455 neurons per M input tokens | +| @cf/cloudflare/clairic | $0.100 per M input tokens | 9091 neurons per M input tokens | diff --git a/src/content/workers-ai-models/clairic.json b/src/content/workers-ai-models/clairic.json new file mode 100644 index 00000000000..250d817edd1 --- /dev/null +++ b/src/content/workers-ai-models/clairic.json @@ -0,0 +1,313 @@ +{ + "name": "@cf/cloudflare/clairic", + "properties": [ + { + "property_id": "context_window", + "value": "65536" + }, + { + "property_id": "vision", + "value": "true" + }, + { + "property_id": "terms", + "value": "#terms" + }, + { + "property_id": "price", + "value": [ + { + "unit": "per M input tokens", + "price": 0.1, + "currency": "USD" + } + ] + } + ], + "id": "6b0b79c1-25e6-4498-bb62-5161df39f0ef", + "source": 1, + "description": "Clairic is a System One-style model that can extract, compute, estimate, and forecast values from inputs. It is strongly typed and outputs confidence scores and probabilities against its outputs. This model is in preview from the Cloudflare Workers AI team.", + "task": { + "id": "c329a1f9-323d-4e91-b2aa-582dd4188d34", + "name": "Text Generation", + "description": "Family of generative text models, such as large language models (LLM), that can be adapted for a variety of natural language tasks." + }, + "created_at": "2026-10-14 05:34:04.680", + "tags": [], + "schema": { + "input": { + "type": "object", + "properties": { + "model": { + "type": "string", + "pattern": "^(clairic|@cf/cloudflare/clairic)$", + "default": "clairic", + "description": "Required. The model selector: \"clairic\"." + }, + "state": { + "type": "string", + "default": "", + "description": "The text to read and predict from. Must be non-empty unless images are sent. Text answers are spans of this string." + }, + "fields": { + "type": "object", + "description": "Required. Map of field name to a typed field spec. At least one field; no upper limit. Fields that do not fit next to the state in one 8,192-token pass are split across parallel passes.", + "minProperties": 1, + "propertyNames": { + "pattern": "^[A-Za-z_][A-Za-z0-9_.\\-]{0,63}$" + }, + "additionalProperties": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text", + "number", + "date", + "time", + "datetime", + "duration", + "list", + "estimate", + "forecast" + ] + }, + "instructions": { + "type": "string", + "description": "What the field should contain." + }, + "unit": { + "type": "string", + "description": "Unit label. For durations, one of seconds, minutes, hours, days, weeks, months, years (default seconds)." + }, + "integer": { + "type": "boolean", + "description": "Numbers and durations only." + }, + "decimals": { + "type": "integer", + "minimum": 0, + "maximum": 6, + "description": "Numbers, durations and number lists only." + }, + "items": { + "type": "string", + "enum": [ + "text", + "number", + "date" + ], + "description": "Required for list fields." + }, + "min": { + "description": "Required for estimate/forecast: a number, or an ISO date for date estimates." + }, + "max": { + "description": "Required for estimate/forecast: a number, or an ISO date for date estimates." + }, + "step": { + "description": "Estimate grid: a positive number (days for date estimates), or \"month\" / \"year\"." + }, + "scale": { + "type": "string", + "enum": [ + "linear", + "log" + ], + "default": "linear" + }, + "null_threshold": { + "type": "number", + "exclusiveMinimum": 0, + "maximum": 1, + "description": "Probability of null above which the value is null (default 0.5)." + }, + "horizon": { + "type": "integer", + "minimum": 1, + "maximum": 64, + "description": "Forecast only: number of steps." + }, + "interval": { + "type": "string", + "enum": [ + "step", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "description": "Forecast only." + } + }, + "required": [ + "type" + ] + } + }, + "images": { + "type": "array", + "description": "Optional embedded PNG, JPEG or WebP images placed before the state (max 4; 4 MiB each, 8 MiB total decoded; request body max 16 MiB). Remote URLs are not accepted.", + "maxItems": 4, + "items": { + "anyOf": [ + { + "type": "string", + "title": "Data URL", + "pattern": "^[Dd][Aa][Tt][Aa]:" + }, + { + "type": "object", + "title": "Base64 image", + "properties": { + "content_type": { + "type": "string" + }, + "base64": { + "type": "string" + } + }, + "required": [ + "content_type", + "base64" + ] + } + ] + } + }, + "reference_date": { + "type": "string", + "description": "ISO date that anchors dates written without a year." + }, + "options": { + "type": "object", + "properties": { + "include_quantiles": { + "type": "boolean", + "default": false, + "description": "Add 99 percentiles to estimates." + }, + "return_state_text": { + "type": "boolean", + "default": false, + "description": "Return the text that spans index into." + } + } + } + }, + "required": [ + "model", + "fields" + ] + }, + "output": { + "type": "object", + "contentType": "application/json", + "properties": { + "model": { + "type": "string" + }, + "answers": { + "type": "object", + "description": "One answer per field, keyed by field name. value is null when the input does not determine it.", + "additionalProperties": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "value": {}, + "guess": {}, + "p_null": { + "type": "number" + }, + "confidence": { + "type": "number" + }, + "span": { + "type": "array", + "items": { + "type": "integer" + } + }, + "spans": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "mean": {}, + "median": {}, + "p10": {}, + "p90": {}, + "p_below": { + "type": "number" + }, + "p_above": { + "type": "number" + }, + "quantiles": { + "type": "array" + }, + "steps": { + "type": "array", + "description": "Forecast only: one estimate per step." + } + }, + "required": [ + "type", + "value" + ] + } + }, + "truncated": { + "type": "boolean" + }, + "state_text": { + "type": "string" + }, + "usage": { + "type": "object", + "properties": { + "state_tokens": { + "type": "integer" + }, + "image_tokens": { + "type": "integer" + }, + "schema_tokens": { + "type": "integer" + }, + "input_tokens": { + "type": "integer" + }, + "output_tokens": { + "type": "integer" + }, + "passes": { + "type": "integer" + } + }, + "required": [ + "input_tokens", + "output_tokens" + ] + } + }, + "required": [ + "model", + "answers", + "truncated", + "usage" + ] + } + }, + "deprecated": false +} \ No newline at end of file diff --git a/src/util/models/facets.ts b/src/util/models/facets.ts index 45900128d18..be2322a2145 100644 --- a/src/util/models/facets.ts +++ b/src/util/models/facets.ts @@ -35,6 +35,7 @@ export const pinnedModelNames: string[] = [ "@cf/cloudflare/clef", "@cf/cloudflare/clef-omni", "@cf/cloudflare/clef-flash", + "@cf/cloudflare/clairic", ]; const providerSlug = (model: ModelCardData): string =>