patronus-studio/orca-sonar-document-classifier
Model Card for Orca Sonar Document Classifier
Multilingual Document Topic Classifier for Real-World AI Security & DLP
Read more
- Blog post (EN): Orca-Sonar: Our Multilingual Document Classifier for AI Security
- Blogbeitrag (DE): Orca-Sonar: unser mehrsprachiger Dokumenten-Klassifikator für AI-Security
- Blog post (EN): Our AI-Security Model Zoo Is Now Open Source
- Blogbeitrag (DE): Unser AI-Security-Model-Zoo ist jetzt Open Source
- Product page: Patronus AI models
Orca-Sonar is a Multilingual ModernBERT-based (mmBERT) classifier that assigns a document/text to one of 9 topic classes. It is part of the Patronus Protect security stack and is designed for topic-/risk-routing of incoming texts (e.g. before they reach an LLM, a DLP gate, or a storage tier).
It classifies German and English text and is robust to user-to-AI wrappers (e.g. "Summarize this contract: …"), i.e. the topic of the content determines the class, not the surface format of the request.
Intended Uses
The model maps an input text to one of:
Disambiguation: on a tie, the more sensitive class wins: legal > hr > finance > internal_and_tech > source_code > marketing > other.
Limitations
- Highly accurate on German and English; other languages were not actively tested.
- The model can produce false positives; for high-stakes routing combine it with a confidence/abstention gate.
- Robustness against adversarial / out-of-distribution / pure-PII / pathological-length inputs is partial; pair the model with a deterministic pre-gate (length + PII) for production DLP use.
Model Variants
- orca-sonar: full model (
model.safetensors, fp32). - orca-sonar-fp16 (ONNX): FP16 ONNX export under
onnx/onnx_fp16/, half the size, argmax-faithful to the full model.
Training Data
Trained on our own in-house dataset (German + English, 9 topic classes), purpose-built for this model. The dataset will be published soon.
Benchmark
Held-out test set (100 % real data), per-class F1:
Usage
from transformers import pipeline
clf = pipeline("text-classification", model="patronus-studio/orca-sonar-document-classifier")
clf("Fasse mir diesen Dienstleistungsvertrag zusammen: Laufzeit 24 Monate, Gerichtsstand München …")
# -> [{'label': 'legal', 'score': 0.99}]ONNX
An FP16 ONNX version is available under onnx/onnx_fp16/:
import torch
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer
model_id = "patronus-studio/orca-sonar-document-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = ORTModelForSequenceClassification.from_pretrained(model_id, subfolder="onnx/onnx_fp16")
inputs = tokenizer("def add(a, b):\n return a + b", return_tensors="pt")
logits = model(**inputs).logits
print(model.config.id2label[int(torch.argmax(logits, dim=-1))])Citation
@misc{orcasonar2026,
title={Orca-Sonar: Multilingual Document Topic Classification for Real-World AI Security},
author={Patronus Protect},
year={2026},
howpublished={\url{https://huggingface.co/patronus-studio/orca-sonar-document-classifier}}
}License
This model is released under the Apache License 2.0. A copy of the license is included as LICENSE in this repository.
The model is derived from jhu-clsp/mmBERT-small, which is distributed under the MIT License. The upstream copyright and permission notice are retained; the MIT terms continue to apply to the portions originating from that work.
Patronus Ark
This model is built to run inside [Patronus Ark](https://github.com/patronus-protect/patronus-security), Patronus' open-source on-device AI-security scanning library (L1 native rules → L2 NTDB cascade → L3 transformer). Ark is open source: GitHub repository · product page.
More information
- Blog post (EN): Orca-Sonar: Our Multilingual Document Classifier for AI Security
- Blogbeitrag (DE): Orca-Sonar: unser mehrsprachiger Dokumenten-Klassifikator für AI-Security
- Blog post (EN): Our AI-Security Model Zoo Is Now Open Source
- Blogbeitrag (DE): Unser AI-Security-Model-Zoo ist jetzt Open Source
- Product page: Patronus AI models
- Patronus Ark, the open-source scanning library this model runs in: GitHub · product page
- Patronus Protect, the on-device AI firewall: patronus.studio
🛡️ Patronus Protect
Brought to you by [Patronus Protect](https://patronus.studio), a local AI firewall that secures every AI interaction (prompts, tools, documents) before it reaches your models. Try it for free at [patronus.studio](https://patronus.studio).
