cf-openai-azure-proxy  by haibbo

Cloudflare Worker script to proxy OpenAI requests to Azure OpenAI Service

created 2 years ago
1,646 stars

Top 26.1% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Cloudflare Worker script to proxy requests from OpenAI-compatible clients to Azure OpenAI Service. It enables users to leverage Azure's offerings, including free tiers and simpler setup, with standard OpenAI clients that typically lack direct Azure support. The solution is ideal for developers and users seeking an accessible way to utilize Azure OpenAI models without managing their own infrastructure.

How It Works

The script acts as a serverless intermediary, running on Cloudflare's edge network. It intercepts requests intended for OpenAI's API and reroutes them to a specified Azure OpenAI Service endpoint. Key advantages include its zero-infrastructure requirement, free tier usage on Cloudflare (up to 100,000 requests daily), and the ability to emulate "printer mode" by streaming responses chunk by chunk, mimicking the behavior of some OpenAI clients.

Quick Start & Requirements

  • Install/Run: Deploy the cf-openai-azure-proxy.js script to a Cloudflare Worker.
  • Prerequisites: A Cloudflare account. Azure OpenAI Service resource name and deployment mappings are required, configurable via script constants or environment variables.
  • Setup: Deploying to Cloudflare Worker is straightforward. Custom domain binding is optional.
  • Docs: https://github.com/haibbo/cf-openai-azure-proxy/issues/3

Highlighted Details

  • Proxies requests to Azure OpenAI Service for compatibility with standard OpenAI clients.
  • Supports models like GPT-3.5-turbo, GPT-4, and DALL-E-3, with easy extensibility for new models.
  • Offers "printer mode" for streaming responses.
  • Can be deployed via Docker using Wrangler.
  • Supports custom domain binding for a personalized endpoint.

Maintenance & Community

The project appears to be maintained by a single contributor (haibbo). Community interaction and issue reporting are encouraged via GitHub Issues.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README text. Compatibility for commercial use or closed-source linking would depend on the unstated license.

Limitations & Caveats

The README does not specify a license, which may impact commercial use or integration into closed-source projects. The project relies on Cloudflare's free tier limits, which could be a constraint for high-volume usage.

Health Check
Last commit

1 year ago

Responsiveness

1 week

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

Explore Similar Projects

Feedback? Help us improve.