feat(backend): Remove deprecated LLM models and add migration script (#11331)

These models have become deprecated
- deepseek-r1-distill-llama-70b
- gemma2-9b-it
- llama3-70b-8192
- llama3-8b-8192
- google/gemini-flash-1.5

I have removed them and setup a migration, the migration is to convert
all the old versions of the model to new versions, the model changes
will happen like so

- llama3-70b-8192 → llama-3.3-70b-versatile
- llama3-8b-8192 → llama-3.1-8b-instant
- google/gemini-flash-1.5 → google/gemini-2.5-flash
- deepseek-r1-distill-llama-70b → gpt-5-chat-latest
- gemma2-9b-it → gpt-5-chat-latest 

### Changes 🏗️

<!-- Concisely describe all of the changes made in this pull request:
-->

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
  - [x] Check to see if old models where removed
- [x] Check to see if migration worked and converted old models to new
one in graph
This commit is contained in:
Bently
2025-11-06 12:36:42 +00:00
committed by GitHub
parent a056d9e71a
commit dcecb17bd1
4 changed files with 53 additions and 34 deletions

View File

@@ -118,13 +118,8 @@ class LlmModel(str, Enum, metaclass=LlmModelMeta):
AIML_API_META_LLAMA_3_1_70B = "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo"
AIML_API_LLAMA_3_2_3B = "meta-llama/Llama-3.2-3B-Instruct-Turbo"
# Groq models
GEMMA2_9B = "gemma2-9b-it"
LLAMA3_3_70B = "llama-3.3-70b-versatile"
LLAMA3_1_8B = "llama-3.1-8b-instant"
LLAMA3_70B = "llama3-70b-8192"
LLAMA3_8B = "llama3-8b-8192"
# Groq preview models
DEEPSEEK_LLAMA_70B = "deepseek-r1-distill-llama-70b"
# Ollama models
OLLAMA_LLAMA3_3 = "llama3.3"
OLLAMA_LLAMA3_2 = "llama3.2"
@@ -134,7 +129,6 @@ class LlmModel(str, Enum, metaclass=LlmModelMeta):
# OpenRouter models
OPENAI_GPT_OSS_120B = "openai/gpt-oss-120b"
OPENAI_GPT_OSS_20B = "openai/gpt-oss-20b"
GEMINI_FLASH_1_5 = "google/gemini-flash-1.5"
GEMINI_2_5_PRO = "google/gemini-2.5-pro-preview-03-25"
GEMINI_2_5_FLASH = "google/gemini-2.5-flash"
GEMINI_2_0_FLASH = "google/gemini-2.0-flash-001"
@@ -238,12 +232,8 @@ MODEL_METADATA = {
LlmModel.AIML_API_META_LLAMA_3_1_70B: ModelMetadata("aiml_api", 131000, 2000),
LlmModel.AIML_API_LLAMA_3_2_3B: ModelMetadata("aiml_api", 128000, None),
# https://console.groq.com/docs/models
LlmModel.GEMMA2_9B: ModelMetadata("groq", 8192, None),
LlmModel.LLAMA3_3_70B: ModelMetadata("groq", 128000, 32768),
LlmModel.LLAMA3_1_8B: ModelMetadata("groq", 128000, 8192),
LlmModel.LLAMA3_70B: ModelMetadata("groq", 8192, None),
LlmModel.LLAMA3_8B: ModelMetadata("groq", 8192, None),
LlmModel.DEEPSEEK_LLAMA_70B: ModelMetadata("groq", 128000, None),
# https://ollama.com/library
LlmModel.OLLAMA_LLAMA3_3: ModelMetadata("ollama", 8192, None),
LlmModel.OLLAMA_LLAMA3_2: ModelMetadata("ollama", 8192, None),
@@ -251,7 +241,6 @@ MODEL_METADATA = {
LlmModel.OLLAMA_LLAMA3_405B: ModelMetadata("ollama", 8192, None),
LlmModel.OLLAMA_DOLPHIN: ModelMetadata("ollama", 32768, None),
# https://openrouter.ai/models
LlmModel.GEMINI_FLASH_1_5: ModelMetadata("open_router", 1000000, 8192),
LlmModel.GEMINI_2_5_PRO: ModelMetadata("open_router", 1050000, 8192),
LlmModel.GEMINI_2_5_FLASH: ModelMetadata("open_router", 1048576, 65535),
LlmModel.GEMINI_2_0_FLASH: ModelMetadata("open_router", 1048576, 8192),

View File

@@ -82,20 +82,15 @@ MODEL_COST: dict[LlmModel, int] = {
LlmModel.AIML_API_LLAMA3_3_70B: 1,
LlmModel.AIML_API_META_LLAMA_3_1_70B: 1,
LlmModel.AIML_API_LLAMA_3_2_3B: 1,
LlmModel.LLAMA3_8B: 1,
LlmModel.LLAMA3_70B: 1,
LlmModel.GEMMA2_9B: 1,
LlmModel.LLAMA3_3_70B: 1, # $0.59 / $0.79
LlmModel.LLAMA3_1_8B: 1,
LlmModel.OLLAMA_LLAMA3_3: 1,
LlmModel.OLLAMA_LLAMA3_2: 1,
LlmModel.OLLAMA_LLAMA3_8B: 1,
LlmModel.OLLAMA_LLAMA3_405B: 1,
LlmModel.DEEPSEEK_LLAMA_70B: 1, # ? / ?
LlmModel.OLLAMA_DOLPHIN: 1,
LlmModel.OPENAI_GPT_OSS_120B: 1,
LlmModel.OPENAI_GPT_OSS_20B: 1,
LlmModel.GEMINI_FLASH_1_5: 1,
LlmModel.GEMINI_2_5_PRO: 4,
LlmModel.MISTRAL_NEMO: 1,
LlmModel.COHERE_COMMAND_R_08_2024: 1,

View File

@@ -0,0 +1,53 @@
-- Migrate deprecated Groq and OpenRouter models to their replacements
-- This updates all AgentNode blocks that use deprecated models that have been decommissioned
-- Deprecated models:
-- - deepseek-r1-distill-llama-70b (Groq - decommissioned)
-- - gemma2-9b-it (Groq - decommissioned)
-- - llama3-70b-8192 (Groq - decommissioned)
-- - llama3-8b-8192 (Groq - decommissioned)
-- - google/gemini-flash-1.5 (OpenRouter - no endpoints found)
-- Update llama3-70b-8192 to llama-3.3-70b-versatile
UPDATE "AgentNode"
SET "constantInput" = JSONB_SET(
"constantInput"::jsonb,
'{model}',
'"llama-3.3-70b-versatile"'::jsonb
)
WHERE "constantInput"::jsonb->>'model' = 'llama3-70b-8192';
-- Update llama3-8b-8192 to llama-3.1-8b-instant
UPDATE "AgentNode"
SET "constantInput" = JSONB_SET(
"constantInput"::jsonb,
'{model}',
'"llama-3.1-8b-instant"'::jsonb
)
WHERE "constantInput"::jsonb->>'model' = 'llama3-8b-8192';
-- Update google/gemini-flash-1.5 to google/gemini-2.5-flash
UPDATE "AgentNode"
SET "constantInput" = JSONB_SET(
"constantInput"::jsonb,
'{model}',
'"google/gemini-2.5-flash"'::jsonb
)
WHERE "constantInput"::jsonb->>'model' = 'google/gemini-flash-1.5';
-- Update deepseek-r1-distill-llama-70b to gpt-5-chat-latest (no direct replacement)
UPDATE "AgentNode"
SET "constantInput" = JSONB_SET(
"constantInput"::jsonb,
'{model}',
'"gpt-5-chat-latest"'::jsonb
)
WHERE "constantInput"::jsonb->>'model' = 'deepseek-r1-distill-llama-70b';
-- Update gemma2-9b-it to gpt-5-chat-latest (no direct replacement)
UPDATE "AgentNode"
SET "constantInput" = JSONB_SET(
"constantInput"::jsonb,
'{model}',
'"gpt-5-chat-latest"'::jsonb
)
WHERE "constantInput"::jsonb->>'model' = 'gemma2-9b-it';

View File

@@ -22,8 +22,6 @@ from .schema import (
class GroqModelName(str, enum.Enum):
LLAMA3_8B = "llama3-8b-8192"
LLAMA3_70B = "llama3-70b-8192"
MIXTRAL_8X7B = "mixtral-8x7b-32768"
GEMMA_7B = "gemma-7b-it"
@@ -31,22 +29,6 @@ class GroqModelName(str, enum.Enum):
GROQ_CHAT_MODELS = {
info.name: info
for info in [
ChatModelInfo(
name=GroqModelName.LLAMA3_8B,
provider_name=ModelProviderName.GROQ,
prompt_token_cost=0.05 / 1e6,
completion_token_cost=0.10 / 1e6,
max_tokens=8192,
has_function_call_api=True,
),
ChatModelInfo(
name=GroqModelName.LLAMA3_70B,
provider_name=ModelProviderName.GROQ,
prompt_token_cost=0.59 / 1e6,
completion_token_cost=0.79 / 1e6,
max_tokens=8192,
has_function_call_api=True,
),
ChatModelInfo(
name=GroqModelName.MIXTRAL_8X7B,
provider_name=ModelProviderName.GROQ,