Skip to content

Add openai and wildcard paths #25

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

Merged
merged 3 commits into from
Jul 24, 2025
Merged

Add openai and wildcard paths #25

merged 3 commits into from
Jul 24, 2025

Conversation

emgarten
Copy link
Owner

No description provided.

@emgarten emgarten requested a review from Copilot July 24, 2025 06:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for OpenAI-specific URL patterns and wildcard path matching to the proxy application. The changes enable the proxy to handle different URL structures that clients might use when connecting to OpenAI-compatible APIs.

  • Adds OpenAI-specific deployment path format with "/openai/" in the URL structure
  • Introduces wildcard path support to catch various subpath patterns
  • Maintains existing deployment path functionality

@app.post("/provider/{provider}/deployments/{model}/chat/completions")
async def chat_proxy_deployment(provider: str, model: str, request: Request) -> Response:
"""Proxy for chat completions to the specified provider with deployment path."""
return await chat_proxy(provider, request)


@app.post("/provider/{provider}/{subpath:path}/chat/completions")
Copy link
Preview

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The wildcard path pattern could create ambiguous routing. This endpoint will match URLs that should be handled by more specific endpoints above it. Consider placing this route after all other specific patterns or adding additional constraints to prevent conflicts.

Copilot uses AI. Check for mistakes.

@emgarten emgarten merged commit c401b53 into main Jul 24, 2025
2 checks passed
@emgarten emgarten deleted the juste/openai-path branch July 24, 2025 06:12
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.

1 participant