Fix model alias usage in upstream path (#230)

Model alias values are not properly resolved and work in upstream/ path.

Related to #229.
This commit is contained in:
Benson Wong
2025-08-07 20:16:56 -07:00
committed by GitHub
parent 5b10b3c23f
commit 10569ed546
2 changed files with 65 additions and 51 deletions

View File

@@ -361,7 +361,7 @@ func (pm *ProxyManager) proxyToUpstream(c *gin.Context) {
return
}
processGroup, _, err := pm.swapProcessGroup(requestedModel)
processGroup, realModelName, err := pm.swapProcessGroup(requestedModel)
if err != nil {
pm.sendErrorResponse(c, http.StatusInternalServerError, fmt.Sprintf("error swapping process group: %s", err.Error()))
return
@@ -369,7 +369,7 @@ func (pm *ProxyManager) proxyToUpstream(c *gin.Context) {
// rewrite the path
c.Request.URL.Path = c.Param("upstreamPath")
processGroup.ProxyRequest(requestedModel, c.Writer, c.Request)
processGroup.ProxyRequest(realModelName, c.Writer, c.Request)
}
func (pm *ProxyManager) proxyOAIHandler(c *gin.Context) {