{"id":28899961,"url":"https://github.com/88plug/cloudflare-workers-ai-explorer","last_synced_at":"2025-09-07T12:34:04.906Z","repository":{"id":288342421,"uuid":"967726579","full_name":"88plug/Cloudflare-Workers-AI-Explorer","owner":"88plug","description":"This app demonstrates how to run AI models on Cloudflare’s network using the official Python SDK. ","archived":false,"fork":false,"pushed_at":"2025-04-16T23:19:08.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T11:30:25.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/88plug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-16T22:52:51.000Z","updated_at":"2025-04-16T23:19:12.000Z","dependencies_parsed_at":"2025-04-17T11:30:38.023Z","dependency_job_id":"7ed6643a-a26f-48aa-9bce-4cbcdf7afabf","html_url":"https://github.com/88plug/Cloudflare-Workers-AI-Explorer","commit_stats":null,"previous_names":["88plug/cloudflare-workers-ai-explorer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/88plug/Cloudflare-Workers-AI-Explorer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2FCloudflare-Workers-AI-Explorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2FCloudflare-Workers-AI-Explorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2FCloudflare-Workers-AI-Explorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2FCloudflare-Workers-AI-Explorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/88plug","download_url":"https://codeload.github.com/88plug/Cloudflare-Workers-AI-Explorer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2FCloudflare-Workers-AI-Explorer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261095306,"owners_count":23108784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-21T09:08:45.756Z","updated_at":"2025-09-07T12:34:04.889Z","avatar_url":"https://github.com/88plug.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡ Cloudflare Free Workers AI Explorer\n\n![Python](https://img.shields.io/badge/python-3.8+-blue.svg)\n![Streamlit](https://img.shields.io/badge/built%20with-Streamlit-orange)\n\n\u003e A sleek, fully interactive Streamlit app to explore Cloudflare Workers AI using the official Python SDK. This app enables text generation, image synthesis, speech recognition, translation, summarization, and classification directly from your browser — powered by Cloudflare’s distributed AI models.\n\n---\n\n## 🚀 Features\n\n- 🔐 Securely input your Cloudflare API Token and Account ID\n- 🧠 Choose from supported **[Workers AI models](https://developers.cloudflare.com/workers-ai/models/)**\n- 📊 Automatically calculate and monitor **neuron usage** (10,000 free/day)\n- 💬 **Text Generation** with Llama 3.1\n- 🎨 **Text-to-Image** with DreamShaper 8\n- 🧾 **Image Captioning** with LLaVA\n- 🎙️ **Speech Recognition** using Whisper\n- 🌐 **Language Translation** (M2M100)\n- 🧠 **Text \u0026 Image Classification**\n- ✂️ **Text Summarization**\n\n---\n\n## 📦 Installation\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/88plug/Cloudflare-Workers-AI-Explorer.git\ncd Cloudflare-Workers-AI-Explorer\n```\n\n### 2. Create a virtual environment (recommended)\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n### 3. Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\nOr manually:\n\n```bash\npip install streamlit cloudflare requests\n```\n\n---\n\n## 🔧 Configuration\n\nYou need two secrets:\n\n- `CLOUDFLARE_API_TOKEN`: From [Cloudflare Dashboard → API Tokens](https://dash.cloudflare.com/profile/api-tokens)\n- `CLOUDFLARE_ACCOUNT_ID`: From your [Cloudflare Workers AI dashboard](https://dash.cloudflare.com)\n\nYou can provide them in either of these ways:\n\n### Option 1: Set environment variables\n\n```bash\nexport CLOUDFLARE_API_TOKEN=\"your-token\"\nexport CLOUDFLARE_ACCOUNT_ID=\"your-account-id\"\n```\n\nOr use a `.env` file with [`python-dotenv`](https://pypi.org/project/python-dotenv/):\n\n```ini\nCLOUDFLARE_API_TOKEN=your-token\nCLOUDFLARE_ACCOUNT_ID=your-account-id\n```\n\n### Option 2: Enter credentials via sidebar\n\nWhen the app loads, use the sidebar input fields to securely provide credentials.\n\n---\n\n## ▶️ Usage\n\nTo run the app locally:\n\n```bash\nstreamlit run app.py\n```\n\nThen open your browser to http://localhost:8501\n\n---\n\n## 🧪 Supported Models\n\n| Feature              | Model ID                                |\n|----------------------|------------------------------------------|\n| Text Generation      | `@cf/meta/llama-3.1-8b-instruct`         |\n| Text-to-Image        | `@cf/lykon/dreamshaper-8-lcm`            |\n| Image Captioning     | `@cf/llava-hf/llava-1.5-7b-hf`           |\n| Speech Recognition   | `@cf/openai/whisper`                     |\n| Translations         | `@cf/meta/m2m100-1.2b`                   |\n| Text Classification  | `@cf/huggingface/distilbert-sst-2-int8` |\n| Image Classification | `@cf/microsoft/resnet-50`               |\n| Summarization        | `@cf/facebook/bart-large-cnn`           |\n\n---\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F88plug%2Fcloudflare-workers-ai-explorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F88plug%2Fcloudflare-workers-ai-explorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F88plug%2Fcloudflare-workers-ai-explorer/lists"}