Your question
Is there a way to set thresholds for when the LLM classifier will run? For example, if the spam score is between -10 and 10?
The use case is that every other spam score flagged an email as possible spam and got the score up to 30, and there was absolutely nothing worthwhile for the LLM to provide as far as feedback for that one.
Likewise on the other end, if the score is pushed down low enough because the sender is a trusted sender, we don’t want to run the LLM classifier.
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on
The current SpamLlm configuration object does not expose a score-range threshold field. The Enable variant’s available fields are: modelId, prompt, temperature, separator, categories, confidence, responsePosCategory, responsePosConfidence, and responsePosExplanation. There is no minScore/maxScore or similar field to conditionally run the LLM only when the pre-LLM score falls within a given range.
In other words, when the LLM classifier is enabled, it runs on every message – there is currently no built-in way to skip it based on the existing spam score being above or below a threshold.
Your use case (skipping the LLM for messages already firmly identified as spam or clearly trusted senders) is documented implicitly in the caveats section of the LLM classifier docs, which acknowledges the performance/cost trade-off, but no gating mechanism is described.
You can review the full configuration reference here: LLM Classifier docs and SpamLlm object reference.
A community member or staff member may be able to follow up with whether this is planned or achievable via a workaround.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
That isn’t configurable today: once the LLM classifier is enabled it runs on every message that has a text body, and there’s no setting to gate it on a score window. The only levers are the prompt/temperature and the tag score weights, not whether it runs.
It’s a reasonable request though, skipping the LLM step when the score is already outside a configurable band (clearly ham or clearly spam) would save the call, feel free to add it to “Feature Ideas”.