diff --git a/src/config.json b/src/config.json index dc520de..137a119 100644 --- a/src/config.json +++ b/src/config.json @@ -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 } ] }, diff --git a/utils/initModels.ts b/utils/initModels.ts index 8bc495e..a348564 100644 --- a/utils/initModels.ts +++ b/utils/initModels.ts @@ -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) => {