This repository contains MLX weights for
feyninc/pulpie-orange-small,
a 210M-parameter EuroBERT token-classification model for main-content extraction
from HTML.
The source checkpoint is an encoder-only EuroBERT model with RoPE, RMSNorm,
SwiGLU MLP layers, and a token-classification head. It is not a decoder-only
LLM, so this conversion does not use mlx-lm's standard LLM model classes.
Instead, this repository includes modeling_eurobert_mlx.py, a small MLX
implementation of the source architecture with matching parameter names.
Files
File
Purpose
model-bf16.safetensors
Native 16-bit BF16 MLX weights converted from the source checkpoint.
model-8bit.safetensors
MLX affine 8-bit weight-quantized variant.
model-4bit.safetensors
MLX affine 4-bit weight-quantized variant.
modeling_eurobert_mlx.py
MLX EuroBERT token-classification loader.
mlx_config.json
Variant metadata and quantization settings.
verification_report.json
Load, numerical, extraction, latency, and compute-cost results.
Downloaded feyninc/pulpie-orange-small from the Hugging Face Hub.
Inspected config.json, configuration_eurobert.py, and
modeling_eurobert.py.
Confirmed the model is EuroBertForTokenClassification with 12 layers,
hidden size 768, 12 attention heads, head dim 64, max length 8192, BF16
source weights, and 2 output labels.
Confirmed current MLX can be installed on Linux with mlx[cpu], so no cloud
Mac was required for conversion or load verification.
Implemented a custom MLX EuroBERT token-classification module with matching
state-dict keys and the source architecture behavior.
Saved the BF16 MLX weights with mlx.core.save_safetensors.
Created 8-bit and 4-bit variants with mlx.nn.quantize, using affine
weight quantization, group size 64, over MLX Linear and Embedding
modules.
Verified each variant with scripts/verify_mlx.py.
Verification Results
Verification was run on Linux x86_64 using mlx[cpu]. The PyTorch reference was
the original source checkpoint loaded in float32 with eager attention. The BF16
variant is expected to have small dtype-level differences versus that float32
reference; quantized variants have larger differences.
Load Checks
Variant
Load result
Test logits shape
Test logits dtype
BF16
Pass
[1, 3, 2]
mlx.core.bfloat16
8-bit
Pass
[1, 3, 2]
mlx.core.bfloat16
4-bit
Pass
[1, 3, 2]
mlx.core.bfloat16
Numerical Accuracy
Test inputs: ["A", "B", "C"], token shape [3, 2].
Variant
Max abs diff vs PyTorch fp32
Mean abs diff
MLX CPU latency
BF16
0.0452327728
0.0191817340
716.88 ms
8-bit
1.2797489166
0.5423613191
9380.58 ms
4-bit
2.2551989555
1.1897996664
9323.18 ms
PyTorch fp32 eager latency on the same input was 50.09 ms on this Linux CPU.
The quantized MLX CPU path is slow on this host and should not be read as an
Apple Silicon benchmark.
End-to-End Extraction
Sample HTML:
<html><body><article><h1>Apple MLX conversion</h1><p>This article explains how to convert a EuroBERT content extraction model to MLX format.</p></article></body></html>
Pulpie preprocessing produced 2 blocks and one 50-token chunk. All variants
loaded, classified both blocks as main, and reconstructed non-empty HTML.
Variant
Predictions
Non-empty output
MLX CPU extraction latency
BF16
[1, 1]
Pass
5469.05 ms
8-bit
[1, 1]
Pass
78333.61 ms
4-bit
[1, 1]
Pass
77852.02 ms
Full machine-readable results are in verification_report.json.
Limitations
This is a custom MLX encoder/token-classification implementation, not an
mlx-lm decoder model.
The 8-bit and 4-bit variants are weight-only affine MLX quantizations. They
load and pass a small extraction test, but full WebMainBench quality was not
re-evaluated.
Linux CPU quantized latency is poor in this environment. MLX is primarily
intended for Apple Silicon GPU execution.
The source tokenizer currently emits a Transformers regex warning. The
verifier keeps the tokenizer behavior used by the published pulpie package
rather than changing token IDs during conversion.
Compute Cost
No paid cloud Mac or hosted GPU was used. Conversion and verification were done
locally on Linux x86_64 with the MLX CPU package. Incremental compute cost:
$0.00.
License
The source model weights are licensed under CC BY-NC 4.0. This converted
checkpoint follows the same non-commercial license. The included conversion and
loader code is provided for interoperability with the converted weights.