Repository navigation
feat(azure_ai): support FLUX.2 flex images #39424
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
mateo-berri
merged 6 commits into
BerriAI:main
from
emerzon:litellm_azure_ai_flux_2_flex
Sep 18, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
911f66a
feat(azure_ai): support FLUX.2 flex images
emerzon ff1e2a0
fix(proxy): preserve CI-compatible OpenAPI snapshot formatting
emerzon 3821e5a
fix(azure_ai): specify FLUX parameter mapping return type
emerzon 4595b4f
fix(azure-ai): coerce FLUX controls and preserve response dimensions
emerzon cf08440
fix(azure-ai): price FLUX.2 Flex by its resolved cost map key
mateo-berri c0b0ba2
fix(azure-ai): keep FLUX.2 tolerant of OpenAI-only image params
mateo-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FLUX.2 capability check and supported-parameter list are hardcoded in this transformation. This violates the repository directive that model-specific flags be stored in
model_prices_and_context_window.jsonand read throughget_model_info. As written, adding another FLUX.2 variant or changing its capabilities requires a LiteLLM code release rather than a catalog update. This repository requirement must be satisfied before merging. The same issue applies to the inline parameter list at lines 73–88.Rule Used: What: Do not hardcode model-specific flags in the codebase. Instead, put them in model_prices_and_context_window.json and then read them in via get_model_info Why: Prevents need for users to upgrade litellm each time a new model supports this featu... (source)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name check predates this PR, every image provider config lists params in code, and custom deployment names have no cost map entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. I re-evaluated this and agree the finding is not actionable here.
is_flux2_modelinlitellm/llms/azure_ai/image_generation/flux_transformation.py:67-75is endpoint routing, not a model capability flag, and custom deployment names should not need individual cost-map entries. The parameter list at:77-88is the provider transformation contract; it also encodes mappings and behavior (n→num_images,sizeparsing, and dropping OpenAI-only fields) thatmodel_prices_and_context_window.jsoncannot represent. Given the established provider-config pattern, this should not block the PR. No change is needed for this comment.