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

Create mux endpoint and route to appropriate destination provider #827

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

Conversation

aponcedeleonch
Copy link
Contributor

@aponcedeleonch aponcedeleonch commented Jan 29, 2025

Closes: #803

This PR introduces the following changes related with muxing:

  • Introduces a new route to which the muxing requests will go to: /v1/mux
  • When hitting the above route the following steps will be performed
    1. The format of the request will be recognized. For the moment is only relevant to determine if the request has an Antropic body or an OpenAI body
    2. Get the destination provider from the active workspace configuration
    3. Transform the incoming request to the format of the destination provider
    4. Route the request to the adequate destination provider
  • Introduction of a new method in all providers: process_request. The purpose of the method is to take the raw data, api_key and url path of the request and handle them appropriately. This is needed to support step number 4. above

@aponcedeleonch aponcedeleonch requested a review from JAORMX January 29, 2025 15:02
@aponcedeleonch aponcedeleonch marked this pull request as draft January 29, 2025 15:02
@aponcedeleonch aponcedeleonch changed the title Changes in providers to separate the processing logic from the route Create mux endpoint and route to appropriate destination provider Jan 29, 2025
@aponcedeleonch aponcedeleonch force-pushed the provider-mux branch 2 times, most recently from d678302 to 0d92522 Compare January 30, 2025 12:06
@aponcedeleonch aponcedeleonch marked this pull request as ready for review January 30, 2025 20:48
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.

Implement "Synthetic" provider
2 participants