diff --git a/controller/model.go b/controller/model.go index 273c16a9..08819c72 100644 --- a/controller/model.go +++ b/controller/model.go @@ -53,51 +53,6 @@ func init() { }) // https://platform.openai.com/docs/models/model-endpoint-compatibility openAIModels = []OpenAIModels{ - { - Id: "gpt-35-turbo", - Object: "model", - Created: 1677649963, - OwnedBy: "openai", - Permission: permission, - Root: "gpt-35-turbo", - Parent: nil, - }, - { - Id: "gpt-35-turbo-0301", - Object: "model", - Created: 1677649963, - OwnedBy: "openai", - Permission: permission, - Root: "gpt-35-turbo-0301", - Parent: nil, - }, - { - Id: "gpt-35-turbo-0613", - Object: "model", - Created: 1677649963, - OwnedBy: "openai", - Permission: permission, - Root: "gpt-35-turbo-0613", - Parent: nil, - }, - { - Id: "gpt-35-turbo-16k", - Object: "model", - Created: 1677649963, - OwnedBy: "openai", - Permission: permission, - Root: "gpt-35-turbo-16k", - Parent: nil, - }, - { - Id: "gpt-35-turbo-16k-0613", - Object: "model", - Created: 1677649963, - OwnedBy: "openai", - Permission: permission, - Root: "gpt-35-turbo-16k-0613", - Parent: nil, - }, { Id: "gpt-3.5-turbo", Object: "model", diff --git a/middleware/distributor.go b/middleware/distributor.go index 08568ea1..14658758 100644 --- a/middleware/distributor.go +++ b/middleware/distributor.go @@ -73,6 +73,9 @@ func Distribute() func(c *gin.Context) { modelRequest.Model = "text-moderation-stable" } } + if strings.HasPrefix(modelRequest.Model, "gpt-35-turbo") { + modelRequest.Model = strings.Replace(modelRequest.Model, "gpt-35-turbo", "gpt-3.5-turbo", 1) + } channel, err = model.GetRandomSatisfiedChannel(userGroup, modelRequest.Model) if err != nil { c.JSON(200, gin.H{