Workers AI not supported on Vercel AI sdk providers? ``` const aiGateway = createAiGateway({ ac

Workers AI not supported on Vercel AI sdk providers?

const aiGateway = createAiGateway({
    accountId: env.CF_ACCOUNT_ID,
    gateway: GATEWAY_ID,
    apiKey: env.CF_API_KEY,
    options: {
      cacheTtl: 3600,
    },
  });

  const workersai = createWorkersAI({ binding: env.AI });
  const model = workersai("@cf/meta/llama-3.1-8b-instruct", {
    safePrompt: true,
  });

  const { text } = await generateText({
    model: aiGateway(model),
    prompt: "Write a multi-part greeting.",
  });
image.png
Was this page helpful?