AI-worker  by qyjoy

Serverless AI proxy for edge access

created 3 months ago
266 stars

Top 96.9% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a serverless Cloudflare Worker to proxy requests to AI APIs, enabling access to advanced models from the edge. It's designed for users who want to securely manage API keys, bypass regional restrictions, and leverage Cloudflare's global network for potentially lower latency and high scalability, all while benefiting from a generous free tier.

How It Works

The worker acts as an intermediary, securely routing requests to AI services like Gemini and Imagen. It utilizes Cloudflare's environment variables to store API keys, preventing exposure in client-side code. The project includes a customizable HTML interface for user interaction and handles Cross-Origin Resource Sharing (CORS) and streaming responses, making it a versatile solution for accessing AI capabilities.

Quick Start & Requirements

  • Install/Run: Deploy via Cloudflare dashboard or Wrangler CLI.
  • Prerequisites: Cloudflare account, API key for AI services (e.g., Gemini, Imagen).
  • Setup: Requires pasting code files (worker.js, request-handler.js, api-handler.js, html-renderer.js, utils.js) into the Cloudflare online editor and configuring an encrypted environment variable (GEMINI_API_KEY).

Highlighted Details

  • Proxies requests to AI APIs (Gemini, Imagen, ChatGPT).
  • Securely manages API keys using Cloudflare environment variables.
  • Provides a simple, customizable HTML interface with theme selection.
  • Supports streaming responses and image generation.
  • Enables access to restricted AI models without a VPN.

Maintenance & Community

The project is maintained by qyjoy. Contributions are welcomed via pull requests to the discover branch. Contact is available via email at dev@qyjoy.vip.

Licensing & Compatibility

Licensed under GNU General Public License v3.0 or later. This license permits redistribution and modification but requires derived works to also be open-sourced under the same terms. Commercial use and linking with closed-source applications may be restricted due to the GPL's copyleft provisions.

Limitations & Caveats

The project is an API forwarder, not a general network proxy, and does not support accessing arbitrary websites or providing VPN-like services. While compliant with Cloudflare's policies, the GPLv3 license may impose restrictions on integration with proprietary software.

Health Check
Last commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
270 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.