Learn how to create, deploy, and manage AI agents on Cloudflare's edge network.
Add hareai to your Cloudflare Workers project.
npm install hareai ai zod agentsUse HareEdgeAgent for a simple, universal agent.
import { HareEdgeAgent } from 'hareai'
const agent = new HareEdgeAgent({
name: 'My Agent',
instructions: 'You are a helpful assistant.',
model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast',
ai: env.AI,
})Get streaming responses from your agent.
const response = await agent.stream([
{ role: 'user', content: 'Hello!' }
])
for await (const chunk of response.textStream) {
console.log(chunk)
}Your agent runs on Cloudflare's edge network.
wrangler deploy