# Testing AI/LLM classifier functionality

**URL:** https://support.stalw.art/t/testing-ai-llm-classifier-functionality/919
**Category:** Questions
**Created:** [July 2, 2026, 7:17pm UTC](https://support.stalw.art/t/testing-ai-llm-classifier-functionality/919 "2026-07-02T19:17:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hvjunk](https://support.stalw.art/user_avatar/support.stalw.art/hvjunk/32/259_2.png) [@hvjunk](https://support.stalw.art/u/hvjunk)
#### Post date: [July 2, 2026, 7:17pm UTC](https://support.stalw.art/t/testing-ai-llm-classifier-functionality/919/1 "2026-07-02T19:17:05Z")

</div>

### Your question

I’ve setup a local Ollama instance with QWEN 2.5, 7B

How can I test the effectivenes/functionality from a stalwart server without breaking all active users?

---

<div class="post-metadata">

### Author: ![helpbot](https://support.stalw.art/user_avatar/support.stalw.art/helpbot/32/13_2.png) [@helpbot](https://support.stalw.art/u/helpbot)
#### Post date: [July 2, 2026, 7:17pm UTC](https://support.stalw.art/t/testing-ai-llm-classifier-functionality/919/2 "2026-07-02T19:17:40Z")

</div>

Found it — there’s a `ClassifySpam` management action that lets you submit a raw message directly to the spam filter and see the resulting score/tags, without it ever touching real mail flow or affecting active users.

Now let’s check tasks-actions/actions.md for how to actually invoke this via WebUI or CLI.

I found the safe testing mechanism: Stalwart’s `ClassifySpam` action lets you submit a raw message through the whole spam filter (including the LLM classifier) and see the resulting score/tags without it ever touching live mail flow or user mailboxes.

**How to test:**

1. Configure your Ollama model as an [AiModel](https://support.stalw.art/docs/ref/object/ai-model) and enable it in [SpamLlm](https://support.stalw.art/docs/ref/object/spam-llm) (`{"@type": "Enable", "modelId": "chat"}`, pointing at your local QWEN endpoint).
2. Rather than sending live mail, create a `ClassifySpam` **Action** via the WebUI (Management → Actions) or CLI (`stalwart-cli create action/ClassifySpam`), supplying:
  - `message`: a raw sample email (EML text) you want to test
  - envelope fields: `remoteIp`, `ehloDomain`, `envFrom`, `envRcptTo`, etc.

3. Stalwart runs the message through the full spam filter pipeline, including the LLM classifier, and returns the `score`, contributing `tags` (e.g. `LLM_UNSOLICITED_HIGH`), and final `result` (spam/ham/reject/discard) — all without delivering anything or affecting real users.

You can retrieve results afterward with `x:Action/get` or `stalwart-cli get action <id>`. This lets you iterate on your prompt/model tuning purely against sample messages before enabling the LLM classifier for live traffic. Also check the `X-Spam-LLM` header format described in the LLM classifier docs to see exactly what your model returned.

Be aware of the performance caveat: CPU-only local models like a 7B Qwen via Ollama can add noticeable latency per message if you later enable this in production, so test throughput as well as accuracy.

Docs used: [LLM classifier](https://support.stalw.art/docs/spamfilter/llm) and [Actions](https://support.stalw.art/docs/management/tasks-actions/actions).

_This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong._
