new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

cloudflare-ai-gateway/capabilities

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Cloudflare AI Gateway automatic fallback feature

The provider automatically switches to the next available model if one fails, ensuring resilience. Models are passed as an array to aigateway() and attempted in order.

Cloudflare AI Gateway supported providers

The Cloudflare AI Gateway supports models from: OpenAI, Anthropic, DeepSeek, Google AI Studio, Grok, Mistral, Perplexity AI, Replicate, and Groq.

Cloudflare AI Gateway runtime compatibility

The provider is runtime agnostic and compatible with Node.js, Edge Runtime, and other JavaScript runtimes supported by the Vercel AI SDK.

Cloudflare AI Gateway text generation examples

## Setup ```javascript import { createAiGateway } from 'ai-gateway-provider'; import { createOpenAI } from '@ai-sdk/openai'; const aigateway = createAiGateway({ accountId: 'your-cloudflare-account-id', gateway: 'your-gateway-name', apiKey: 'you••••••ey', }); const openai = createOpenAI({ apiKey: 'openai-api-key' }); ``` ## streamText example Use `streamText` to stream text responses: ```javascript import { streamText } from 'ai'; const result = await streamText({ model: aigateway([openai('gpt-4o-mini')]), prompt: 'Write a multi-part greeting.', }); let accumulatedText = ''; for await (const chunk of result.textStream) { accumulatedText += chunk; } console.log(accumulatedText); ``` ## generateText example Use `generateText` for non-streamed responses: ```javascript import { generateText } from 'ai'; const { text } = await generateText({ model: aigateway([openai('gpt-4o-mini')]), prompt: 'Write a greeting.', }); console.log(text); ```

Give your agent this brain