{"id":50732677,"url":"https://github.com/bjesus/ha-cloudflare-ai","last_synced_at":"2026-06-10T10:30:40.203Z","repository":{"id":351503096,"uuid":"1185706112","full_name":"bjesus/ha-cloudflare-ai","owner":"bjesus","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-15T10:20:17.000Z","size":154,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-15T10:28:35.969Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjesus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-18T21:34:23.000Z","updated_at":"2026-04-15T10:20:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bjesus/ha-cloudflare-ai","commit_stats":null,"previous_names":["bjesus/ha-cloudflare-ai"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bjesus/ha-cloudflare-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjesus%2Fha-cloudflare-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjesus%2Fha-cloudflare-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjesus%2Fha-cloudflare-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjesus%2Fha-cloudflare-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjesus","download_url":"https://codeload.github.com/bjesus/ha-cloudflare-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjesus%2Fha-cloudflare-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34149132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-06-10T10:30:35.102Z","updated_at":"2026-06-10T10:30:40.195Z","avatar_url":"https://github.com/bjesus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare Workers AI for Home Assistant\n\nA Home Assistant custom integration that brings [Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) to your smart home.\n\n## What it does\n\n- **Conversation Agent** — Chat with LLMs that can control your Home Assistant devices via the Assist API\n- **Text-to-Speech** — Generate speech using Deepgram Aura-2 or MeloTTS\n- **Speech-to-Text** — Transcribe audio using Whisper or Deepgram Nova-3\n- **AI Tasks** — Generate text, structured data, and images for use in automations\n- **Image Generation** — Create images with FLUX, Stable Diffusion, and other models\n\n## Features\n\n- **Any model** — Pick from the Workers AI catalog or type any model ID\n- **Tool calling** — The LLM can control lights, check sensors, get the time, and more\n- **AI Gateway support** — Route through [Cloudflare AI Gateway](https://developers.cloudflare.com/ai-gateway/) for analytics, caching, and rate limiting\n- **Reasoning toggle** — Enable step-by-step thinking for models that support it (Kimi K2.5, QwQ, etc.)\n- **Streaming** — Real-time token display for chat responses\n\n## Installation\n\n### HACS (recommended)\n\n1. Open HACS in your Home Assistant\n2. Click the three dots menu (top right) → **Custom repositories**\n3. Add this repository URL and select **Integration** as the category\n4. Click **Add**\n5. Find \"Cloudflare Workers AI\" in the HACS store and click **Install**\n6. Restart Home Assistant\n\n### Manual\n\nCopy the `custom_components/cloudflare_ai/` directory to your HA config's `custom_components/` folder and restart.\n\n## Setup\n\n1. Go to **Settings → Devices \u0026 Services → Add Integration**\n2. Search for \"Cloudflare Workers AI\"\n3. Enter your:\n   - **Account ID** — found in the Cloudflare dashboard sidebar\n   - **API Token** — create one with \"Workers AI Read\" permission at [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens)\n   - (Optional) **AI Gateway** settings if you want to route through a gateway\n4. The integration auto-creates a conversation agent, TTS engine, STT engine, and AI task entity\n5. You can add more agents or change models via the integration page\n\n## Usage\n\n### Voice Assistant Pipeline\n\nGo to **Settings → Voice assistants** and create a pipeline using:\n- **Conversation agent:** Cloudflare AI Conversation\n- **Speech-to-text:** Cloudflare AI STT\n- **Text-to-speech:** Cloudflare AI TTS\n\n### Chat\n\nUse the **Assist** panel (bottom left) and select your Cloudflare AI agent.\n\n### AI Tasks\n\nUse `ai_task.generate_data` and `ai_task.generate_image` in automations and scripts:\n\n```yaml\n# Generate text\naction: ai_task.generate_data\ndata:\n  entity_id: ai_task.cloudflare_ai_task\n  task_name: notification\n  instructions: \"Write a funny reminder that the garage door is open\"\nresponse_variable: result\n\n# Generate an image\naction: ai_task.generate_image\ndata:\n  entity_id: ai_task.cloudflare_ai_task\n  task_name: weather art\n  instructions: \"A watercolor painting of a rainy day in Stockholm\"\nresponse_variable: image\n```\n\n## Supported Models\n\nAny Workers AI model can be used — the dropdowns show popular options but you can type any model ID.\n\n**Conversation**\n- `@cf/moonshotai/kimi-k2.5` (default — fast, tool calling, 256k context)\n- `@cf/meta/llama-3.3-70b-instruct-fp8-fast`\n- `@cf/meta/llama-4-scout-17b-16e-instruct`\n- `@cf/openai/gpt-oss-120b`\n- `@cf/qwen/qwen3-30b-a3b-fp8`\n- `@cf/mistralai/mistral-small-3.1-24b-instruct`\n- [All text-generation models →](https://developers.cloudflare.com/workers-ai/models/?feature=text-generation)\n\n**Text-to-Speech**\n- `@cf/deepgram/aura-2-en` (default — MP3, 40 voices)\n- `@cf/deepgram/aura-2-es` (Spanish)\n- `@cf/myshell-ai/melotts` (multi-lingual)\n- [All TTS models →](https://developers.cloudflare.com/workers-ai/models/?feature=text-to-speech)\n\n**Speech-to-Text**\n- `@cf/openai/whisper-large-v3-turbo` (default)\n- `@cf/deepgram/nova-3`\n- [All ASR models →](https://developers.cloudflare.com/workers-ai/models/?feature=automatic-speech-recognition)\n\n**Image Generation**\n- `@cf/black-forest-labs/flux-1-schnell` (default — fast, 1024×1024)\n- `@cf/black-forest-labs/flux-2-klein-9b`\n- `@cf/black-forest-labs/flux-2-dev`\n- `@cf/leonardo/lucid-origin`\n- `@cf/stabilityai/stable-diffusion-xl-base-1.0`\n- [All image models →](https://developers.cloudflare.com/workers-ai/models/?feature=text-to-image)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjesus%2Fha-cloudflare-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjesus%2Fha-cloudflare-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjesus%2Fha-cloudflare-ai/lists"}