Skip to content

A serverless AI agent built with Cloudflare Workers, KV storage, and LLaMA 3 inference. Offers endpoints for health, Q&A, webhooks, and external API routing. Uses KV for lightweight memory and state. Deployed automatically via GitHub Actions. Minimal, fast, and production-grade edge deployment.

Notifications You must be signed in to change notification settings

harehimself/cloudflare-agent-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A serverless AI agent built with Cloudflare Workers, KV storage, and LLaMA 3 inference. Offers endpoints for health, Q&A, webhooks, and external API routing. Uses KV for lightweight memory and state. Deployed automatically via GitHub Actions. Minimal, fast, and production-grade edge deployment. Ideal for building AI-enabled microservices at the edge.


Contributors Forks Stars Issues MIT License



Table of Contents

🧠 Cloudflare Agent Lab

A modular Cloudflare Worker application demonstrating how to build fast, scalable edge agents with AI, storage, and automation built-in.

This lab project includes:

  • Health endpoint for monitoring
  • 🤖 AI Q&A using Cloudflare’s LLaMA 3 inference
  • 📬 Webhook listener for external integrations
  • 🌐 External API proxy for mashups and edge routing
  • 💾 KV data store for memory/stateful actions
  • ⚙️ CI/CD via GitHub Actions

🚀 Live Deployment

URL: https://cloudflare-agent-lab.harelabs.workers.dev


🛠️ Endpoints

Endpoint Method Purpose
/ GET Health check
/ask?q=question GET AI response using Cloudflare AI Inference
/webhook POST Accepts JSON payloads for processing
/external GET Returns API results from public endpoint
/kv?store=value GET Stores a string in KV
/kv?get GET Retrieves last stored string from KV

📦 Tech Stack


⚙️ Setup Instructions

1. Install Wrangler

npm install -g wrangler

2. Authenticate Wrangler

wrangler login

3. Run Locally

wrangler dev

4. Deploy to Cloudflare

wrangler deploy

🔐 GitHub Actions CI/CD

Automatically deploys on push to main.

Required Secret

Create a Cloudflare API Token with:

  • Workers Scripts: Edit
  • Workers KV Storage: Edit

Add to GitHub:

Settings → Secrets → Actions → New Repository Secret
Name: CLOUDFLARE_API_TOKEN

✨ Example Usage

curl "https://cloudflare-agent-lab.harelabs.workers.dev/ask?q=what+is+cloudflare%3F"
curl -X POST https://cloudflare-agent-lab.harelabs.workers.dev/webhook \
  -H "Content-Type: application/json" \
  -d '{"event":"test","source":"github"}'

📌 License

MIT License © 2025 [HareLabs]

About

A serverless AI agent built with Cloudflare Workers, KV storage, and LLaMA 3 inference. Offers endpoints for health, Q&A, webhooks, and external API routing. Uses KV for lightweight memory and state. Deployed automatically via GitHub Actions. Minimal, fast, and production-grade edge deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published