feat(iflow): add iflow-rome model definition

This commit is contained in:
hkfires
2026-01-15 20:23:55 +08:00
parent 199cf480b0
commit 2b387e169b
3 changed files with 17 additions and 16 deletions

View File

@@ -742,6 +742,7 @@ func GetIFlowModels() []*ModelInfo {
{ID: "qwen3-235b", DisplayName: "Qwen3-235B-A22B", Description: "Qwen3 235B A22B", Created: 1753401600}, {ID: "qwen3-235b", DisplayName: "Qwen3-235B-A22B", Description: "Qwen3 235B A22B", Created: 1753401600},
{ID: "minimax-m2", DisplayName: "MiniMax-M2", Description: "MiniMax M2", Created: 1758672000, Thinking: iFlowThinkingSupport}, {ID: "minimax-m2", DisplayName: "MiniMax-M2", Description: "MiniMax M2", Created: 1758672000, Thinking: iFlowThinkingSupport},
{ID: "minimax-m2.1", DisplayName: "MiniMax-M2.1", Description: "MiniMax M2.1", Created: 1766448000, Thinking: iFlowThinkingSupport}, {ID: "minimax-m2.1", DisplayName: "MiniMax-M2.1", Description: "MiniMax M2.1", Created: 1766448000, Thinking: iFlowThinkingSupport},
{ID: "iflow-rome-30ba3b", DisplayName: "iFlow-ROME", Description: "iFlow Rome 30BA3B model", Created: 1736899200},
} }
models := make([]*ModelInfo, 0, len(entries)) models := make([]*ModelInfo, 0, len(entries))
for _, entry := range entries { for _, entry := range entries {

View File

@@ -87,7 +87,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"provider": provider, "provider": provider,
"model": model, "model": model,
}).Debug("thinking: unknown provider, passthrough") }).Debug("thinking: unknown provider, passthrough |")
return body, nil return body, nil
} }
@@ -108,13 +108,13 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"model": baseModel, "model": baseModel,
"provider": provider, "provider": provider,
}).Debug("thinking: model does not support thinking, stripping config") }).Debug("thinking: model does not support thinking, stripping config |")
return StripThinkingConfig(body, provider), nil return StripThinkingConfig(body, provider), nil
} }
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"provider": provider, "provider": provider,
"model": baseModel, "model": baseModel,
}).Debug("thinking: model does not support thinking, passthrough") }).Debug("thinking: model does not support thinking, passthrough |")
return body, nil return body, nil
} }
@@ -128,7 +128,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
"mode": config.Mode, "mode": config.Mode,
"budget": config.Budget, "budget": config.Budget,
"level": config.Level, "level": config.Level,
}).Debug("thinking: config from model suffix") }).Debug("thinking: config from model suffix |")
} else { } else {
config = extractThinkingConfig(body, provider) config = extractThinkingConfig(body, provider)
if hasThinkingConfig(config) { if hasThinkingConfig(config) {
@@ -138,7 +138,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
"mode": config.Mode, "mode": config.Mode,
"budget": config.Budget, "budget": config.Budget,
"level": config.Level, "level": config.Level,
}).Debug("thinking: original config from request") }).Debug("thinking: original config from request |")
} }
} }
@@ -146,7 +146,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"provider": provider, "provider": provider,
"model": modelInfo.ID, "model": modelInfo.ID,
}).Debug("thinking: no config found, passthrough") }).Debug("thinking: no config found, passthrough |")
return body, nil return body, nil
} }
@@ -157,7 +157,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
"provider": provider, "provider": provider,
"model": modelInfo.ID, "model": modelInfo.ID,
"error": err.Error(), "error": err.Error(),
}).Warn("thinking: validation failed") }).Warn("thinking: validation failed |")
// Return original body on validation failure (defensive programming). // Return original body on validation failure (defensive programming).
// This ensures callers who ignore the error won't receive nil body. // This ensures callers who ignore the error won't receive nil body.
// The upstream service will decide how to handle the unmodified request. // The upstream service will decide how to handle the unmodified request.
@@ -169,7 +169,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"provider": provider, "provider": provider,
"model": modelInfo.ID, "model": modelInfo.ID,
}).Warn("thinking: ValidateConfig returned nil config without error, passthrough") }).Warn("thinking: ValidateConfig returned nil config without error, passthrough |")
return body, nil return body, nil
} }
@@ -179,7 +179,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
"mode": validated.Mode, "mode": validated.Mode,
"budget": validated.Budget, "budget": validated.Budget,
"level": validated.Level, "level": validated.Level,
}).Debug("thinking: processed config to apply") }).Debug("thinking: processed config to apply |")
// 6. Apply configuration using provider-specific applier // 6. Apply configuration using provider-specific applier
return applier.Apply(body, *validated, modelInfo) return applier.Apply(body, *validated, modelInfo)
@@ -222,7 +222,7 @@ func parseSuffixToConfig(rawSuffix, provider, model string) ThinkingConfig {
"provider": provider, "provider": provider,
"model": model, "model": model,
"raw_suffix": rawSuffix, "raw_suffix": rawSuffix,
}).Debug("thinking: unknown suffix format, treating as no config") }).Debug("thinking: unknown suffix format, treating as no config |")
return ThinkingConfig{} return ThinkingConfig{}
} }
@@ -249,7 +249,7 @@ func applyUserDefinedModel(body []byte, modelInfo *registry.ModelInfo, provider
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"model": modelID, "model": modelID,
"provider": provider, "provider": provider,
}).Debug("thinking: user-defined model, passthrough (no config)") }).Debug("thinking: user-defined model, passthrough (no config) |")
return body, nil return body, nil
} }
@@ -258,7 +258,7 @@ func applyUserDefinedModel(body []byte, modelInfo *registry.ModelInfo, provider
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"model": modelID, "model": modelID,
"provider": provider, "provider": provider,
}).Debug("thinking: user-defined model, passthrough (unknown provider)") }).Debug("thinking: user-defined model, passthrough (unknown provider) |")
return body, nil return body, nil
} }

View File

@@ -44,7 +44,7 @@ func ClampBudget(value int, modelInfo *registry.ModelInfo, provider string) int
"clamped_to": min, "clamped_to": min,
"min": min, "min": min,
"max": max, "max": max,
}).Warn("thinking: budget zero not allowed") }).Warn("thinking: budget zero not allowed |")
return min return min
} }
@@ -221,7 +221,7 @@ func convertAutoToMidRange(config ThinkingConfig, support *registry.ThinkingSupp
"model": model, "model": model,
"original_mode": "auto", "original_mode": "auto",
"clamped_to": string(LevelMedium), "clamped_to": string(LevelMedium),
}).Debug("thinking: mode converted: dynamic not allowed, using medium level") }).Debug("thinking: mode converted, dynamic not allowed, using medium level |")
return config return config
} }
@@ -242,7 +242,7 @@ func convertAutoToMidRange(config ThinkingConfig, support *registry.ThinkingSupp
"model": model, "model": model,
"original_mode": "auto", "original_mode": "auto",
"clamped_to": config.Budget, "clamped_to": config.Budget,
}).Debug("thinking: mode converted: dynamic not allowed") }).Debug("thinking: mode converted, dynamic not allowed |")
return config return config
} }
@@ -255,5 +255,5 @@ func logClamp(provider, model string, original, clampedTo, min, max int) {
"min": min, "min": min,
"max": max, "max": max,
"clamped_to": clampedTo, "clamped_to": clampedTo,
}).Debug("thinking: budget clamped") }).Debug("thinking: budget clamped |")
} }