Skip to content

Commit

Permalink
grok pricing and context
Browse files Browse the repository at this point in the history
  • Loading branch information
radiantspace committed Nov 18, 2024
1 parent fd6816a commit 5894710
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/app/ai/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ const (
OPUS_OUTPUT_PRICE = 75.0 / 1000000

// grok-beta
GROK_INPUT_PRICE = 0.5 / 1000000
GROK_OUTPUT_PRICE = 1.5 / 1000000
GROK_INPUT_PRICE = 5.0 / 1000000
GROK_OUTPUT_PRICE = 15.0 / 1000000

CHARS_PER_TOKEN = 2.0 // average number of characters per token, must be tuned or moved to tiktoken
)
Expand Down Expand Up @@ -329,6 +329,8 @@ func LimitPromptTokensForModel(model models.Engine, promptTokensCount float64) i
return int(math.Min(7*1024, promptTokensCount))
case models.Sonet35, models.Sonet35_241022, models.Haiku3, models.Opus3:
return int(math.Min(199*1024, promptTokensCount))
case models.Grok:
return int(math.Min(63*1024, promptTokensCount))
default:
return int(math.Min(3*1024, promptTokensCount))
}
Expand Down

0 comments on commit 5894710

Please sign in to comment.