Skip to content

Commit

Permalink
feat: groq support Llama3 now (songquanpeng#1333)
Browse files Browse the repository at this point in the history
* feat: groq support Llama3 now

* fix: update model ratio

---------

Co-authored-by: JustSong <[email protected]>
  • Loading branch information
tylinux and songquanpeng authored Apr 21, 2024
1 parent 129282f commit a2a00df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions relay/adaptor/groq/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ var ModelList = []string{
"llama2-7b-2048",
"llama2-70b-4096",
"mixtral-8x7b-32768",
"llama3-8b-8192",
"llama3-70b-8192",
}
14 changes: 10 additions & 4 deletions relay/billing/ratio/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ var ModelRatio = map[string]float64{
"mistral-medium-latest": 2.7 / 1000 * USD,
"mistral-large-latest": 8.0 / 1000 * USD,
"mistral-embed": 0.1 / 1000 * USD,
// https://wow.groq.com/
"llama2-70b-4096": 0.7 / 1000 * USD,
"llama2-7b-2048": 0.1 / 1000 * USD,
// https://wow.groq.com/#:~:text=inquiries%C2%A0here.-,Model,-Current%20Speed
"llama3-70b-8192": 0.59 / 1000 * USD,
"mixtral-8x7b-32768": 0.27 / 1000 * USD,
"llama3-8b-8192": 0.05 / 1000 * USD,
"gemma-7b-it": 0.1 / 1000 * USD,
"llama2-70b-4096": 0.64 / 1000 * USD,
"llama2-7b-2048": 0.1 / 1000 * USD,
// https://platform.lingyiwanwu.com/docs#-计费单元
"yi-34b-chat-0205": 2.5 / 1000 * RMB,
"yi-34b-chat-200k": 12.0 / 1000 * RMB,
Expand Down Expand Up @@ -277,7 +279,11 @@ func GetCompletionRatio(name string) float64 {
}
switch name {
case "llama2-70b-4096":
return 0.8 / 0.7
return 0.8 / 0.64
case "llama3-8b-8192":
return 2
case "llama3-70b-8192":
return 0.79 / 0.59
}
return 1
}

0 comments on commit a2a00df

Please sign in to comment.