mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-02 20:40:52 +08:00
feat(iflow): add iflow-rome model definition
This commit is contained in:
@@ -742,6 +742,7 @@ func GetIFlowModels() []*ModelInfo {
|
||||
{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.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))
|
||||
for _, entry := range entries {
|
||||
|
||||
@@ -87,7 +87,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
|
||||
log.WithFields(log.Fields{
|
||||
"provider": provider,
|
||||
"model": model,
|
||||
}).Debug("thinking: unknown provider, passthrough")
|
||||
}).Debug("thinking: unknown provider, passthrough |")
|
||||
return body, nil
|
||||
}
|
||||
|
||||
@@ -108,13 +108,13 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
|
||||
log.WithFields(log.Fields{
|
||||
"model": baseModel,
|
||||
"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
|
||||
}
|
||||
log.WithFields(log.Fields{
|
||||
"provider": provider,
|
||||
"model": baseModel,
|
||||
}).Debug("thinking: model does not support thinking, passthrough")
|
||||
}).Debug("thinking: model does not support thinking, passthrough |")
|
||||
return body, nil
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
|
||||
"mode": config.Mode,
|
||||
"budget": config.Budget,
|
||||
"level": config.Level,
|
||||
}).Debug("thinking: config from model suffix")
|
||||
}).Debug("thinking: config from model suffix |")
|
||||
} else {
|
||||
config = extractThinkingConfig(body, provider)
|
||||
if hasThinkingConfig(config) {
|
||||
@@ -138,7 +138,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
|
||||
"mode": config.Mode,
|
||||
"budget": config.Budget,
|
||||
"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{
|
||||
"provider": provider,
|
||||
"model": modelInfo.ID,
|
||||
}).Debug("thinking: no config found, passthrough")
|
||||
}).Debug("thinking: no config found, passthrough |")
|
||||
return body, nil
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
|
||||
"provider": provider,
|
||||
"model": modelInfo.ID,
|
||||
"error": err.Error(),
|
||||
}).Warn("thinking: validation failed")
|
||||
}).Warn("thinking: validation failed |")
|
||||
// Return original body on validation failure (defensive programming).
|
||||
// This ensures callers who ignore the error won't receive nil body.
|
||||
// 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{
|
||||
"provider": provider,
|
||||
"model": modelInfo.ID,
|
||||
}).Warn("thinking: ValidateConfig returned nil config without error, passthrough")
|
||||
}).Warn("thinking: ValidateConfig returned nil config without error, passthrough |")
|
||||
return body, nil
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ func ApplyThinking(body []byte, model string, provider string) ([]byte, error) {
|
||||
"mode": validated.Mode,
|
||||
"budget": validated.Budget,
|
||||
"level": validated.Level,
|
||||
}).Debug("thinking: processed config to apply")
|
||||
}).Debug("thinking: processed config to apply |")
|
||||
|
||||
// 6. Apply configuration using provider-specific applier
|
||||
return applier.Apply(body, *validated, modelInfo)
|
||||
@@ -222,7 +222,7 @@ func parseSuffixToConfig(rawSuffix, provider, model string) ThinkingConfig {
|
||||
"provider": provider,
|
||||
"model": model,
|
||||
"raw_suffix": rawSuffix,
|
||||
}).Debug("thinking: unknown suffix format, treating as no config")
|
||||
}).Debug("thinking: unknown suffix format, treating as no config |")
|
||||
return ThinkingConfig{}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ func applyUserDefinedModel(body []byte, modelInfo *registry.ModelInfo, provider
|
||||
log.WithFields(log.Fields{
|
||||
"model": modelID,
|
||||
"provider": provider,
|
||||
}).Debug("thinking: user-defined model, passthrough (no config)")
|
||||
}).Debug("thinking: user-defined model, passthrough (no config) |")
|
||||
return body, nil
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ func applyUserDefinedModel(body []byte, modelInfo *registry.ModelInfo, provider
|
||||
log.WithFields(log.Fields{
|
||||
"model": modelID,
|
||||
"provider": provider,
|
||||
}).Debug("thinking: user-defined model, passthrough (unknown provider)")
|
||||
}).Debug("thinking: user-defined model, passthrough (unknown provider) |")
|
||||
return body, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ func ClampBudget(value int, modelInfo *registry.ModelInfo, provider string) int
|
||||
"clamped_to": min,
|
||||
"min": min,
|
||||
"max": max,
|
||||
}).Warn("thinking: budget zero not allowed")
|
||||
}).Warn("thinking: budget zero not allowed |")
|
||||
return min
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ func convertAutoToMidRange(config ThinkingConfig, support *registry.ThinkingSupp
|
||||
"model": model,
|
||||
"original_mode": "auto",
|
||||
"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
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ func convertAutoToMidRange(config ThinkingConfig, support *registry.ThinkingSupp
|
||||
"model": model,
|
||||
"original_mode": "auto",
|
||||
"clamped_to": config.Budget,
|
||||
}).Debug("thinking: mode converted: dynamic not allowed")
|
||||
}).Debug("thinking: mode converted, dynamic not allowed |")
|
||||
return config
|
||||
}
|
||||
|
||||
@@ -255,5 +255,5 @@ func logClamp(provider, model string, original, clampedTo, min, max int) {
|
||||
"min": min,
|
||||
"max": max,
|
||||
"clamped_to": clampedTo,
|
||||
}).Debug("thinking: budget clamped")
|
||||
}).Debug("thinking: budget clamped |")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user