Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@cloudflare/ai

g4brym12.2kMITdeprecated1.2.2TypeScript support: included

Thanks for using @cloudflare/ai: This package has been deprecated in favor of the native binding, learn more here https://developers.cloudflare.com/workers-ai/configuration/bindings/

Cloudflare's Workers AI SDK

readme

Workers AI SDK

This package has been deprecated in favor of a new native AI binding, read more here.

You can use the new native binding just by calling the .run() directly in the binding like this:

const answer = env.AI.run('@cf/meta/llama-2-7b-chat-int8', {
    prompt: "What is the origin of the phrase 'Hello, World'"
});