Laya inference server that classifies mail for MIMEDefang (Mail::MIMEDefang::ML, laya backend)
64
mimedefang-laya-server keeps the Laya
decision model loaded in memory and answers classification requests from
MIMEDefang's
Mail::MIMEDefang::ML module (laya backend). Laya routes each message to its
English or multilingual checkpoint and answers in a single forward pass, fast
enough to check every message.
latest, vX.Y: built from a MIMEDefang release tag, once one existsdocker run -d --name laya -p 127.0.0.1:8687:8687 \
-v mdml-hf:/var/lib/MIMEDefang/ml/huggingface \
mimedefang/laya:latest
On the first start the checkpoints are downloaded from Hugging Face into the
volume, so the server can take a few minutes to start listening. Check it with
curl http://127.0.0.1:8687/health.
use Mail::MIMEDefang::ML;
$Mail::MIMEDefang::ML::Config{backend} = 'laya';
$Mail::MIMEDefang::ML::Config{laya}{server_url} = 'http://127.0.0.1:8687';
| Variable | Default | Meaning |
|---|---|---|
LAYA_PORT | 8687 | Listening port |
LAYA_THREADS | 8 | Requests handled at once (about the multiplexor's maximum number of workers) |
LAYA_TORCH_THREADS | 2 | CPU threads per request (keep it at 1-2) |
LAYA_MIN_CONFIDENCE | 0.55 | Logging threshold (match $Mail::MIMEDefang::ML::Config{min_confidence}) |
HF_HUB_OFFLINE | unset | 1 stops contacting huggingface.co once the models are cached |
Extra server options go after the image name, e.g. --preload english,multilingual.
Needs about 1-2 GB of RAM per loaded checkpoint. The image uses the CPU build of torch.
The server has no authentication, and every request carries message
content. Publish the port on 127.0.0.1, or firewall it so that only your
MIMEDefang hosts can reach it. Never expose it to the Internet.
Source: https://github.com/The-McGrail-Foundation/MIMEDefang-Docker
Content type
Image
Digest
sha256:a18ce81ab…
Size
346 MB
Last updated
4 days ago
docker pull mimedefang/laya