diff --git a/common/model-ratio.go b/common/model-ratio.go index 5865b4dc..f26a12da 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -38,8 +38,8 @@ var ModelRatio = map[string]float64{ "text-moderation-stable": 0.1, "text-moderation-latest": 0.1, "dall-e": 8, - "claude-instant-1": 0.75, - "claude-2": 30, + "claude-instant-1": 0.815, // $1.63/million tokens + "claude-2": 5.51, // $11.02/million tokens "ERNIE-Bot": 0.8572, // ¥0.012 / 1k tokens "ERNIE-Bot-turbo": 0.5715, // ¥0.008 / 1k tokens "Embedding-V1": 0.1429, // ¥0.002 / 1k tokens diff --git a/controller/relay-text.go b/controller/relay-text.go index 761ca86f..1b5dc228 100644 --- a/controller/relay-text.go +++ b/controller/relay-text.go @@ -334,6 +334,13 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode { completionRatio = 2 } + if strings.HasPrefix(textRequest.Model, "claude-instant-1") { + completionRatio = 3.38 + } + if strings.HasPrefix(textRequest.Model, "claude-2") { + completionRatio = 2.965517 + } + promptTokens = textResponse.Usage.PromptTokens completionTokens = textResponse.Usage.CompletionTokens