From 5aa79128f7d935bf42fdd133c523337f041d81b0 Mon Sep 17 00:00:00 2001
From: timothycarambat <rambat1010@gmail.com>
Date: Wed, 6 Nov 2024 08:14:08 -0800
Subject: [PATCH] bump Anthropic models

---
 .../components/LLMSelection/AnthropicAiOptions/index.jsx | 6 +++++-
 frontend/src/hooks/useGetProvidersModels.js              | 8 ++++++--
 server/utils/AiProviders/anthropic/index.js              | 8 ++++++--
 server/utils/AiProviders/modelMap.js                     | 9 ++++++++-
 server/utils/helpers/updateENV.js                        | 8 ++++++--
 5 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/frontend/src/components/LLMSelection/AnthropicAiOptions/index.jsx b/frontend/src/components/LLMSelection/AnthropicAiOptions/index.jsx
index 08b283813..d66d36673 100644
--- a/frontend/src/components/LLMSelection/AnthropicAiOptions/index.jsx
+++ b/frontend/src/components/LLMSelection/AnthropicAiOptions/index.jsx
@@ -34,8 +34,12 @@ export default function AnthropicAiOptions({ settings }) {
                 "claude-2.0",
                 "claude-2.1",
                 "claude-3-haiku-20240307",
-                "claude-3-opus-20240229",
                 "claude-3-sonnet-20240229",
+                "claude-3-opus-latest",
+                "claude-3-5-haiku-latest",
+                "claude-3-5-haiku-20241022",
+                "claude-3-5-sonnet-latest",
+                "claude-3-5-sonnet-20241022",
                 "claude-3-5-sonnet-20240620",
               ].map((model) => {
                 return (
diff --git a/frontend/src/hooks/useGetProvidersModels.js b/frontend/src/hooks/useGetProvidersModels.js
index 824587245..645189d52 100644
--- a/frontend/src/hooks/useGetProvidersModels.js
+++ b/frontend/src/hooks/useGetProvidersModels.js
@@ -25,9 +25,13 @@ const PROVIDER_DEFAULT_MODELS = {
     "claude-instant-1.2",
     "claude-2.0",
     "claude-2.1",
-    "claude-3-opus-20240229",
-    "claude-3-sonnet-20240229",
     "claude-3-haiku-20240307",
+    "claude-3-sonnet-20240229",
+    "claude-3-opus-latest",
+    "claude-3-5-haiku-latest",
+    "claude-3-5-haiku-20241022",
+    "claude-3-5-sonnet-latest",
+    "claude-3-5-sonnet-20241022",
     "claude-3-5-sonnet-20240620",
   ],
   azure: [],
diff --git a/server/utils/AiProviders/anthropic/index.js b/server/utils/AiProviders/anthropic/index.js
index 386e84a53..7b752da30 100644
--- a/server/utils/AiProviders/anthropic/index.js
+++ b/server/utils/AiProviders/anthropic/index.js
@@ -46,9 +46,13 @@ class AnthropicLLM {
       "claude-instant-1.2",
       "claude-2.0",
       "claude-2.1",
-      "claude-3-opus-20240229",
-      "claude-3-sonnet-20240229",
       "claude-3-haiku-20240307",
+      "claude-3-sonnet-20240229",
+      "claude-3-opus-latest",
+      "claude-3-5-haiku-latest",
+      "claude-3-5-haiku-20241022",
+      "claude-3-5-sonnet-latest",
+      "claude-3-5-sonnet-20241022",
       "claude-3-5-sonnet-20240620",
     ];
     return validModels.includes(modelName);
diff --git a/server/utils/AiProviders/modelMap.js b/server/utils/AiProviders/modelMap.js
index 390278f37..3d8c123bc 100644
--- a/server/utils/AiProviders/modelMap.js
+++ b/server/utils/AiProviders/modelMap.js
@@ -7,9 +7,16 @@ const MODEL_MAP = {
     "claude-instant-1.2": 100_000,
     "claude-2.0": 100_000,
     "claude-2.1": 200_000,
-    "claude-3-opus-20240229": 200_000,
+    "claude-3-haiku-20240307": 200_000,
     "claude-3-sonnet-20240229": 200_000,
+    "claude-3-opus-20240229": 200_000,
     "claude-3-haiku-20240307": 200_000,
+    "claude-3-sonnet-20240229": 200_000,
+    "claude-3-opus-latest": 200_000,
+    "claude-3-5-haiku-latest": 200_000,
+    "claude-3-5-haiku-20241022": 200_000,
+    "claude-3-5-sonnet-latest": 200_000,
+    "claude-3-5-sonnet-20241022": 200_000,
     "claude-3-5-sonnet-20240620": 200_000,
   },
   cohere: {
diff --git a/server/utils/helpers/updateENV.js b/server/utils/helpers/updateENV.js
index 676eb812f..07100fae5 100644
--- a/server/utils/helpers/updateENV.js
+++ b/server/utils/helpers/updateENV.js
@@ -724,9 +724,13 @@ function validAnthropicModel(input = "") {
     "claude-instant-1.2",
     "claude-2.0",
     "claude-2.1",
-    "claude-3-opus-20240229",
-    "claude-3-sonnet-20240229",
     "claude-3-haiku-20240307",
+    "claude-3-sonnet-20240229",
+    "claude-3-opus-latest",
+    "claude-3-5-haiku-latest",
+    "claude-3-5-haiku-20241022",
+    "claude-3-5-sonnet-latest",
+    "claude-3-5-sonnet-20241022",
     "claude-3-5-sonnet-20240620",
   ];
   return validModels.includes(input)
-- 
GitLab