Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(search-bar): Use `LANGFUSE_AWS_BEDROCK_SMALL_MODEL` for AI features (#14968)

Ben Bachem1aa6a0cf7cf2
diff --git a/.env.dev.example b/.env.dev.example
index c77b15ac32..1794734cd6 100644
--- a/.env.dev.example
+++ b/.env.dev.example
@@ -185,10 +185,8 @@ AWS_ACCESS_KEY_ID="A123456789"
AWS_SECRET_ACCESS_KEY="SAK123456789"
LANGFUSE_LLM_CONNECTION_BEDROCK_API_KEY="1234567890abcdef"
LANGFUSE_AWS_BEDROCK_REGION="eu-west-1"
-# Model for AI features (e.g. the search-bar AI filter generator). Cloud/prod uses
-# `eu.anthropic.claude-opus-4-8`. Set that here to match prod exactly. Weak/old
-# models (e.g. `eu.anthropic.claude-3-haiku-20240307-v1:0`) degrade refine quality
-# — they tend to ignore the existing filters and replace instead of narrowing.
+# Default model for AI features. Search-bar filter generation prefers the small
+# model below and falls back to this model when the small model is not configured.
LANGFUSE_AWS_BEDROCK_MODEL="eu.anthropic.claude-opus-4-8"
LANGFUSE_AWS_BEDROCK_SMALL_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0"
LANGFUSE_IN_APP_AGENT_AWS_PROFILE="playground"
diff --git a/web/src/features/search-bar/server/router.ts b/web/src/features/search-bar/server/router.ts
index 7734f87df1..0a236000e7 100644
--- a/web/src/features/search-bar/server/router.ts
+++ b/web/src/features/search-bar/server/router.ts
@@ -104,7 +104,11 @@ export const searchBarRouter = createTRPCRouter({
});
}
- if (!env.LANGFUSE_AWS_BEDROCK_MODEL) {
+ const model =
+ env.LANGFUSE_AWS_BEDROCK_SMALL_MODEL ??
+ env.LANGFUSE_AWS_BEDROCK_MODEL;
+
+ if (!model) {
throw new TRPCError({
code: "PRECONDITION_FAILED",
message:
@@ -144,6 +148,7 @@ export const searchBarRouter = createTRPCRouter({
type: ChatMessageType.PublicAPICreated,
},
],
+ model,
maxTokens: 2048,
traceSinkParams: aiTelemetryEnabled
? getLangfuseAITraceSinkParams({