Sign inSign up

mimedefang/laya

By mimedefang

•Updated 4 days ago

Laya inference server that classifies mail for MIMEDefang (Mail::MIMEDefang::ML, laya backend)

Image
0

64

mimedefang/laya repository overview

⁠mimedefang/laya

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.

⁠Tags

  • latest, vX.Y: built from a MIMEDefang release tag, once one exists

⁠Run

docker 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.

⁠Configure MIMEDefang

use Mail::MIMEDefang::ML;
$Mail::MIMEDefang::ML::Config{backend}          = 'laya';
$Mail::MIMEDefang::ML::Config{laya}{server_url} = 'http://127.0.0.1:8687';

⁠Environment

VariableDefaultMeaning
LAYA_PORT8687Listening port
LAYA_THREADS8Requests handled at once (about the multiplexor's maximum number of workers)
LAYA_TORCH_THREADS2CPU threads per request (keep it at 1-2)
LAYA_MIN_CONFIDENCE0.55Logging threshold (match $Mail::MIMEDefang::ML::Config{min_confidence})
HF_HUB_OFFLINEunset1 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.

⁠Security

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⁠

Tag summary

Content type

Image

Digest

sha256:a18ce81ab…

Size

346 MB

Last updated

4 days ago

docker pull mimedefang/laya