Devflare Docs
Starter example Bindings

A small AI example you can adapt quickly

This example keeps the AI path tiny: one binding, one inference call, one JSON response.

That is enough to prove the worker can talk to Workers AI without burying the example inside a whole chat product.

Config focus
Minimal binding declaration
Runtime shape
Call from the worker
Best use
Small inference endpoints and smoke checks

Start by wiring the binding clearly in config

Minimal AI config

Then use it in one honest runtime path

  • Use a cheap, small model in smoke paths unless the point is to verify a specific expensive production model.
  • Keep local app mocks above this worker route if you need offline UI development.

A tiny inference endpoint

Keep the first version boring on purpose

This example still needs remote access

It is a minimal worker example, not a promise of local AI emulation. Treat account access and cost control as part of the example setup.

Previous

Testing AI

The right AI test strategy is selective: use remote mode when you mean to test inference, and skip cleanly when the environment is not allowed to do that.

Next

Vectorize

Vectorize is fully modeled in Devflare config and preview naming, but meaningful tests are still remote-oriented because the index lives on Cloudflare infrastructure.