update cost
This commit is contained in:
@@ -238,7 +238,7 @@ func TransReq(chatreq *openai.ChatCompletionRequest) (*bytes.Buffer, error) {
|
||||
MaxTokensToSample: chatreq.MaxTokens,
|
||||
}
|
||||
if transReq.MaxTokensToSample == 0 {
|
||||
transReq.MaxTokensToSample = 1000000
|
||||
transReq.MaxTokensToSample = 100000
|
||||
}
|
||||
var prompt string
|
||||
for _, msg := range chatreq.Messages {
|
||||
|
||||
@@ -725,6 +725,13 @@ func Cost(model string, promptCount, completionCount int) float64 {
|
||||
case "whisper-1":
|
||||
// 0.006$/min
|
||||
cost = 0.006 * float64(prompt+completion) / 60
|
||||
// claude /million tokens
|
||||
case "claude-v1", "claude-v1-100k":
|
||||
cost = 11.02/1000000*float64(prompt) + (32.68/1000000)*float64(completion)
|
||||
case "claude-instant-v1", "claude-instant-v1-100k":
|
||||
cost = (1.63/1000000)*float64(prompt) + (5.51/1000000)*float64(completion)
|
||||
case "claude-2":
|
||||
cost = (11.02/1000000)*float64(prompt) + (32.68/1000000)*float64(completion)
|
||||
default:
|
||||
if strings.Contains(model, "gpt-3.5-turbo") {
|
||||
cost = 0.003 * float64((prompt+completion)/1000)
|
||||
|
||||
Reference in New Issue
Block a user