A lightweight 7.4M parameter transformer for real-time content safety classification - detecting harmful prompts, toxic language, and unsafe content.
- Compact & Fast: 7.4M parameters
- Advanced Architecture: CosmicFish [GQA, RoPE, SwiGLU, RMSNorm]
- Multi-category Detection: Harmful instructions, toxicity, violence, manipulation
- Mobile Ready: CoreML export for iOS/macOS
- Production Ready: FP16 quantization for ~50% size reduction
| Component | Value |
|---|---|
| Layers | 4 transformer blocks |
| Attention Heads | 4 (2 query groups) |
| Embedding Dim | 128 |
| Context Length | 256 tokens |
| Parameters | 7.4M |
- Accuracy: 76.3% overall, 95% on baseline cases
- F1 Score: 0.77
- ROC AUC: 0.82
- FPR/FNR: 26.3% / 21.3%
git clone https://github.com/MistyozAI/EvoMind.git
cd EvoMind
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# 1. Prepare dataset
python prepare.py --output_dir data/safety
# 2. Train model
python train.py --data_path data/safety/safety_dataset.jsonl
# 3. Validate
python validation.py --model_path out_safety/safety_best.pt
# 4. Quantize for production
python quantize.py --input_path out_safety/safety_best.pt
# 5. Export to CoreML (optional)
python coreml.py- Python 3.8+
- PyTorch 2.0+
- See
requirements.txt
Apache-2.0 - See LICENSE
Made with ❤️ by Mistyoz AI
