Skip to content

Refactor#3

Merged
soderlind merged 3 commits intomainfrom
gpt/image
Mar 27, 2026
Merged

Refactor#3
soderlind merged 3 commits intomainfrom
gpt/image

Conversation

@soderlind
Copy link
Copy Markdown
Owner

This pull request introduces version 0.3.0 of the AI Router plugin, focusing on enhanced support for Azure OpenAI, especially for image generation routing and per-request deployment switching. The update implements new mechanisms to override Azure deployment settings on a per-request basis, adds filters for capability discovery, and clarifies the synchronization of configuration options. These changes improve flexibility and compatibility with both text and image models.

Key changes include:

Azure OpenAI Per-request Routing and Option Syncing:

  • Added sync_request_options method to ConfigurationRepository, allowing deployment ID and API version to be set dynamically for each request, ensuring the correct Azure deployment and model are used. This is exposed via the repository interface as well. [1] [2] [3]
  • In Router, introduced request-scoped overrides for deployment ID, API version, and capabilities, and registered new filters (pre_option_connectors_ai_azure_openai_deployment_id, pre_option_connectors_ai_azure_openai_api_version, and pre_option_connectors_ai_azure_openai_capabilities) to support per-request model and capability switching. [1] [2]

Image Generation Routing Support:

  • Added support for routing image generation requests (gpt-image-1, DALL-E) through the new per-request override system, enabling Azure OpenAI to handle both text and image models.

Documentation and Versioning:

  • Updated version numbers in ai-router.php, package.json, and readme.txt to 0.3.0, and documented new features and upgrade notices, including image generation routing support. [1] [2] [3] [4] [5] [6]

Clarification and Refactoring:

  • Clarified that only api_key and endpoint are synced globally for Azure OpenAI, while deployment ID and capabilities are now handled per-request, improving compatibility with dynamic model discovery. [1] [2]

Testing and Build Artifacts:

  • Updated test results and build asset versioning to reflect the new features and code changes. [1] [2]

- Add active_deployment_id and active_api_version properties to Router
- Use pre_option filters to override Azure connector settings per-request
- Prevent metadata cache poisoning when switching between capabilities
- Add after_generate hook to clear deployment overrides
- Split sync_connector_option to only persist api_key and endpoint
- Add sync_request_options method for deployment_id and api_version
- 54 tests passing with 170 assertions
@soderlind soderlind merged commit fbf369d into main Mar 27, 2026
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