feat(iflow): add support for glm-5, minimax-m2.5, qwen3-32b, tstars2.0, iflow-rome-30ba3b#130
feat(iflow): add support for glm-5, minimax-m2.5, qwen3-32b, tstars2.0, iflow-rome-30ba3b#130MasuRii wants to merge 3 commits intoMirrowel:devfrom
Conversation
…0, iflow-rome-30ba3b Add five new models to the iFlow provider to maintain feature parity with the competitor repository (router-for-me/CLIProxyAPI): - glm-5: Added to HARDCODED_MODELS, ENABLE_THINKING_MODELS, and GLM_MODELS (thinking support with GLM-style clear_thinking handling) - minimax-m2.5: Added to HARDCODED_MODELS and REASONING_SPLIT_MODELS (thinking support via reasoning_split boolean) - qwen3-32b: Added to HARDCODED_MODELS and ENABLE_THINKING_MODELS (thinking support) - tstars2.0: Added to HARDCODED_MODELS (multimodal assistant) - iflow-rome-30ba3b: Added to HARDCODED_MODELS (iFlow Rome model) Also update REASONING_PRESERVATION_MODELS_PREFIXES to include "glm-5" and "tstars" prefixes, and alphabetically sort the HARDCODED_MODELS list for maintainability. Closes: Mirrowel#129
|
Starting my review of the iFlow provider updates. I'll be checking the configuration for the 5 new models (glm-5, minimax-m2.5, qwen3-32b, tstars2.0, and iflow-rome-30ba3b) to ensure they're correctly registered and integrated. 🔍 |
There was a problem hiding this comment.
Overall Assessment
Nice work on expanding the iFlow model support! Adding these 5 new models (glm-5, minimax-m2.5, qwen3-32b, tstars2.0, and iflow-rome-30ba3b) with their specific thinking and reasoning configurations ensures the provider stays up-to-date with the latest offerings. The internal grouping of models by family in HARDCODED_MODELS is also a great improvement for maintainability.
Architectural Feedback
The approach of using specific sets for different thinking/reasoning behaviors (ENABLE_THINKING_MODELS, GLM_MODELS, REASONING_SPLIT_MODELS) is clean and matches the established patterns in the codebase.
Key Suggestions
- Reasoning Preservation: I've noted that
qwen3-32b(and some existing models likedeepseek-v3.2) are missing from theREASONING_PRESERVATION_MODELS_PREFIXESlist. If these models returnreasoning_content, adding them to this list is necessary for coherent multi-turn conversations. - Prefix Simplification: Suggesting a move to more generic prefixes (e.g.,
glm-instead of version-specific ones) to reduce the need for future updates.
Nitpicks
- Alphabetical Sorting: The
deepseekfamily is currently slightly out of place in the family-sorted list.
Questions for the Author
- Does
iflow-rome-30ba3balso support any form of thinking or reasoning content, or is it strictly a standard completion model? - Are there specific reasons why
deepseekandqwenmodels are excluded from the reasoning preservation cache?
This review was generated by an AI assistant.
There was a problem hiding this comment.
Pull request overview
Adds support for additional iFlow model IDs and updates model-specific “thinking/reasoning” handling, with substantial additional refactoring in the iFlow provider around payload shaping and streaming error handling.
Changes:
- Register 5 new iFlow models and update model capability sets (thinking, GLM handling, reasoning_split, reasoning preservation prefixes).
- Expand iFlow provider request/stream handling (suffix-based thinking config parsing, image normalization + fallback logic, gzip handling, token usage estimation).
- Harden embedding cost calculation to handle missing usage/cost metadata.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
src/rotator_library/providers/iflow_provider.py |
Adds new model IDs and significantly refactors request building + streaming handling (thinking config, image handling, gzip, token estimation). |
src/rotator_library/client/executor.py |
Makes embedding cost calculation resilient to usage=None and input_cost_per_token being None or 0.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9817625 to
87b894b
Compare
Sort HARDCODED_MODELS alphabetically (deepseek before glm). Expand REASONING_PRESERVATION_MODELS_PREFIXES to include deepseek, qwen, and use broader prefix matching. Simplify _inject_reasoning_content docstring. Refs: Mirrowel#130
Replace broad prefixes ("deepseek", "glm-", "minimax-", "qwen") with specific model identifiers ("glm-4", "glm-5", "minimax-m2", "qwen3-32b", "deepseek-v3.1", "deepseek-v3.2") in REASONING_PRESERVATION_MODELS_PREFIXES to prevent unintended matches on future models that may not support reasoning content preservation.
Summary
Add support for 5 new iFlow models to maintain feature parity: glm-5, minimax-m2.5, qwen3-32b, tstars2.0, and iflow-rome-30ba3b. Each model is registered with appropriate thinking, reasoning, and preservation configurations.
Changes
glm-5,minimax-m2.5,qwen3-32b,tstars2.0, andiflow-rome-30ba3btoHARDCODED_MODELSglm-5toENABLE_THINKING_MODELSandGLM_MODELSsetsqwen3-32btoENABLE_THINKING_MODELSsetminimax-m2.5toREASONING_SPLIT_MODELSsetREASONING_PRESERVATION_MODELS_PREFIXESwithglm-5andtstarsprefixesHARDCODED_MODELSlist alphabetically by model family for consistencyFiles Changed
src/rotator_library/providers/iflow_provider.pyTesting Instructions
glm-5— should sendenable_thinking+clear_thinking=false(GLM-style)minimax-m2.5— should usereasoning_splitinstead ofenable_thinkingqwen3-32b— should sendenable_thinkingtstars2.0andiflow-rome-30ba3b— standard chat completionsTested right now:

Closes #129
Important
Add support for new iFlow models
glm-5,minimax-m2.5,qwen3-32b,tstars2.0, andiflow-rome-30ba3bwith appropriate configurations iniflow_provider.py.glm-5,minimax-m2.5,qwen3-32b,tstars2.0,iflow-rome-30ba3btoHARDCODED_MODELSiniflow_provider.py.glm-5toENABLE_THINKING_MODELSandGLM_MODELS.qwen3-32btoENABLE_THINKING_MODELS.minimax-m2.5toREASONING_SPLIT_MODELS.REASONING_PRESERVATION_MODELS_PREFIXESwithglm-5andtstarsprefixes.HARDCODED_MODELSalphabetically by model family.This description was created by
for 87b894b. You can customize this summary. It will automatically update as commits are pushed.