OpenAI API proxy for Cloudflare Workers AI
Top 96.9% on sourcepulse
This project provides an OpenAI-compatible API layer for Cloudflare's Workers AI platform, enabling developers to leverage smaller, cost-effective LLMs with existing OpenAI SDKs. It targets developers seeking to migrate from OpenAI's proprietary models to alternative, self-hosted solutions without extensive code refactoring.
How It Works
The project acts as a proxy, translating OpenAI API requests into calls to Cloudflare Workers AI endpoints. It supports various OpenAI functionalities like completions, chat completions, audio transcription, embeddings, and image generation using models like Llama 2 and Whisper. This approach allows for seamless integration with existing applications that rely on the OpenAI API structure.
Quick Start & Requirements
yarn
yarn deploy
wrangler secret put ACCESS_TOKEN
, wrangler secret put CLOUDFLARE_API_TOKEN
yarn dev
proxies to deployed API.Highlighted Details
Maintenance & Community
The project is maintained by chand1012. Updates are described as semi-regular, depending on Workers AI feature rollouts. No specific community channels (Discord/Slack) are mentioned.
Licensing & Compatibility
Licensed under the MIT License. This license permits commercial use and integration with closed-source projects.
Limitations & Caveats
The API does not count tokens, always returning zero for the usage attribute. Stop tokens are non-functional and may sometimes appear in responses. Features like Files, Assistants, Threads, and Runs are planned but not yet implemented. Image editing and variants are not supported.
1 year ago
1 week