Skip to content

Add support for proxying eu.api.openai.com #98

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

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

Conversation

joseph-kimberley
Copy link

- Uses OPENAI_API_URLS env var to supply map of openAI API URLs in format
  '<shorthand-1>=<url-1>,<shorthand-2>=<url-2>,...'
- Allows BricksLLM to proxy both eu.api.openai.com and api.openai.com, e.g.:
  'openai=https://api.openai.com,openai-eu=https://eu.api.openai.com'

- When using the BricksLLM proxy, supply the appropriate openai shorthand
  in the path to target a particular API endpoint:
  - http://localhost:8002/api/providers/openai/v1/chat/completions
  - http://localhost:8002/api/providers/openai-eu/v1/chat/completions

- Not a breaking change, should continue to work as normal with
  /providers/openai/...

- Unfortunately the URL (api.openai.com) and the path (/providers/openai)
  are both hardcoded in many places across the code so this touches a lot
  of files

- Using newer version of github.com/caarlos0/env package to allow parsing
  of maps
@joseph-kimberley
Copy link
Author

Resolves #97

@martin-rounds-ai
Copy link

Hi! I'd just like to know when you plan to merge this PR?
Feature could possibly close #34.

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