Skip to content

velocitylabo/tobira

Repository files navigation

tobira (扉)

ML-powered email spam detection toolkit with MTA integrations.

Add ML-based spam classification to your existing mail infrastructure — no ML expertise required, no MTA replacement needed, setup in 3 steps.

PyPI version npm version License: MIT Tests Python 3.9+

3 Steps to Get Started

pip install tobira[serving,fasttext]
tobira init        # Auto-detect your MTA, generate config
tobira serve       # Start API server — done

Your MTA plugin talks to the tobira API over HTTP. No changes to your mail flow.

MTA (Postfix, etc.)
  └── MTA Plugin (rspamd / SpamAssassin / Haraka / milter)
        └── HTTP POST /predict → tobira API Server

Why tobira

  • Works with your existing MTA — Plugins for rspamd, SpamAssassin, Haraka, and Postfix milter. No migration required.
  • No ML expertise neededtobira init detects your MTA and generates config. tobira doctor validates your setup.
  • 7 inference backends — From FastText (1ms, CPU) to BERT (highest accuracy) to LLM APIs (zero training data). Swap backends without changing your setup.
  • Production-ready — Fail-open mode, health checks, Docker Compose / Kubernetes deployment. 1,200+ tests.
All features
  • A/B testing — Compare models in production with random or hash-based traffic splitting
  • Active learning — Uncertainty-based sampling to prioritize labeling effort
  • Web dashboard — Real-time prediction stats, score distribution, and drift visualization
  • Knowledge distillation — Compress large teacher models into lightweight student models
  • AI-generated text detection — Heuristic-based detection of machine-generated content
  • HuggingFace Hub — Push and pull models with auto-generated model cards
  • GDPR-aware — PII anonymization with regex + NER (GiNZA) for training data
  • Monitoring — Score drift detection (PSI/KS test), automatic retraining triggers

Documentation

velocitylabo.github.io/tobira — Full documentation:

Packages

Package Registry Description
tobira PyPI Python toolkit (backends, API server, CLI)
tobira npm JavaScript client for Node.js / Haraka

Deployment

Method Path Description
Docker Compose docker/ Full test environment with all MTAs
Helm Chart charts/tobira/ Kubernetes deployment with HPA/Ingress
Plain K8s k8s/ Kubernetes manifests without Helm

License

MIT