Build AI Applications
Build and deploy ambitious AI applications to Cloudflare's global network.
Diagrams, design patterns, and detailed best practices to help you generate solutions with Cloudflare products.
- Content-based asset creation : Combining text-generation models with text-to-image models can lead to powerful AI systems capable of generating visual content based on input prompts. This integration can be achieved through a collaborative framework where a text-generation model generates prompts for the text-to-image model based on input text.
- Composable AI architecture : The architecture diagram illustrates how AI applications can be built end-to-end on Cloudflare, or single services can be integrated with external infrastructure and services.
- Multi-vendor AI observability and control : By shifting features such as rate limiting, caching, and error handling to the proxy layer, organizations can apply unified configurations across services and inference service providers.
- Retrieval Augmented Generation (RAG) : Retrieval-Augmented Generation (RAG) is an innovative approach in natural language processing that integrates retrieval mechanisms with generative models to enhance text generation.
- Automatic captioning for video uploads : By integrating automatic speech recognition technology into video platforms, content creators, publishers, and distributors can reach a broader audience, including individuals with hearing impairments or those who prefer to consume content in different languages.
- Ingesting BigQuery Data into Workers AI : You can connect a Cloudflare Worker to get data from Google BigQuery and pass it to Workers AI, to run AI Models, powered by serverless GPUs. This will allow you to enhance data with AI-generated responses, such as detecting the sentiment score of some text or generating tags for an article. This document describes a simple way to get started if you are looking to give Workers AI a try and see how the new and different AI models would perform with your data hosted in BigQuery.
- Gamertown Customer Support Assistant: A RAG based AI Chat app that uses Vectorize to access video game data for employees of Gamertown.
- LoRA News Summarizer: This application uses Cloudflare Workers AI, Streamlit, and Beautiful Soup to summarize input news article URLs in a variety of tones.
- shrty.dev: A URL shortener that makes use of KV and Workers Analytics Engine. The admin interface uses Function Calling. Go Shorty!
- Fanfic Generator: This application uses Cloudflare Workers AI, Streamlit, and AstraDB to generate personal scifi fanfiction.
- Homie - Home Automation using Function Calling: A home automation tool that uses AI Function calling to change the color of lightbulbs in your home.
- Hackathon Helper: A series of starters for Hackathons. Get building quicker! Python, Streamlit, Workers, and Pages starters for all your AI needs!
- NBA Finals Polling and Predictor: This stateful polling application uses Cloudflare Workers AI, Cloudflare Pages, Cloudflare Durable Objects, and Hono to keep track of users' votes for different basketball teams and generates personal predictions for the series.
- Multimodal AI Translator: This application uses Cloudflare Workers AI to perform multimodal translation of languages via audio and text in the browser.
- Floor is Llava: This is an example repo to explore using the AI Vision model Llava hosted on Cloudflare Workers AI. This is a SvelteKit app hosted on Pages.
- Workers AI Object Detector: Detect objects from a webcam in a Cloudflare Worker web app with detr-resnet-50 hosted on Cloudflare using Cloudflare Workers AI.
- Comically Bad Art Generation: This app uses the wonderful Python UI Framework Streamlit and Cloudflare Workers AI.
- Whatever-ify: Turn yourself into...whatever. Take a photo, get a description, generate a scene and character, then generate an image based on that calendar.
- Phoney AI: This application uses Cloudflare Workers AI, Twilio, and AssemblyAI. Your phone is an input and output device.
- Image Model Streamlit starters: Collection of Streamlit applications that are making use of Cloudflare Workers AI.
- Vanilla JavaScript Chat Application using Cloudflare Workers AI: A web based chat interface built on Cloudflare Pages that allows for exploring Text Generation models on Cloudflare Workers AI. Design is built using tailwind.
Step-by-step guides to help you build and learn.
- Deploy a Worker that connects to OpenAI via AI Gateway : In this tutorial, you will learn how to deploy a Worker that makes calls to OpenAI through AI Gateway. AI Gateway helps you better observe and control your AI applications with more analytics, caching, rate limiting, and logging.
- Recommend products on e-commerce sites using Workers AI and Stripe : E-commerce and media sites often work on increasing the average transaction value to boost profitability. One of the strategies to increase the average transaction value is "cross-selling," which involves recommending related products. Cloudflare offers a range of products designed to build mechanisms for retrieving data related to the products users are viewing or requesting. In this tutorial, you will experience developing functionalities necessary for cross-selling by creating APIs for related product searches and product recommendations.
- Build a Retrieval Augmented Generation (RAG) AI
- Build a Voice Notes App with auto transcriptions using Workers AI : Explore how you can use AI models to transcribe audio recordings and post process the transcriptions.
- Build an interview practice tool with Workers AI
- Explore Code Generation Using DeepSeek Coder Models : Explore how you can use AI models to generate code and work more efficiently.
- Explore Workers AI Models Using a Jupyter Notebook : This Jupyter notebook explores various models (including Whisper, Distilled BERT, LLaVA, and Meta Llama 3) using Python and the requests library.
- Fine Tune Models With AutoTrain from HuggingFace
- Choose the Right Text Generation Model : There's a wide range of text generation models available through Workers AI. In an effort to aid you in your journey of finding the right model, this notebook will help you get to know your options in a speed dating type of scenario.
- How to build an Image Generator using Workers AI
- Using BigQuery with Workers AI
- Create a fine-tuned OpenAI model with R2
- OpenAI GPT function calling with JavaScript and Cloudflare Workers
Explore case studies on AI companies building on Cloudflare ↗.
Examples ready to copy and paste.
- Use fetch() handler
- Stream OpenAI API Responses : Use the OpenAI v4 SDK to stream responses from OpenAI.