Skip to content

Commit

Permalink
update llama names
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Oct 9, 2024
1 parent a8a0dab commit 06bb1dc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,75 +13,75 @@
"models": [
{
"id": "llama-3.2-90b-text-preview",
"name": "llama-3.2-90b-text-preview",
"name": "Llama 3.2 (90b Text Preview)",
"default": true,
"max_tokens": 8192
},
{
"id": "llama-3.2-11b-text-preview",
"name": "llama-3.2-11b-text-preview",
"name": "Llama 3.2 (11b Text Preview)",
"default": false,
"max_tokens": 8192
},
{
"id": "llama-3.2-11b-vision-preview",
"name": "llama-3.2-11b-vision-preview",
"name": "Llama 3.2 (11b Vision Preview)",
"default": false,
"max_tokens": 8192
},
{
"id": "llama-3.2-3b-preview",
"name": "llama-3.2-3b-preview",
"name": "Llama 3.2 (3b Preview)",
"default": false,
"max_tokens": 8192
},
{
"id": "llama-3.2-1b-preview",
"name": "llama-3.2-1b-preview",
"name": "Llama 3.2 (1b Preview)",
"default": false,
"max_tokens": 8192
},
{
"id": "llama-guard-3-8b",
"name": "llama-guard-3-8b",
"id": "llama3-70b-8192",
"name": "Llama3 70b (8192)",
"default": false,
"max_tokens": 8192
},
{
"id": "llama3-70b-8192",
"name": "llama3-70b-8192",
"id": "llama-guard-3-8b",
"name": "Llama Guard (3 8b)",
"default": false,
"max_tokens": 8192
},
{
"id": "llama-3.1-70b-versatile",
"name": "llama-3.1-70b-versatile",
"id": "llama3-8b-8192",
"name": "Llama3 8b (8192)",
"default": false,
"max_tokens": 131072
"max_tokens": 8192
},
{
"id": "llama3-groq-70b-8192-tool-use-preview",
"name": "llama3-groq-70b-8192-tool-use-preview",
"id": "llama3-groq-8b-8192-tool-use-preview",
"name": "Llama3 Groq (8b 8192 Tool Use)",
"default": false,
"max_tokens": 8192
},
{
"id": "llama-3.1-8b-instant",
"name": "llama-3.1-8b-instant",
"name": "Llama 3.1 (8b Instant)",
"default": false,
"max_tokens": 131072
},
{
"id": "llama3-groq-8b-8192-tool-use-preview",
"name": "llama3-groq-8b-8192-tool-use-preview",
"id": "llama3-groq-70b-8192-tool-use-preview",
"name": "Llama3 Groq (70b 8192 Tool Use)",
"default": false,
"max_tokens": 8192
},
{
"id": "llama3-8b-8192",
"name": "llama3-8b-8192",
"id": "llama-3.1-70b-versatile",
"name": "Llama 3.1 (70b Versatile)",
"default": false,
"max_tokens": 8192
"max_tokens": 131072
}
]
},
Expand Down
18 changes: 18 additions & 0 deletions utils/initModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,26 @@ import { writeFileSync } from "fs";
const groqProvider = config.providers.find((provider: AIProvider) => provider.name === "Groq");
// eslint-disable-next-line no-undef
const apiKey = process.env.GROQ_API_KEY || "";

function capitalizeFirstLetter(string: string): string {
return string.charAt(0).toUpperCase() + string.slice(1);
}
// normalize the model name from llama-3.1-70b-versatile to Llama 3.1 (70b) Versatile
function normalizeModelName(name: string): string {
const parts = name.split("-");
const capitalized = parts.map((part) => capitalizeFirstLetter(part));
const retString =
`${capitalized[0]} ${capitalized[1]} (${capitalized[2]} ${capitalized[3] || ""} ${capitalized[4] || ""} ${capitalized[5] || ""}`.trim() +
")";
return retString.trim();
}

const groqModels = getAIModels(groqProvider, apiKey, "llama");
groqModels.then((models) => {
models = models.map((model) => {
model.name = normalizeModelName(model.name);
return model;
});
const newConfig = { ...config };
// replace the models for the Groq provider
newConfig.providers = newConfig.providers.map((provider: AIProvider) => {
Expand Down

0 comments on commit 06bb1dc

Please sign in to comment.