Expand description
The Workers AI binding (env.AI) as a decision backend.
AiBackend calls env.AI.run(model, input) with the SystemOne request
yoagent builds and parses the result with parse_systemone_response,
so answers are validated and spend is recorded as for the REST preset
(DecisionModel::clef). clef and clef_flash are the ready-made
models; they are priced at the rate the price table holds when they are
built.
Structs§
- AiBackend
- A SystemOne decision model run through a Worker’s AI binding.
Constants§
- CLEF
- Clef (27B) in the Workers AI catalog.
- CLEF_
FLASH - Clef Flash (9B, faster) in the Workers AI catalog.
Functions§
- clef
- Clef through the Worker’s AI binding: model
clef, priced at thecloudflare/clefrate yoagent’s process-wide price table holds when this is called — unpriced unless the Worker opted in to prices first (enable_bundled: $0.24 per million input tokens). A later opt-in orinstall_overridedoes not reprice the returned model; with prices enabled but no rate in the table it is unpriced (logged). - clef_
flash - Clef Flash through the Worker’s AI binding: model
clef-flash, priced likeclefat thecloudflare/clef-flashrate ($0.09 per million input tokens in the bundled snapshot; unpriced without an opt-in).