From 35943ff73eeb95316aaae9c8abc51311cbcfc88f Mon Sep 17 00:00:00 2001 From: Tim-Hoekstra <135951177+Tim-Hoekstra@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:44:53 +1000 Subject: [PATCH 1/2] Added Supported Models Free Tier - chat_models.txt Need to fill in correct Parameter Count. --- server/utils/AiProviders/perplexity/scripts/chat_models.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/utils/AiProviders/perplexity/scripts/chat_models.txt b/server/utils/AiProviders/perplexity/scripts/chat_models.txt index 2a620525b92..8afb178b6a0 100644 --- a/server/utils/AiProviders/perplexity/scripts/chat_models.txt +++ b/server/utils/AiProviders/perplexity/scripts/chat_models.txt @@ -9,4 +9,8 @@ | `codellama-70b-instruct` | 70B | 16384 | Chat Completion | | `mistral-7b-instruct` [1] | 7B | 16384 | Chat Completion | | `mixtral-8x7b-instruct` | 8x7B | 16384 | Chat Completion | -| `mixtral-8x22b-instruct` | 8x22B | 16384 | Chat Completion | \ No newline at end of file +| `mixtral-8x22b-instruct` | 8x22B | 16384 | Chat Completion | +| `llama-3-sonar-small-32k-chat` | B | 32000 | Chat Completion | +| `llama-3-sonar-small-32k-online` | B | 32000 | Chat Completion | +| `llama-3-sonar-large-32k-chat` | B | 32000 | Chat Completion | +| `llama-3-sonar-large-32k-online` | B | 32000 | Chat Completion | From 34d8741a1f6eb362a62d7f976f983f6e3e4dd60c Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Fri, 19 Jul 2024 15:08:49 -0700 Subject: [PATCH 2/2] Bump perplexity model closes #1901 closes #1900 --- .../Sidebar/ActiveWorkspaces/index.jsx | 4 +- .../Features/LiveSync/toggle.jsx | 5 +- server/utils/AiProviders/perplexity/models.js | 53 +++++++------------ .../perplexity/scripts/chat_models.txt | 25 ++++----- .../AiProviders/perplexity/scripts/parse.mjs | 4 +- 5 files changed, 34 insertions(+), 57 deletions(-) diff --git a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx index a3c50cbab91..da052b6434e 100644 --- a/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx +++ b/frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx @@ -168,8 +168,8 @@ export default function ActiveWorkspaces() { isInWorkspaceSettings && workspace.slug === slug ? "#46C8FF" : gearHover[workspace.id] - ? "#FFFFFF" - : "#A7A8A9" + ? "#FFFFFF" + : "#A7A8A9" } weight="bold" className="h-[20px] w-[20px]" diff --git a/frontend/src/pages/Admin/ExperimentalFeatures/Features/LiveSync/toggle.jsx b/frontend/src/pages/Admin/ExperimentalFeatures/Features/LiveSync/toggle.jsx index 69a758d515b..b8f30ad9e9b 100644 --- a/frontend/src/pages/Admin/ExperimentalFeatures/Features/LiveSync/toggle.jsx +++ b/frontend/src/pages/Admin/ExperimentalFeatures/Features/LiveSync/toggle.jsx @@ -9,9 +9,8 @@ export default function LiveSyncToggle({ enabled = false, onToggle }) { const [status, setStatus] = useState(enabled); async function toggleFeatureFlag() { - const updated = await System.experimentalFeatures.liveSync.toggleFeature( - !status - ); + const updated = + await System.experimentalFeatures.liveSync.toggleFeature(!status); if (!updated) { showToast("Failed to update status of feature.", "error", { clear: true, diff --git a/server/utils/AiProviders/perplexity/models.js b/server/utils/AiProviders/perplexity/models.js index 1990c4e70e9..e35068d4c1a 100644 --- a/server/utils/AiProviders/perplexity/models.js +++ b/server/utils/AiProviders/perplexity/models.js @@ -1,23 +1,23 @@ const MODELS = { - "sonar-small-chat": { - id: "sonar-small-chat", - name: "sonar-small-chat", - maxLength: 16384, - }, - "sonar-small-online": { - id: "sonar-small-online", - name: "sonar-small-online", - maxLength: 12000, - }, - "sonar-medium-chat": { - id: "sonar-medium-chat", - name: "sonar-medium-chat", - maxLength: 16384, - }, - "sonar-medium-online": { - id: "sonar-medium-online", - name: "sonar-medium-online", - maxLength: 12000, + "llama-3-sonar-small-32k-online\\*": { + id: "llama-3-sonar-small-32k-online\\*", + name: "llama-3-sonar-small-32k-online\\*", + maxLength: 28000, + }, + "llama-3-sonar-small-32k-chat": { + id: "llama-3-sonar-small-32k-chat", + name: "llama-3-sonar-small-32k-chat", + maxLength: 32768, + }, + "llama-3-sonar-large-32k-online\\*": { + id: "llama-3-sonar-large-32k-online\\*", + name: "llama-3-sonar-large-32k-online\\*", + maxLength: 28000, + }, + "llama-3-sonar-large-32k-chat": { + id: "llama-3-sonar-large-32k-chat", + name: "llama-3-sonar-large-32k-chat", + maxLength: 32768, }, "llama-3-8b-instruct": { id: "llama-3-8b-instruct", @@ -29,26 +29,11 @@ const MODELS = { name: "llama-3-70b-instruct", maxLength: 8192, }, - "codellama-70b-instruct": { - id: "codellama-70b-instruct", - name: "codellama-70b-instruct", - maxLength: 16384, - }, - "mistral-7b-instruct": { - id: "mistral-7b-instruct", - name: "mistral-7b-instruct", - maxLength: 16384, - }, "mixtral-8x7b-instruct": { id: "mixtral-8x7b-instruct", name: "mixtral-8x7b-instruct", maxLength: 16384, }, - "mixtral-8x22b-instruct": { - id: "mixtral-8x22b-instruct", - name: "mixtral-8x22b-instruct", - maxLength: 16384, - }, }; 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 8afb178b6a0..e02af255135 100644 --- a/server/utils/AiProviders/perplexity/scripts/chat_models.txt +++ b/server/utils/AiProviders/perplexity/scripts/chat_models.txt @@ -1,16 +1,9 @@ -| Model | Parameter Count | Context Length | Model Type | -| :-------------------- | :-------------- | :------------- | :-------------- | -| `sonar-small-chat` | 7B | 16384 | Chat Completion | -| `sonar-small-online` | 7B | 12000 | Chat Completion | -| `sonar-medium-chat` | 8x7B | 16384 | Chat Completion | -| `sonar-medium-online` | 8x7B | 12000 | Chat Completion | -| `llama-3-8b-instruct` | 8B | 8192 | Chat Completion | -| `llama-3-70b-instruct` | 70B | 8192 | Chat Completion | -| `codellama-70b-instruct` | 70B | 16384 | Chat Completion | -| `mistral-7b-instruct` [1] | 7B | 16384 | Chat Completion | -| `mixtral-8x7b-instruct` | 8x7B | 16384 | Chat Completion | -| `mixtral-8x22b-instruct` | 8x22B | 16384 | Chat Completion | -| `llama-3-sonar-small-32k-chat` | B | 32000 | Chat Completion | -| `llama-3-sonar-small-32k-online` | B | 32000 | Chat Completion | -| `llama-3-sonar-large-32k-chat` | B | 32000 | Chat Completion | -| `llama-3-sonar-large-32k-online` | B | 32000 | 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-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 diff --git a/server/utils/AiProviders/perplexity/scripts/parse.mjs b/server/utils/AiProviders/perplexity/scripts/parse.mjs index fcbbaf73138..6dec22d96b1 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: Apr 25, 2024 +// Last Collected: Jul 19, 2024 import fs from "fs"; @@ -23,7 +23,7 @@ function parseChatModels() { .slice(1, -1) .map((text) => text.trim()); model = model.replace(/`|\s*\[\d+\]\s*/g, ""); - const maxLength = Number(contextLength.replace(/\s*\[\d+\]\s*/g, "")); + const maxLength = Number(contextLength.replace(/[^\d]/g, "")); if (model && maxLength) { models[model] = { id: model,