From 466bf7dc9c3ffc0502cf3f63a53655d024cb2a9c Mon Sep 17 00:00:00 2001
From: timothycarambat <rambat1010@gmail.com>
Date: Wed, 31 Jul 2024 10:58:34 -0700
Subject: [PATCH] Bump Perplexity and Together AI static model list

---
 server/utils/AiProviders/perplexity/index.js  |  2 +-
 server/utils/AiProviders/perplexity/models.js | 30 ++++++
 .../perplexity/scripts/chat_models.txt        | 22 +++--
 .../AiProviders/perplexity/scripts/parse.mjs  |  2 +-
 server/utils/AiProviders/togetherAi/models.js | 96 ++++++++++++++++---
 .../togetherAi/scripts/chat_models.txt        | 22 ++++-
 .../AiProviders/togetherAi/scripts/parse.mjs  |  2 +-
 7 files changed, 148 insertions(+), 28 deletions(-)

diff --git a/server/utils/AiProviders/perplexity/index.js b/server/utils/AiProviders/perplexity/index.js
index 438306638..712605f0b 100644
--- a/server/utils/AiProviders/perplexity/index.js
+++ b/server/utils/AiProviders/perplexity/index.js
@@ -21,7 +21,7 @@ class PerplexityLLM {
     this.model =
       modelPreference ||
       process.env.PERPLEXITY_MODEL_PREF ||
-      "sonar-small-online"; // Give at least a unique model to the provider as last fallback.
+      "llama-3-sonar-large-32k-online"; // Give at least a unique model to the provider as last fallback.
     this.limits = {
       history: this.promptWindowLimit() * 0.15,
       system: this.promptWindowLimit() * 0.15,
diff --git a/server/utils/AiProviders/perplexity/models.js b/server/utils/AiProviders/perplexity/models.js
index 124e3ea12..f20ce70ca 100644
--- a/server/utils/AiProviders/perplexity/models.js
+++ b/server/utils/AiProviders/perplexity/models.js
@@ -19,6 +19,26 @@ const MODELS = {
     name: "llama-3-sonar-large-32k-chat",
     maxLength: 32768,
   },
+  "llama-3.1-sonar-small-128k-online": {
+    id: "llama-3.1-sonar-small-128k-online",
+    name: "llama-3.1-sonar-small-128k-online",
+    maxLength: 127072,
+  },
+  "llama-3.1-sonar-small-128k-chat": {
+    id: "llama-3.1-sonar-small-128k-chat",
+    name: "llama-3.1-sonar-small-128k-chat",
+    maxLength: 131072,
+  },
+  "llama-3.1-sonar-large-128k-online": {
+    id: "llama-3.1-sonar-large-128k-online",
+    name: "llama-3.1-sonar-large-128k-online",
+    maxLength: 127072,
+  },
+  "llama-3.1-sonar-large-128k-chat": {
+    id: "llama-3.1-sonar-large-128k-chat",
+    name: "llama-3.1-sonar-large-128k-chat",
+    maxLength: 131072,
+  },
   "llama-3-8b-instruct": {
     id: "llama-3-8b-instruct",
     name: "llama-3-8b-instruct",
@@ -34,6 +54,16 @@ const MODELS = {
     name: "mixtral-8x7b-instruct",
     maxLength: 16384,
   },
+  "llama-3.1-8b-instruct": {
+    id: "llama-3.1-8b-instruct",
+    name: "llama-3.1-8b-instruct",
+    maxLength: 131072,
+  },
+  "llama-3.1-70b-instruct": {
+    id: "llama-3.1-70b-instruct",
+    name: "llama-3.1-70b-instruct",
+    maxLength: 131072,
+  },
 };
 
 module.exports.MODELS = MODELS;
diff --git a/server/utils/AiProviders/perplexity/scripts/chat_models.txt b/server/utils/AiProviders/perplexity/scripts/chat_models.txt
index 2d2d34f72..8e98f0c20 100644
--- a/server/utils/AiProviders/perplexity/scripts/chat_models.txt
+++ b/server/utils/AiProviders/perplexity/scripts/chat_models.txt
@@ -1,9 +1,15 @@
-| Model                              | Parameter Count | Context Length | Model Type      |
-| :--------------------------------- | :-------------- | :------------- | :-------------- |
-| `llama-3-sonar-small-32k-online` | 8B              | 28,000         | Chat Completion |
-| `llama-3-sonar-small-32k-chat`     | 8B              | 32,768         | Chat Completion |
-| `llama-3-sonar-large-32k-online` | 70B             | 28,000         | Chat Completion |
-| `llama-3-sonar-large-32k-chat`     | 70B             | 32,768         | Chat Completion |
-| `llama-3-8b-instruct`   | 8B              | 8,192          | Chat Completion |
+| Model                               | Parameter Count | Context Length | Model Type      |
+| :---------------------------------- | :-------------- | :------------- | :-------------- |
+| `llama-3-sonar-small-32k-online`  | 8B              | 28,000         | Chat Completion |
+| `llama-3-sonar-small-32k-chat`    | 8B              | 32,768         | Chat Completion |
+| `llama-3-sonar-large-32k-online`  | 70B             | 28,000         | Chat Completion |
+| `llama-3-sonar-large-32k-chat`    | 70B             | 32,768         | Chat Completion |
+| `llama-3.1-sonar-small-128k-online` | 8B              | 127,072        | Chat Completion |
+| `llama-3.1-sonar-small-128k-chat`   | 8B              | 131,072        | Chat Completion |
+| `llama-3.1-sonar-large-128k-online` | 70B             | 127,072        | Chat Completion |
+| `llama-3.1-sonar-large-128k-chat`   | 70B             | 131,072        | Chat Completion |
+| `llama-3-8b-instruct`  | 8B              | 8,192          | Chat Completion |
 | `llama-3-70b-instruct`  | 70B             | 8,192          | Chat Completion |
-| `mixtral-8x7b-instruct` | 8x7B            | 16,384         | Chat Completion |
\ No newline at end of file
+| `mixtral-8x7b-instruct` | 8x7B            | 16,384         | Chat Completion |
+| `llama-3.1-8b-instruct`   | 8B              | 131,072        | Chat Completion |
+| `llama-3.1-70b-instruct`  | 70B             | 131,072        | Chat Completion |
\ No newline at end of file
diff --git a/server/utils/AiProviders/perplexity/scripts/parse.mjs b/server/utils/AiProviders/perplexity/scripts/parse.mjs
index 6dec22d96..e4f27276f 100644
--- a/server/utils/AiProviders/perplexity/scripts/parse.mjs
+++ b/server/utils/AiProviders/perplexity/scripts/parse.mjs
@@ -8,7 +8,7 @@
 // copy outputs into the export in ../models.js
 
 // Update the date below if you run this again because Perplexity added new models.
-// Last Collected: Jul 19, 2024
+// Last Collected: Jul 31, 2024
 
 import fs from "fs";
 
diff --git a/server/utils/AiProviders/togetherAi/models.js b/server/utils/AiProviders/togetherAi/models.js
index 79ab93bab..c6b884c4f 100644
--- a/server/utils/AiProviders/togetherAi/models.js
+++ b/server/utils/AiProviders/togetherAi/models.js
@@ -1,16 +1,70 @@
 const MODELS = {
-  "zero-one-ai/Yi-34B-Chat": {
-    id: "zero-one-ai/Yi-34B-Chat",
-    organization: "01.AI",
-    name: "01-ai Yi Chat (34B)",
+  "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": {
+    id: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
+    organization: "Meta",
+    name: "Llama 3.1 8B Instruct Turbo",
+    maxLength: 128000,
+  },
+  "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo": {
+    id: "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
+    organization: "Meta",
+    name: "Llama 3.1 70B Instruct Turbo",
+    maxLength: 128000,
+  },
+  "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo": {
+    id: "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
+    organization: "Meta",
+    name: "Llama 3.1 405B Instruct Turbo",
     maxLength: 4096,
   },
+  "meta-llama/Meta-Llama-3-8B-Instruct-Turbo": {
+    id: "meta-llama/Meta-Llama-3-8B-Instruct-Turbo",
+    organization: "Meta",
+    name: "Llama 3 8B Instruct Turbo",
+    maxLength: 8192,
+  },
+  "meta-llama/Meta-Llama-3-70B-Instruct-Turbo": {
+    id: "meta-llama/Meta-Llama-3-70B-Instruct-Turbo",
+    organization: "Meta",
+    name: "Llama 3 70B Instruct Turbo",
+    maxLength: 8192,
+  },
+  "meta-llama/Meta-Llama-3-8B-Instruct-Lite": {
+    id: "meta-llama/Meta-Llama-3-8B-Instruct-Lite",
+    organization: "Meta",
+    name: "Llama 3 8B Instruct Lite",
+    maxLength: 8192,
+  },
+  "meta-llama/Meta-Llama-3-70B-Instruct-Lite": {
+    id: "meta-llama/Meta-Llama-3-70B-Instruct-Lite",
+    organization: "Meta",
+    name: "Llama 3 70B Instruct Lite",
+    maxLength: 8192,
+  },
+  "google/gemma-2-27b-it": {
+    id: "google/gemma-2-27b-it",
+    organization: "Google",
+    name: "Gemma 2 27B",
+    maxLength: 8192,
+  },
+  "google/gemma-2-9b-it": {
+    id: "google/gemma-2-9b-it",
+    organization: "Google",
+    name: "Gemma 2 9B",
+    maxLength: 8192,
+  },
   "allenai/OLMo-7B-Instruct": {
     id: "allenai/OLMo-7B-Instruct",
     organization: "Allen AI",
     name: "OLMo Instruct (7B)",
     maxLength: 2048,
   },
+  "zero-one-ai/Yi-34B-Chat": {
+    id: "zero-one-ai/Yi-34B-Chat",
+    organization: "01.AI",
+    name: "01-ai Yi Chat (34B)",
+    maxLength: 4096,
+  },
   "allenai/OLMo-7B-Twin-2T": {
     id: "allenai/OLMo-7B-Twin-2T",
     organization: "Allen AI",
@@ -135,19 +189,13 @@ const MODELS = {
     id: "meta-llama/Llama-3-8b-chat-hf",
     organization: "Meta",
     name: "LLaMA-3 Chat (8B)",
-    maxLength: 8000,
+    maxLength: 8192,
   },
   "meta-llama/Llama-3-70b-chat-hf": {
     id: "meta-llama/Llama-3-70b-chat-hf",
     organization: "Meta",
     name: "LLaMA-3 Chat (70B)",
-    maxLength: 8000,
-  },
-  "microsoft/WizardLM-2-8x22B": {
-    id: "microsoft/WizardLM-2-8x22B",
-    organization: "Microsoft",
-    name: "WizardLM-2 (8x22B)",
-    maxLength: 65536,
+    maxLength: 8192,
   },
   "mistralai/Mistral-7B-Instruct-v0.1": {
     id: "mistralai/Mistral-7B-Instruct-v0.1",
@@ -161,6 +209,12 @@ const MODELS = {
     name: "Mistral (7B) Instruct v0.2",
     maxLength: 32768,
   },
+  "mistralai/Mistral-7B-Instruct-v0.3": {
+    id: "mistralai/Mistral-7B-Instruct-v0.3",
+    organization: "mistralai",
+    name: "Mistral (7B) Instruct v0.3",
+    maxLength: 32768,
+  },
   "mistralai/Mixtral-8x7B-Instruct-v0.1": {
     id: "mistralai/Mixtral-8x7B-Instruct-v0.1",
     organization: "mistralai",
@@ -269,12 +323,30 @@ const MODELS = {
     name: "Qwen 1.5 Chat (72B)",
     maxLength: 32768,
   },
+  "Qwen/Qwen1.5-110B-Chat": {
+    id: "Qwen/Qwen1.5-110B-Chat",
+    organization: "Qwen",
+    name: "Qwen 1.5 Chat (110B)",
+    maxLength: 32768,
+  },
+  "Qwen/Qwen2-72B-Instruct": {
+    id: "Qwen/Qwen2-72B-Instruct",
+    organization: "Qwen",
+    name: "Qwen 2 Instruct (72B)",
+    maxLength: 32768,
+  },
   "snorkelai/Snorkel-Mistral-PairRM-DPO": {
     id: "snorkelai/Snorkel-Mistral-PairRM-DPO",
     organization: "Snorkel AI",
     name: "Snorkel Mistral PairRM DPO (7B)",
     maxLength: 32768,
   },
+  "Snowflake/snowflake-arctic-instruct": {
+    id: "Snowflake/snowflake-arctic-instruct",
+    organization: "Snowflake",
+    name: "Snowflake Arctic Instruct",
+    maxLength: 4096,
+  },
   "togethercomputer/alpaca-7b": {
     id: "togethercomputer/alpaca-7b",
     organization: "Stanford",
diff --git a/server/utils/AiProviders/togetherAi/scripts/chat_models.txt b/server/utils/AiProviders/togetherAi/scripts/chat_models.txt
index 499d23549..2c69d7573 100644
--- a/server/utils/AiProviders/togetherAi/scripts/chat_models.txt
+++ b/server/utils/AiProviders/togetherAi/scripts/chat_models.txt
@@ -1,7 +1,16 @@
 | Organization | Model Name | Model String for API | Context length |
-| --- | --- | --- | --- |
-| 01.AI | 01-ai Yi Chat (34B) | zero-one-ai/Yi-34B-Chat | 4096 |
+|--------------|------------|----------------------|----------------|
+| Meta | Llama 3.1 8B Instruct Turbo | meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo | 128000 |
+| Meta | Llama 3.1 70B Instruct Turbo | meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo | 128000 |
+| Meta | Llama 3.1 405B Instruct Turbo | meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo | 4096 |
+| Meta | Llama 3 8B Instruct Turbo | meta-llama/Meta-Llama-3-8B-Instruct-Turbo | 8192 |
+| Meta | Llama 3 70B Instruct Turbo | meta-llama/Meta-Llama-3-70B-Instruct-Turbo | 8192 |
+| Meta | Llama 3 8B Instruct Lite | meta-llama/Meta-Llama-3-8B-Instruct-Lite | 8192 |
+| Meta | Llama 3 70B Instruct Lite | meta-llama/Meta-Llama-3-70B-Instruct-Lite | 8192 |
+| Google | Gemma 2 27B | google/gemma-2-27b-it | 8192 |
+| Google | Gemma 2 9B | google/gemma-2-9b-it | 8192 |
 | Allen AI | OLMo Instruct (7B) | allenai/OLMo-7B-Instruct | 2048 |
+| 01.AI | 01-ai Yi Chat (34B) | zero-one-ai/Yi-34B-Chat | 4096 |
 | Allen AI | OLMo Twin-2T (7B) | allenai/OLMo-7B-Twin-2T | 2048 |
 | Allen AI | OLMo (7B) | allenai/OLMo-7B | 2048 |
 | Austism | Chronos Hermes (13B) | Austism/chronos-hermes-13b | 2048 |
@@ -22,11 +31,11 @@
 | Meta | LLaMA-2 Chat (70B) | meta-llama/Llama-2-70b-chat-hf | 4096 |
 | Meta | LLaMA-2 Chat (13B) | meta-llama/Llama-2-13b-chat-hf | 4096 |
 | Meta | LLaMA-2 Chat (7B) | meta-llama/Llama-2-7b-chat-hf | 4096 |
-| Meta | LLaMA-3 Chat (8B) | meta-llama/Llama-3-8b-chat-hf | 8000 |
-| Meta | LLaMA-3 Chat (70B) | meta-llama/Llama-3-70b-chat-hf | 8000 |
-| Microsoft | WizardLM-2 (8x22B) | microsoft/WizardLM-2-8x22B | 65536 |
+| Meta | LLaMA-3 Chat (8B) | meta-llama/Llama-3-8b-chat-hf | 8192 |
+| Meta | LLaMA-3 Chat (70B) | meta-llama/Llama-3-70b-chat-hf | 8192 |
 | mistralai | Mistral (7B) Instruct | mistralai/Mistral-7B-Instruct-v0.1 | 8192 |
 | mistralai | Mistral (7B) Instruct v0.2 | mistralai/Mistral-7B-Instruct-v0.2 | 32768 |
+| mistralai | Mistral (7B) Instruct v0.3 | mistralai/Mistral-7B-Instruct-v0.3 | 32768 |
 | mistralai | Mixtral-8x7B Instruct (46.7B) | mistralai/Mixtral-8x7B-Instruct-v0.1 | 32768 |
 | mistralai | Mixtral-8x22B Instruct (141B) | mistralai/Mixtral-8x22B-Instruct-v0.1 | 65536 |
 | NousResearch | Nous Capybara v1.9 (7B) | NousResearch/Nous-Capybara-7B-V1p9 | 8192 |
@@ -45,7 +54,10 @@
 | Qwen | Qwen 1.5 Chat (14B) | Qwen/Qwen1.5-14B-Chat | 32768 |
 | Qwen | Qwen 1.5 Chat (32B) | Qwen/Qwen1.5-32B-Chat | 32768 |
 | Qwen | Qwen 1.5 Chat (72B) | Qwen/Qwen1.5-72B-Chat | 32768 |
+| Qwen | Qwen 1.5 Chat (110B) | Qwen/Qwen1.5-110B-Chat | 32768 |
+| Qwen | Qwen 2 Instruct (72B) | Qwen/Qwen2-72B-Instruct | 32768 |
 | Snorkel AI | Snorkel Mistral PairRM DPO (7B) | snorkelai/Snorkel-Mistral-PairRM-DPO | 32768 |
+| Snowflake | Snowflake Arctic Instruct | Snowflake/snowflake-arctic-instruct | 4096 |
 | Stanford | Alpaca (7B) | togethercomputer/alpaca-7b | 2048 |
 | Teknium | OpenHermes-2-Mistral (7B) | teknium/OpenHermes-2-Mistral-7B | 8192 |
 | Teknium | OpenHermes-2.5-Mistral (7B) | teknium/OpenHermes-2p5-Mistral-7B | 8192 |
diff --git a/server/utils/AiProviders/togetherAi/scripts/parse.mjs b/server/utils/AiProviders/togetherAi/scripts/parse.mjs
index 7d5d6277c..69f14140f 100644
--- a/server/utils/AiProviders/togetherAi/scripts/parse.mjs
+++ b/server/utils/AiProviders/togetherAi/scripts/parse.mjs
@@ -8,7 +8,7 @@
 // copy outputs into the export in ../models.js
 
 // Update the date below if you run this again because TogetherAI added new models.
-// Last Collected: Apr 18, 2024
+// Last Collected: Jul 31, 2024
 // Since last collection Together's docs are broken. I just copied the HTML table
 // and had claude3 convert to markdown and it works well enough.