Repository navigation
Description
Problem / Background
mlx-vlm added models whose output is per-token tags or extracted spans rather than text or a sequence score: BERT *ForTokenClassification checkpoints such as Rampart and OpenAI Privacy Filter on a shared tagging and redaction pipeline (Neywa-Labs/mlx-vlm#2341, https://github.com/Blaizzy/mlx-vlm/blob/main/mlx_vlm/token_classification.py), and GLiNER2.5, which extracts spans for request-time labels (Neywa-Labs/mlx-vlm#2020, Neywa-Labs/mlx-vlm#2363). mlxcel's only classification surface is sequence-level /v1/rerank, so none of these can be served.
Goal
mlxcel tag and mlxcel extract with upstream's output shapes, a BERT / XLM-R token-classification head validated on Rampart, OpenAI Privacy Filter with its calibrated Viterbi decoder, and GLiNER2.5 on a new DeBERTa-v2 encoder, all matching mlx-vlm on their published checkpoints.
Sub-issues
Phase 1
- feat: Add token-classification and span-extraction output (mlxcel tag, mlxcel extract) #2383, PR feat: add token classification and span extraction (mlxcel tag, mlxcel extract) #2456
Phase 2
- feat(models): Support OpenAI Privacy Filter (openai_privacy_filter) PII tagger #2387 (depends on feat: Add token-classification and span-extraction output (mlxcel tag, mlxcel extract) #2383), PR feat(models): support OpenAI Privacy Filter PII tagger in mlxcel tag #2460
- feat(models): Support GLiNER2.5 (gliner2) span extraction with a DeBERTa-v2 encoder #2390 (depends on feat: Add token-classification and span-extraction output (mlxcel tag, mlxcel extract) #2383), PR feat(models): support GLiNER2.5 span extraction on a DeBERTa-v2 encoder #2461
Acceptance Criteria
- All sub-issues completed and merged (feat: add token classification and span extraction (mlxcel tag, mlxcel extract) #2456, feat(models): support OpenAI Privacy Filter PII tagger in mlxcel tag #2460, feat(models): support GLiNER2.5 span extraction on a DeBERTa-v2 encoder #2461).
- Rampart, Privacy Filter and GLiNER2.5 each reproduce their upstream README example through the CLI (checked on GB10 against the local
rampart-mlx-fp16,openai-privacy-filter-bf16andgliner2.5-small-v1checkpoints; the GLiNER description example matches mlx-vlm 0.7.8 span for span, confidences within 5e-4). -
docs/token-classification.mddocuments both output shapes and lists every model. - An HTTP route for these shapes is either filed as its own issue or explicitly declined in
docs/token-classification.md(upstream defines none). Declined in the docs by PR feat(models): support GLiNER2.5 span extraction on a DeBERTa-v2 encoder #2461.
Technical Considerations
Phase 1 (#2383) is the shared output surface plus the BERT token-classification head. Phase 2 is OpenAI Privacy Filter (#2387) and GLiNER2.5 with the DeBERTa-v2 encoder (#2390); they are independent of each other.
Activity
feat: add token classification and span extraction (mlxcel tag, mlxce…
feat(models): support GLiNER2.5 span extraction on a DeBERTa-v2 encod…
feat(token-classification): expose GLiNER2.5 CLI options, fix leftove…