SAVRN
Search Contact SAVRN

Open-weight model · Text classification

mailroom-modernbert-classifier

by Lucius Morningstar Lucius-Morningstar/mailroom-modernbert-classifier

mailroom-modernbert-classifier is an open-weight model for text classification from Lucius Morningstar, released under Apache License 2.0. It has 149M parameters and a 8,192-token context. At 16-bit it needs about 0.4 GB of GPU memory, which fits on 1x MI300X from $1.85 an hour, at the lowest prices in the SAVRN Index. It draws 1 downloads a month.

Hierarchical document classifier for the LLM-Mailroom intake pipeline: a fine-tuned ModernBERT-base encoder with a doctype head plus one subclass head per document class.

Parameters149M
Context8,192
Weights312.4 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads1

Runs On

What it takes to serve mailroom-modernbert-classifier (149M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.3 GB 0.4 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Oct 1, 2026.

mailroom-modernbert-classifier on every accelerator the SAVRN Index prices, at every precision

Model Card

By Lucius Morningstar, published under apache-2.0, revision 633821eb76a4.

Hierarchical document classifier for the LLM-Mailroom intake pipeline: a fine-tuned ModernBERT-base encoder with a doctype head plus one subclass head per document class. It is the deterministic pre-check in the BERT-coupled intake overhaul (mailroom-issues #85). 8,192-token context, bf16. heads (contract, corporaterecord, correspondence, insuranceclaim, mergeragreement). MLP heads with dropout 0.1. by plurality vote over windows; subclass by plurality over windows whose doctype vote is the winning class. doctype (6): contract, mergeragreement, corporaterecord, correspondence, insuranceclaim, unknown (inference-only abstention — not a trained class) development, distributor, endorsement…

Read Lucius Morningstar's full model card

Hierarchical document classifier for the LLM-Mailroom intake pipeline: a fine-tuned ModernBERT-base encoder with a doc_type head plus one subclass head per document class. It is the deterministic pre-check in the BERT-coupled intake overhaul (mailroom-issues #85).

Architecture

  • Backbone: answerdotai/ModernBERT-base — 22 layers, 768 hidden, 8,192-token context, bf16.
  • Heads: one head per class — doc_type (6 classes) plus 5 subclass heads (contract, corporate_record, correspondence, insurance_claim, merger_agreement). MLP heads with dropout 0.1.
  • Windowing: token-level, 8,192 tokens with 512-token overlap. doc_type by plurality vote over windows; subclass by plurality over windows whose doc_type vote is the winning class.
  • Calibration: per-head temperature scaling (temperatures.json).

Files

file purpose
model.safetensors ModernBERT backbone weights (bf16, ~298 MB)
heads.pt hierarchical head state dicts
labels.json head vocabularies (labels / label2id / id2label / weights)
temperatures.json per-head calibration temperatures
train_counts.json per-(doc_type, subclass) authentic train-row counts (support gate)
config.json, tokenizer.json, tokenizer_config.json backbone config + tokenizer
summary.json full run summary (hyperparameters, per-epoch metrics, selection, test metrics)

Labels

doc_type (6): contract, merger_agreement, corporate_record, correspondence, insurance_claim, unknown (inference-only abstention — not a trained class)

contract (24): agency, co_branding, collaboration, consulting, development, distributor, endorsement, franchise, hosting, ip, joint_venture, license, maintenance, manufacturing, marketing, other, outsourcing, promotion, reseller, service, sponsorship, strategic_alliance, supply, transportation

corporate_record (10): articles_of_incorporation, board_resolution, bylaws, charter_amendment, indenture, officer_certificate, other, powers_of_attorney, rights_instrument, subsidiary_list

correspondence (7): demand, email, letter, meeting_request, memo, notice, press_release

insurance_claim (6): auto, carrier, inpatient, outpatient, pde, property

merger_agreement (5): all_cash, all_stock, mixed_cash_stock, mixed_cash_stock_election, other

Results

Trained 2 epochs on Lucius-Morningstar/mailroom-modernbert-training @ 5b72a345cd3c057b736bea4910fdbef6509ad1c3 — 4,497 train / 489 validation windows; 323 held-out test documents (never used for training, calibration, or threshold tuning).

Validation

epoch val_loss doc_acc macro-F1 (observed) ECE (calibrated)
1 1.0041 0.8859 0.8524 0.0201
2 0.9121 0.9195 0.9051 0.0205

Selected epoch: 2 — best observed doc_type macro-F1 subject to calibrated ECE ≤ 0.05 (gate_met: true).

Held-out test (323 docs)

metric value
doc_type accuracy 0.9319 (301/323)
subclass accuracy (given correct doc_type) 0.5449 (164/301)

Per-head (epoch 2, validation)

head window acc macro-F1 (observed) ECE (calibrated)
doc_type 0.9141 0.9051 0.0205
insurance_claim 0.8889 0.8085 0.0500
corporate_record 0.5405 0.2218 0.1037
merger_agreement 0.4656 0.1988 0.0350
correspondence 0.5161 0.0980 0.1050
contract 0.1630 0.0899 0.0630

Usage

The backbone is a standard ModernBertModel; the hierarchical heads are a custom bundle. Load it with the mailroom-ml inference layer:

from mailroom_ml.inference import load_bundle, classify_document

bundle = load_bundle("Lucius-Morningstar/mailroom-modernbert-classifier")
result = classify_document(
    title="Notice of Default",
    text=document_text,
    bundle=bundle,
)
# result["doc_type"], result["subclass"], result["confidence"], result["route"]

route == "fast_path" means the calibrated gate passed and the LLM sorter may be skipped (skip mode + allowlist only); otherwise route the document to the LLM sorter with the BERT triage as an advisory prior.

Provenance

  • Training run: 20260920-173810 — 2 epochs, ~3.78 h on a Modal L4.
  • Hyperparameters: batch 4, grad-accum 8, lr 2e-5, seed 42, λ_dt 0.65, label smoothing 0.05, sqrt-inverse class weights (cap 10), MLP heads (dropout 0.1), weight decay 0.01, subclass support floor 12.
  • Dataset revision: 5b72a345cd3c057b736bea4910fdbef6509ad1c3.
  • Calibration temperatures: doc_type 0.484, contract 0.705, corporate_record 0.596, correspondence 0.960, insurance_claim 0.122, merger_agreement 0.679.

Limitations

  • Subclass heads are weak for contract / correspondence / corporate_record / merger_agreement (macro-F1 0.09–0.22). Use the doc_type head for routing; route subclass-ambiguous documents to the LLM sorter (the Tier-1 prior-scoped lane, mailroom-issues #108). Do not trust a skip-mode subclass for these classes yet.
  • Trained on a curated legal-document corpus; not a substitute for legal review.
  • unknown is an inference-only abstention label, not a trained class.
  • Long documents are windowed (8,192 tokens, 512 overlap); the model never truncates silently — oversize documents fall back to the LLM path.

License

Apache-2.0 (inherits answerdotai/ModernBERT-base).

Configuration

Architecture
ModernBertModel
Context length (tokens)
8,192
Layers
22
Hidden size
768
Feed-forward size
1,152
Attention heads
12
Vocabulary size
50,368
Model type
modernbert

Identity and Version

Repository
Lucius-Morningstar/mailroom-modernbert-classifier
Publisher
Lucius Morningstar
Task
Text classification
Modality
Text
Library
transformers
Parameters
149M parameters
Languages
en
Revision
633821eb76a4dc26a514a8edbc81fed49c17493e
First published
2026-09-20
Last updated
2026-09-21

Files and Weights

12 files, 316.0 MB in total. The weights are 2 files totalling 312.4 MB in pt, safetensors.

Weights2 files · 312.4 MB
Configuration5 files · 15.7 KB
Tokenizer2 files · 3.6 MB
Documentation2 files · 17.2 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
heads.ptWeights14.4 MB 5848013ff43f
model.safetensorsWeights298.0 MB adcd0feb5210
config.jsonConfiguration1.9 KB —
labels.jsonConfiguration7.6 KB —
summary.jsonConfiguration4.8 KB —
temperatures.jsonConfiguration156 B —
train_counts.jsonConfiguration1.3 KB —
LICENSEDocumentation11.4 KB —
README.mdDocumentation5.9 KB —
.gitattributesRepository1.5 KB —
tokenizer.jsonTokenizer3.6 MB —
tokenizer_config.jsonTokenizer380 B —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
312.4 MB
Download from Lucius Morningstar

Released by Lucius Morningstar through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published312.4 MB
16-bit0.3 GB
8-bit0.1 GB
4-bit0.1 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About mailroom-modernbert-classifier

How much GPU memory does mailroom-modernbert-classifier need?

About 0.4 GB at 16-bit and 0.1 GB at 4-bit: the weights (149M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run mailroom-modernbert-classifier on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use mailroom-modernbert-classifier commercially?

Yes. mailroom-modernbert-classifier is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is mailroom-modernbert-classifier's context length?

8,192 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Text classification

Firebird-ModernBERT-512-RW

Noumenon, Inc.

Firebird-ModernBERT-512-RW is an experimental post-trained variant of It is a ~149M parameter ModernBERT binary classifier for distinguishing: - 0 — HUMAN The maximum sequence length is 512 tokens. This checkpoint was produced through reward-weighted classifier post-training. The original Firebird checkpoint was kept frozen as a reference model. Training examples were scored by the original classifier, difficult examples received larger loss weights, and the post-trained model was constrained against the frozen reference using a KL penalty. L = weightedcrossentropy + beta KL(reference || policy) Hard human examples received greater weighting than ordinary examples because one goal of the…

Open weights 150M parameters 8,192 tokens transformers

Model · Text classification

pyrrho-v2-nano-g1

Yan Fitzner

Pyrrho is a CPU-runnable co-processor for retrieval-augmented generation. It reads a question before retrieval to suggest what evidence to seek, then reads the question with retrieved passages to assess whether those passages support an answer. A surrounding RAG runtime decides whether to answer, retrieve again, or surface a conflict. The broader project is described in the The evidence verdict is SUFFICIENT, DISPUTED, or INSUFFICIENT. These are predictions about the supplied passages. The model does not retrieve sources, generate answers or citations, check external facts, or prove that a corpus has been searched completely. The two passes use the same encoder with different input…

Open weights cc-by-nc-4.0 150M parameters 8,192 tokens transformers

Model · Text classification

Julia-1-MLX

Zain Merchant

Julia-1 for Apple silicon. Runs Supersonic Labs' Julia-1 decision model on the Mac's GPU with MLX through the julia-mlx runtime: the same answers as the official PyTorch runtime on its published evaluations, 5–14× faster on the same Mac. The upstream model repository is SupersonicLabs/Julia-1. The files in this repository are Supersonic Labs' Julia-1 checkpoint, unchanged (model.safetensors SHA-256 df853bf7fe424420011f3d0c47a05d7341aa9eefa7fb9f203ea4aada4ad95b72). The runtime maps it into MLX directly, so no converted copy is needed. Precision (dtype="float16") and embedding placement are load-time options rather than separate files. This is an independent project, not affiliated with or…

Open weights apache-2.0 144M parameters mlx

Model · Text classification

julia-routing-strix-halo-multilingual

Richard

Experimental multilingual fine-tune of Julia-1 for fast bounded-decision routing on AMD Strix Halo-class local machines. This is an experimental v0.2 multilingual candidate, not a replacement for the English-focused v0.1 checkpoint. - task routing over fixed options - documentation-update triage - context-management metadata - non-authoritative tool-policy hints Do not use this model as the final authority for destructive commands, credential handling, production deploys, security replay safety, durable memory writes, summarization, or final prose. By language on the large multilingual holdout: All latency numbers in development were measured on CPU. NPU acceleration has not been validated.…

Open weights apache-2.0 144M parameters julia

Model · Text classification

prompt-injection-guard-small

Horizon Labs

A fast, multilingual classifier that flags prompt injection and jailbreak attempts, both in user messages (direct) and in untrusted content an AI agent reads: emails, web pages, documents, RAG chunks, and tool/API outputs (indirect). their clean counterparts, so it looks for instructions aimed at the AI, not for scary words. - Low false-alarm rate on look-alike benign text: 89.7% on NotInject, 99.5% on OR-Bench-hard. half the size and the same decisions as fp32 on our checks), transformers.js. Labels: SAFE (0) and INJECTION (1). This is the same convention as protectai/deberta-v3-base-prompt-injection-v2, so the model is a drop-in replacement in code and tools built for that one. INJECTION…

Open weights apache-2.0 141M parameters 8,192 tokens transformers

This model is distilled from the zero-shot classification pipeline on the Multilingual Sentiment dataset using this script. In reality the multilingual-sentiment dataset is annotated of course, but we'll pretend and ignore the annotations for the sake of example. Result can be reproduce using the following commands: If you are training this model on Colab, make the following code changes to avoid Out-of-memory error message: - Transformers 4.28.1 - Pytorch 2.0.0+cu118 - Datasets 2.11.0 - Tokenizers 0.13.3

Open weights apache-2.0 135M parameters 512 tokens transformers