Thank you for your interest in contributing to AI Worker Proxy!
- Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/AI-Worker-Proxy.git
cd AI-Worker-Proxy- Install dependencies
npm install- Set up environment variables
cp .dev.vars.example .dev.vars
# Edit .dev.vars with your API keys- Run locally
npm run devThis project uses ESLint and Prettier for code formatting.
# Check linting
npm run lint
# Check types
npm run type-check
# Format code
npm run formatTo add a new AI provider:
- Create a new file in
src/providers/(e.g.,my-provider.ts) - Implement the
AIProviderinterface fromsrc/providers/base.ts - Add the provider type to
src/types.ts - Register it in
src/providers/index.ts - Update documentation in
README.md
Example:
import { BaseProvider } from './base';
import { OpenAIChatRequest, ProviderResponse } from '../types';
export class MyProvider extends BaseProvider {
async chat(request: OpenAIChatRequest, apiKey: string): Promise<ProviderResponse> {
// Your implementation
}
}Before submitting a PR:
- Run all checks:
npm run lint
npm run type-check- Test locally with
npm run dev - Test with different providers and routes
- Test both streaming and non-streaming modes
- Test error handling and failover
- Create a feature branch from
main - Make your changes
- Ensure all tests and linting pass
- Update documentation if needed
- Submit a pull request with a clear description
Use clear, descriptive commit messages:
feat: add support for XYZ providerfix: handle timeout errors in token rotationdocs: update configuration examplesrefactor: simplify error handling
Open an issue on GitHub if you have any questions!