Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support cloudflare secrets based auth for self hosting #132

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aryasaatvik
Copy link

@aryasaatvik aryasaatvik commented Jan 7, 2025

one the the nice things about ai proxy the being able to easily manage all api keys in one place with the braintrust integration. this PR allows similar DX for self hosted cloudflare proxies using secrets. it would also be lower latency for credentials cache miss requests

…tion

- Updated `Env` interface to include new API keys for OpenAI, Anthropic, Perplexity, Replicate, Fireworks, Google, XAI, Together, Lepton, Mistral, Ollama, GROQ, and Cerebras.
- Enhanced `handleProxyV1` function to retrieve secrets based on model type, supporting new models and their respective API keys.
- Modified `ProxyOpts` interface to include an `authConfig` for Cloudflare authentication.
- Expanded model schemas to include new models for OpenAI, Anthropic, Bedrock, Perplexity, Together, Mistral, Groq, Fireworks, Google, and XAI.
- Added support for embedding models in the AvailableModels list.
Copy link

vercel bot commented Jan 7, 2025

@aryasaatvik is attempting to deploy a commit to the BrainTrustData Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@ankrgyl ankrgyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this! This is a neat idea but very specific to Cloudflare / not a pattern we generally see, so I'd prefer to keep this as a fork rather than pull it into the main proxy code, since it will be difficult for us to maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants