{"id":20609217,"url":"https://github.com/akazwz/workersai","last_synced_at":"2025-09-26T11:30:49.583Z","repository":{"id":248399229,"uuid":"828433370","full_name":"akazwz/workerai","owner":"akazwz","description":"a LLMs/AI chat platform build and design for Cloudflare worker AI. with many features like function calling, image to text, text to image, text to speech","archived":false,"fork":false,"pushed_at":"2024-07-14T15:42:54.000Z","size":1287,"stargazers_count":61,"open_issues_count":2,"forks_count":13,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T13:15:01.444Z","etag":null,"topics":["ai","chatbot","cloudflare","cloudflare-workers","remix","worker"],"latest_commit_sha":null,"homepage":"https://worker.antonai.com","language":"TypeScript","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/akazwz.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}},"created_at":"2024-07-14T06:13:22.000Z","updated_at":"2024-12-05T03:23:45.000Z","dependencies_parsed_at":"2024-07-14T17:15:42.445Z","dependency_job_id":"087a26d6-9a5a-4dad-b082-7f0efa37fa8b","html_url":"https://github.com/akazwz/workerai","commit_stats":null,"previous_names":["akazwz/antonai","akazwz/workerai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akazwz%2Fworkerai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akazwz%2Fworkerai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akazwz%2Fworkerai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akazwz%2Fworkerai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akazwz","download_url":"https://codeload.github.com/akazwz/workerai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234304872,"owners_count":18811269,"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":["ai","chatbot","cloudflare","cloudflare-workers","remix","worker"],"created_at":"2024-11-16T10:13:01.121Z","updated_at":"2025-09-26T11:30:49.577Z","avatar_url":"https://github.com/akazwz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare AI Chat Demo\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/akazwz/workersai/tree/main/backend)\n\nLive Demo: [workersai.zwz.workers.dev](https://workersai.zwz.workers.dev/)\n\nThis is a demo project showcasing a full-stack chat application built entirely on the Cloudflare stack, featuring AI capabilities.\n\n## Features\n\n*   **AI-Powered Chat:** Engage in conversations powered by Cloudflare AI text generation models.\n*   **Real-time Communication:** Uses WebSockets via Cloudflare Durable Objects for instant message delivery.\n*   **Text-to-Speech (TTS):** Hear AI responses spoken aloud using Cloudflare AI TTS.\n*   **Speech-to-Text (STT):** Dictate your messages using Cloudflare AI STT (Whisper).\n*   **Conversation Management:** Create, rename, pin, and delete conversations.\n*   **Model Selection:** View available Cloudflare AI text generation models.\n*   **Anonymous Sessions:** Simple authentication using tokens stored in Cloudflare KV.\n*   **Modern Tech Stack:**\n    *   **Backend:** Cloudflare Workers, Durable Objects, KV, AI Gateway, TypeScript, ConnectRPC, Drizzle ORM (potentially for future database integration).\n    *   **Frontend:** React, TypeScript, Vite, TailwindCSS, React Router.\n    *   **API:** Protocol Buffers (protobuf) for type-safe communication.\n\n## Project Structure\n\n```\n.\n├── backend/         # Cloudflare Worker backend code (TypeScript)\n├── frontend/        # React frontend application (TypeScript, Vite)\n├── proto/           # Protocol Buffer definitions for the API\n├── buf.gen.yaml     # Buf code generation configuration\n├── buf.yaml         # Buf linting and breaking change detection configuration\n├── deploy.sh        # Deployment script (likely for Cloudflare Workers)\n└── README.md        # This file\n```\n\n## Getting Started\n\n*(Instructions need to be added here based on how to set up environment variables, install dependencies for both frontend and backend, and run the development servers.)*\n\n### Prerequisites\n\n*   Node.js and pnpm\n*   Cloudflare Account\n*   Wrangler CLI\n*   Buf CLI (optional, for protobuf generation)\n\n### Setup\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/akazwz/workersai.git\n    cd workersai\n    ```\n2.  **Install Dependencies:**\n    ```bash\n    # From the root directory\n    pnpm install\n    # Navigate to backend and frontend to ensure all deps are installed if needed\n    cd backend \u0026\u0026 pnpm install\n    cd ../frontend \u0026\u0026 pnpm install\n    cd ..\n    ```\n3.  **Configure Backend Environment Variables:**\n    *   Navigate to the `backend` directory.\n    *   Copy the provided example environment file: `cp .dev.vars.example .dev.vars`\n    *   Edit `.dev.vars` and fill in your Cloudflare credentials and bindings (refer to `wrangler.jsonc` for required variables).\n    *   Return to the project root directory: `cd ..`\n4.  **Configure Frontend Environment Variables:**\n    *   The `frontend` directory now includes a `.env` file with default/example settings.\n    *   For local development, it is recommended to copy this file to `.env.local` within the `frontend` directory:\n        ```bash\n        cp frontend/.env frontend/.env.local\n        ```\n    *   Then, customize `frontend/.env.local` with your specific settings (e.g., `VITE_API_URL` if it needs to differ from the default). The `.env.local` file will override `frontend/.env` and is typically gitignored.\n    *   If you don't create a `.env.local`, ensure the values in `frontend/.env` are suitable for your local setup.\n5.  **Build Frontend Assets:**\n    ```bash\n    cd frontend\n    pnpm run build\n    cd ..\n    ```\n6.  **Configure Cloudflare Resources:**\n    *   Set up necessary Cloudflare resources (KV namespace, Durable Object binding, AI Gateway). This step might involve using the Cloudflare dashboard or Wrangler commands. Ensure the bindings in `backend/wrangler.jsonc` and `.dev.vars` match these resources.\n7.  **Generate Protobuf Code (if needed):**\n    ```bash\n    buf generate\n    ```\n\n### Running Locally\n\n**Important:** Before starting the backend worker, ensure you have:\n1. Configured your `backend/.dev.vars` file (as per **Setup step 3**).\n2. Configured your frontend environment by checking/copying `frontend/.env` to `frontend/.env.local` and customizing it if needed (as per **Setup step 4**).\n3. Built the frontend assets (as per **Setup step 5**):\n    ```bash\n    # Ensure you are in the project root directory\n    cd frontend\n    pnpm run build\n    cd ..\n    ```\nThese steps are crucial for the application to run correctly.\n\n1.  **Start the backend worker (using Wrangler):**\n    ```bash\n    cd backend\n    pnpm run dev\n    ```\n2.  **Start the frontend development server (optional, if you want to make frontend changes and see them live):**\n    ```bash\n    cd frontend\n    pnpm run dev\n    ```\n\nThe application should now be accessible (usually at `http://localhost:8787` for the backend worker, which serves the frontend assets. If you run the frontend dev server, it's often at `http://localhost:5173`).\n\n## Deployment\n\n*(Instructions need to be added here, likely involving running the `deploy.sh` script or using `wrangler deploy`.)*\n\n```bash\n# Example deployment command (adapt as needed)\n./deploy.sh\n# or\n# cd backend \u0026\u0026 wrangler deploy\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues or pull requests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakazwz%2Fworkersai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakazwz%2Fworkersai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakazwz%2Fworkersai/lists"}