skip to content

As the lead of a support-ticket product, how do you decide whether summaries and draft replies run on Workers AI or on an external model provider behind AI Gateway?

level: principalimportance: should knowfreq 20%

answer

  1. decide per workload, not per product
  2. open catalogue versus frontier models
  3. rate limits differ by model
  4. the catalogue changes under you
  5. one gateway for both paths

basics

~20 s

Decide per workload: high-volume summaries and embeddings usually fit Workers AI's catalogue models, billed in neurons and called through a binding, while draft replies go wherever an evaluation on real tickets says quality justifies the cost, with every call routed through one AI Gateway.

solid answer

~50 s

I would decide per workload against measured quality, cost per ticket, limits and churn. Workers AI keeps inference on Cloudflare with no provider keys: summaries and embeddings, which are high-volume and tolerant of a smaller open model, usually belong there, billed in neurons. Draft replies are where a frontier model from an external provider may earn its price, so both candidates are scored on a few hundred real tickets. The limits shape the choice too: text generation defaults to 300 requests a minute, while Workers AI models that require Workers Paid get 20 per account per model, or 50 with prepaid gateway credits. The catalogue also churns, as the May 2026 retirements and the alias from `@cf/moonshotai/kimi-k2.5` to a pricier model showed. Whichever wins, every call goes through the gateway option, so cost and logs compare like with like, and the model id lives in one config the team owns.

go deeper

for a junior

Know that Workers AI serves a catalogue of models through a binding, and that external providers can be reached through AI Gateway.

for a middle

Explain the cost and limit differences: neurons per model, 300 requests a minute by default, and lower limits on models that require Workers Paid.

for a senior

Show how capacity errors, deprecations and embedding lock-in change what a safe fallback looks like for each workload.

for a principal

Own the per-workload choice: evaluation on real tickets, model ids in one owned config, one gateway for comparable logs, and written triggers to revisit.

## The decision The support-ticket product makes three kinds of model call: a **summary** of every ticket, a **draft reply** an agent edits, and an **embedding** for search. The lead has to decide, for each, whether it runs on **Workers AI** (Cloudflare's catalogue, called through the `ai` binding) or on an **external model provider** reached through AI Gateway, and who may change that choice later. There is no single right answer; the useful move is to make the choice per workload, with written criteria and triggers to revisit it. ## What Workers AI offers - **No provider keys.** The binding carries the account's identity, so Workers never hold an API key for inference. - **Neuron pricing per model.** Small models are cheap; for example a 1,500-token ticket summarised in 200 tokens costs about 26 neurons on `@cf/meta/llama-3.1-8b-instruct-fp8`, with $0.011 per 1,000 neurons beyond the daily 10,000 on Workers Paid. - **Data terms.** Cloudflare's data-usage page says it does not use customer inputs and outputs to train the models it serves, and that content may be stored when you use a storage product such as R2 or KV alongside it. - **The catalogue is open-weight and changes.** On May 30, 2026, eighteen older models were deprecated, and requests to `@cf/moonshotai/kimi-k2.5` were aliased to `@cf/moonshotai/kimi-k2.6`, which costs more. In July 2026 some frontier models became Workers Paid only. ## The limits that shape the choice | Constraint | Value as of 2026-10-10 | |---|---| | Default text-generation rate limit | 300 requests per minute | | Models that require Workers Paid | 20 requests per minute per account per model, or 50 with prepaid AI Gateway credits | | Text embeddings | 3,000 requests per minute (1,500 for `bge-large-en-v1.5`) | | Capacity shortage | HTTP 429 with code `3040`; `rejectIfBusy` fails fast instead of queueing | A product that drafts replies for a hundred agents at peak can outgrow 20 requests a minute on a frontier Workers AI model, which pushes either towards a smaller catalogue model, prepaid credits, or an external provider. ## A way to decide 1. **Split the workloads.** Summaries and embeddings are high volume and judged by a machine or skimmed by a person; drafts are lower volume and judged closely by agents. 2. **Evaluate on real tickets.** Score candidate models (a small and a large Workers AI model, and one external model) on a few hundred redacted tickets for accuracy and tone, and record neurons or provider tokens per ticket. 3. **Check the peak.** Compare peak calls per minute against each candidate's limit. 4. **Price the churn.** Prefer models without a deprecation notice, and budget for re-running the evaluation when one appears. 5. **Embeddings are the stickiest.** Changing the embedding model means re-embedding the whole corpus, so pick it once and keep it on whatever platform is cheapest to stay on. ## How to keep the choice reversible - Put model ids in one configuration file the platform team owns; changes go through the same evaluation. - Pass a `gateway` option on every `env.AI.run()` call, and send external-provider calls through the same gateway, so logs, cost and latency for both paths sit side by side. - Wrap inference behind one function per workload (`summarise`, `draftReply`, `embed`), so moving a workload is a config change plus a test run, not a rewrite. - Handle `3040` and `3036` deliberately: a fallback to a second model for drafts is reasonable; a silent fallback for embeddings is not, because the vectors would not match. ## A worked outcome For a mid-sized support team, a typical result of this process looks like this: | Workload | Runs on | Why | |---|---|---| | Ticket summary | Workers AI, an 8B instruct model | cheap per ticket, quality good enough in evaluation | | Draft reply | the model that won the evaluation, either path | agents judge it closely, so quality decides | | Ticket embedding | Workers AI, `@cf/baai/bge-base-en-v1.5` | cheap, high volume, costly to change later | The table is not the answer for every team; the evaluation and the triggers are. ## Triggers to revisit - A deprecation notice for a pinned model. - Peak drafts approaching the model's per-minute limit. - Cost per ticket drifting above budget, or agent edit rates rising on drafts. - A new catalogue model that beats the incumbent in the evaluation.

  • If drafts move to an external provider, why keep embeddings on Workers AI?
    Embeddings are the costliest choice to reverse: every stored ticket is tied to one model's dimensions, so switching means re-embedding the corpus. They are also high-volume and cheap on Workers AI, around 6,058 neurons per million input tokens for `@cf/baai/bge-base-en-v1.5`. Moving drafts does not force embeddings to move.
  • Workers AI returns 3040 at peak for draft replies; should the code fall back to another model?
    For drafts, a fallback is reasonable if the second model passed the same evaluation: retry once, then call the fallback, logging which one served. Setting `rejectIfBusy: true` makes the first attempt fail fast instead of waiting in a capacity queue. For embeddings, never fall back silently, because vectors from another model are not comparable.

  • One model should serve summaries, drafts and embeddings, to keep things simple.
  • Catalogue models on Workers AI never change once a team adopts them.
  • Every Workers AI text model allows 300 requests per minute.
  • Choosing a model is a one-off decision that needs no re-evaluation trigger.
  • Falling back to another embedding model during an outage is harmless.

Assumes the Workers AI catalogue, limits and plan rules as of 2026-10-10, after the May 2026 model deprecations and the July 2026 move of some frontier models to Workers Paid.