AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(backend): Remove deprecated LLM models and add migration script (#11331)
Bentlydcecb17bd1b5
diff --git a/autogpt_platform/backend/backend/blocks/llm.py b/autogpt_platform/backend/backend/blocks/llm.pyindex 74f53d4bf1..30b9db770b 100644--- a/autogpt_platform/backend/backend/blocks/llm.py+++ b/autogpt_platform/backend/backend/blocks/llm.py@@ -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 modelsOLLAMA_LLAMA3_3 = "llama3.3"OLLAMA_LLAMA3_2 = "llama3.2"@@ -134,7 +129,6 @@ class LlmModel(str, Enum, metaclass=LlmModelMeta):# OpenRouter modelsOPENAI_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/libraryLlmModel.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),diff --git a/autogpt_platform/backend/backend/data/block_cost_config.py b/autogpt_platform/backend/backend/data/block_cost_config.pyindex d415673c84..6a54dfcc4d 100644--- a/autogpt_platform/backend/backend/data/block_cost_config.py+++ b/autogpt_platform/backend/backend/data/block_cost_config.py@@ -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.79LlmModel.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,diff --git a/autogpt_platform/backend/migrations/20251106091413_migrate_deprecated_groq_openrouter_models/migration.sql b/autogpt_platform/backend/migrations/20251106091413_migrate_deprecated_groq_openrouter_models/migration.sqlnew file mode 100644index 0000000000..c750301ae0--- /dev/null+++ b/autogpt_platform/backend/migrations/20251106091413_migrate_deprecated_groq_openrouter_models/migration.sql@@ -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';diff --git a/classic/forge/forge/llm/providers/groq.py b/classic/forge/forge/llm/providers/groq.pyindex dc9e77e0b8..3b1dcacfd9 100644--- a/classic/forge/forge/llm/providers/groq.py+++ b/classic/forge/forge/llm/providers/groq.py@@ -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: infofor 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,