CLI Reference¶
The tobira command provides subcommands for server management, diagnostics, evaluation, and monitoring.
Installation¶
Getting Started¶
tobira init¶
Auto-detect your MTA and generate integration configuration files.
The setup wizard:
- Detects running MTAs (rspamd, SpamAssassin, Haraka, Postfix)
- Generates MTA-specific plugin configuration
- Provides step-by-step installation instructions
tobira serve¶
Start the FastAPI API server.
| Option | Default | Description |
|---|---|---|
--config |
— | Path to TOML configuration file |
--host |
127.0.0.1 |
Server bind address |
--port |
8000 |
Server bind port |
--backend |
— | Backend type (overrides config) |
--model-path |
— | Model file path (overrides config) |
tobira doctor¶
Run diagnostic checks on your tobira installation.
Checks performed:
- Configuration file validity
- Backend model loading
- API server connectivity
- MTA plugin activation status
tobira demo¶
Launch a full demonstration environment using Docker Compose.
Starts the API server, MTA plugins, and monitoring stack for interactive evaluation. Useful for trying tobira without configuring your production MTA.
Training & Evaluation¶
tobira train¶
Fine-tune a BERT/DeBERTa model on labeled email data.
| Option | Description |
|---|---|
--config |
Configuration file path |
--data |
Labeled data file (CSV or JSONL) |
--output |
Output directory for trained model |
Supports automatic train/val/test split, ONNX export, and training metrics persistence.
tobira evaluate¶
Evaluate a backend against labeled test data.
| Option | Description |
|---|---|
--data |
Path to labeled data file (JSONL) |
--backend |
Backend type to evaluate |
--config |
Configuration file path |
Outputs: accuracy, precision, recall, F1 score, confusion matrix, and PR curve.
tobira monitor¶
Analyze prediction metrics and suggest improvements.
| Option | Default | Description |
|---|---|---|
--config |
— | Configuration file path |
--watch |
— | Enable daemon mode (continuous monitoring) |
--interval |
3600 |
Check interval in seconds (daemon mode) |
Analysis includes:
- Score distribution shift detection (PSI / KS test)
- FP/FN rate trends
- Threshold tuning suggestions
- Backend upgrade recommendations
Advanced¶
tobira distill¶
Run knowledge distillation from a teacher model to a student model.
| Option | Description |
|---|---|
--teacher |
Teacher model path or name |
--student |
Student model path or name |
--data |
Training data path |
tobira ab-test¶
Run A/B testing between model variants in production.
Supports random and hash-based traffic splitting with variant analytics.
tobira active-learning¶
Manage the active learning queue for uncertainty-based sample selection.
| Option | Default | Description |
|---|---|---|
--config |
— | Configuration file path |
--strategy |
entropy |
Sampling strategy (entropy, bald, margin) |
tobira hub-push / tobira hub-pull¶
Manage models on HuggingFace Hub.
# Push a model to HuggingFace Hub
tobira hub-push --model-path MODEL --repo REPO
# Pull a model from HuggingFace Hub
tobira hub-pull --repo REPO --output-dir DIR
tobira milter¶
Start the Postfix milter daemon.
See Postfix milter integration for configuration details.