Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion core/schemas/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,11 @@ func isOpenAIReasoningModel(model string) bool {
return len(name) == 2 || name[2] == '-'
}

// IsAzureModelRouter reports whether model is Azure's model-router model.
func IsAzureModelRouter(model string) bool {
return strings.Contains(model, "model-router")
}

// IsElevenlabsSoundModel checks if the model targets ElevenLabs' text-to-sound
// effects API (POST /v1/sound-generation, e.g. "eleven_text_to_sound_v2")
// rather than text-to-speech. These models are not tied to a voice.
Expand Down Expand Up @@ -1837,4 +1842,4 @@ func SameBaseModel(a, b string) bool {

// Compare normalized base names.
return BaseModelName(a) == BaseModelName(b)
}
}
15 changes: 11 additions & 4 deletions plugins/compat/dropparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,16 @@ func dropUnsupportedParams(ctx *schemas.BifrostContext, req *schemas.BifrostRequ
params.PromptCacheKey = nil
dropped = append(dropped, "prompt_cache_key")
}
if params.Reasoning != nil && !isSupported["reasoning"] {
params.Reasoning = nil
dropped = append(dropped, "reasoning")
if params.Reasoning != nil {
if !isSupported["reasoning"] {
params.Reasoning = nil
dropped = append(dropped, "reasoning")
} else if params.Reasoning.Summary != nil && *params.Reasoning.Summary != "auto" &&
schemas.IsAzureModelRouter(req.ResponsesRequest.Model) {
// model-router only supports "auto" summary
params.Reasoning.Summary = nil
Comment thread
sammaji marked this conversation as resolved.
dropped = append(dropped, "reasoning.summary")
}
}
if params.ServiceTier != nil && !isSupported["service_tier"] {
params.ServiceTier = nil
Expand Down Expand Up @@ -357,4 +364,4 @@ func applyBedrockResponsesCompatibility(req *schemas.BifrostResponsesRequest) []
msg.Content.ContentBlocks = kept
}
return dropped
}
}
Loading