From 29f95e5b61ce6e20bcdf30eabc4646e7b5584ce1 Mon Sep 17 00:00:00 2001 From: Bentlybro Date: Fri, 13 Feb 2026 15:29:49 +0000 Subject: [PATCH] fix(builder): lowercase query for LLM model matching The model slugs are lowercased in _get_llm_models() but the query wasn't, causing case-sensitive matching failures (e.g., 'GPT-4' wouldn't match 'gpt 4'). --- autogpt_platform/backend/backend/api/features/builder/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogpt_platform/backend/backend/api/features/builder/db.py b/autogpt_platform/backend/backend/api/features/builder/db.py index b4b612bb09..b862ce915f 100644 --- a/autogpt_platform/backend/backend/api/features/builder/db.py +++ b/autogpt_platform/backend/backend/api/features/builder/db.py @@ -509,8 +509,8 @@ async def _get_static_counts(): def _matches_llm_model(schema_cls: type[BlockSchema], query: str) -> bool: for field in schema_cls.model_fields.values(): if field.annotation == LlmModel: - # Normalize query same as model slugs (hyphens to spaces) for matching - normalized_model_query = query.replace("-", " ") + # Normalize query same as model slugs (lowercase, hyphens to spaces) + normalized_model_query = query.lower().replace("-", " ") # Check if query matches any value in llm_models from registry if any(normalized_model_query in name for name in _get_llm_models()): return True