Skip to content

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

fix(ai-features): drop temperature/top_p for Bedrock NL filter (Opus 4.8 rejects them) (#14488)

Nikita Kabardin48cac449054d
diff --git a/web/src/features/natural-language-filters/server/utils.ts b/web/src/features/natural-language-filters/server/utils.ts
index 4db9ada99f..21dbb987b2 100644
--- a/web/src/features/natural-language-filters/server/utils.ts
+++ b/web/src/features/natural-language-filters/server/utils.ts
@@ -7,13 +7,19 @@ import { z } from "zod";
let langfuseClient: Langfuse | null = null;
export function getDefaultModelParams() {
+ // Intentionally omit `temperature` and `top_p`: newer Bedrock models such as
+ // Claude Opus 4.8 reject these inference params with a ValidationException
+ // ("'temperature' is deprecated for this model"), which surfaces as a 500 on
+ // `naturalLanguageFilters.createCompletion`. Omitting them is robust across
+ // models (older models simply fall back to their defaults), and NL filter
+ // generation works fine at model defaults. We only cap output length.
+ // Note: the param keys are `max_tokens`/`top_p` (snake_case) per ModelParams;
+ // the previous camelCase `maxTokens`/`topP` were silently dropped.
return {
provider: "bedrock",
adapter: LLMAdapter.Bedrock,
model: env.LANGFUSE_AWS_BEDROCK_MODEL ?? "",
- temperature: 0.1,
- maxTokens: 1000,
- topP: 0.9,
+ max_tokens: 1000,
};
}