Jazee6/cloudflare-ai-web

Cloudflare AI Platform with one-click deployment

Cloudflare AI Web – Quick‑start multi‑model AI UI

What it is

  • A lightweight web front‑end that lets you talk to large language models (LLMs) hosted on Cloudflare Workers AI. It can also route requests through Cloudflare AI Gateway to external providers such as Gemini.
  • The app runs completely server‑less: the UI is served by Vercel or Docker, while the actual inference happens inside Cloudflare’s edge Workers.

Key features

  • Multi‑model support – pick any model you have enabled in Cloudflare Workers AI or expose external models via the AI Gateway.
  • Serverless deployment – one‑click Vercel deploy button or a single‑line Docker command.
  • Local chat history – conversation logs are stored in the browser, no external database needed.
  • Image attachment handling – images are automatically resized (max side ≤ 1568 px) and compressed (≤ 512 KiB each, max 5 per request) so they fit within Vercel Function limits.
  • Access Session protection – optional password (APP_PASSWORD) to prevent anyone else from using your API key.

How to run it

  1. Vercel – click the “Deploy with Vercel” button in the README, fill in the required environment variables, and Vercel will build and host the app. A demo is live at https://ai.jaze.top (subject to usage limits).
  2. Docker – run the provided docker run command, supplying:
    • CF_ACCOUNT_ID – your Cloudflare account ID
    • CF_WORKERS_AI_TOKEN – a token with Workers AI permissions
    • optional variables for AI Gateway, Google Studio, or a password. The container listens on port 3000.

Configuration

Variable Purpose Required
CF_ACCOUNT_ID Your Cloudflare account identifier ✅
CF_WORKERS_AI_TOKEN Token that authorises Workers AI calls ✅
CF_AI_GATEWAY_NAME Name of a Cloudflare AI Gateway you created optional
CF_AI_GATEWAY_TOKEN Token for the gateway (only if you use a gateway) optional
GOOGLE_API_KEY Google AI Studio key (for Gemini) optional
CF_AI_GATEWAY_PROVIDERS Comma‑separated list of external providers (e.g., google) optional
APP_PASSWORD Simple password to enable Access Session protection optional

Getting the Cloudflare tokens

  • In the Cloudflare dashboard go to My Profile → API Tokens → Create Token and select the Workers AI template. Use the generated token for CF_WORKERS_AI_TOKEN.

Why it matters

  • It demonstrates how Cloudflare’s edge compute can be turned into an inexpensive, globally‑distributed inference endpoint without managing servers.
  • The UI is ready‑to‑use for quick demos, personal assistants, or as a base for more complex AI‑driven web apps.

Sponsorship

  • The author includes a link for donations and a banner for a subscription service that sells AI model access.

All details are taken directly from the repository’s README.

Related

  • Project
  • Project
  • Project
  • Project
  • Project