Core ML conversions of LiquidAI/LFM2.5-ColBERT-350M for on-device late-interaction (ColBERT / MaxSim) retrieval on Apple silicon.
This repository contains only the converted, ready-to-run .mlmodelc files and does
not modify the model's behavior — the weights, architecture, and outputs come
entirely from the base model. All credit for the model belongs to Liquid AI.
Base model:
LiquidAI/LFM2.5-ColBERT-350MLicense: LFM Open License v1.0 (lfm1.0) — inherited from the base model (see License)
The base model is a multilingual late-interaction retriever: it produces one
128-dimensional, L2-normalized vector per token, and scores query↔document with
MaxSim (Σ_q max_d (q · d)). This gives higher accuracy and better generalization
than single-vector embeddings, at the cost of a larger index.
These compiled Core ML models let you run the encoder on the Apple Neural Engine (ANE) / GPU / CPU on iPhone, iPad, and Mac, without Python or PyTorch at inference time.
Exported graph: embed → 16 hybrid layers (10 short-conv + 6 GQA attention) → Dense(1024→128, no bias) → per-token L2 norm.
input_ids (1, seq) int32, attention_mask (1, seq) int32token_embeddings (1, seq, 128) — per-token, L2-normalizedBecause Core ML on the ANE prefers static shapes, the encoder is split into two fixed-length packages (matching the base model's limits: query = 32 tokens, document = 512 tokens).
| File | Role | Seq | Precision | Size |
|---|---|---|---|---|
LFM25-ColBERT-query-6bit.mlmodelc |
Query encoder | 32 | 6-bit palettized | 350 MB |
LFM25-ColBERT-doc-6bit.mlmodelc |
Document encoder | 512 | 6-bit palettized | 350 MB |
These are compiled Core ML models (.mlmodelc) — load them directly, no compile step needed.
Per-token cosine similarity over valid tokens, and end-to-end MaxSim ranking vs. the official PyLate pipeline:
| Precision | Query min-cos | Doc min-cos | MaxSim ranking |
|---|---|---|---|
| fp16 | 1.0000 | 0.9975 | exact match |
| 6-bit | 0.9983 | 0.9973 | exact match |
| Model | ComputeUnit.ALL |
CPU_AND_NE |
|---|---|---|
| Document (512) | 96% ANE | ~100% ANE |
| Query (32) | GPU-preferred by the planner | ~99% ANE |
All ops are ANE-compatible. To pin the query model to the Neural Engine, load it with
.cpuAndNeuralEngine compute units (see below). Measure real latency with Xcode
Instruments on your target device.
"[Q] " to queries and "[D] " to documents before tokenizing.attention_mask == 0) from the output before scoring.MaxSim = Σ_q max_d (q · d) over the L2-normalized token vectors.Use the base model's tokenizer (LiquidAI/LFM2.5-ColBERT-350M) to produce input_ids /
attention_mask.
import CoreML
let config = MLModelConfiguration()
config.computeUnits = .cpuAndNeuralEngine // pin to the Neural Engine
let docModel = try MLModel(
contentsOf: URL(fileURLWithPath: "LFM25-ColBERT-doc-6bit.mlmodelc"),
configuration: config)
// input_ids / attention_mask: MLMultiArray shape [1, 512], Int32
let out = try docModel.prediction(from: inputs)
// out.featureValue(for: "token_embeddings") -> [1, 512, 128]
import numpy as np, coremltools as ct
# .mlmodelc is a compiled model -> use CompiledMLModel
m = ct.models.CompiledMLModel("LFM25-ColBERT-doc-6bit.mlmodelc",
compute_units=ct.ComputeUnit.CPU_AND_NE)
out = m.predict({
"input_ids": ids.astype(np.int32), # (1, 512)
"attention_mask": mask.astype(np.int32), # (1, 512)
})
doc_vecs = out["token_embeddings"][0] # (512, 128), L2-normalized
# MaxSim against query vectors q (Q, 128):
scores = (q @ doc_vecs[doc_mask.astype(bool)].T).max(axis=1).sum()
See the base model card for training data, intended use, evaluation, and limitations.
coremltools (mlprogram, fp16;
minimum_deployment_target = iOS18).per_grouped_channel, group_size = 16); embeddings kept at fp16.This model is a conversion of LiquidAI/LFM2.5-ColBERT-350M and is distributed under the
same LFM Open License v1.0 (lfm1.0). Your use of these files is subject to that
license. See the license on the base model repository:
https://huggingface.co/LiquidAI/LFM2.5-ColBERT-350M/blob/main/LICENSE.
All rights to the underlying model belong to Liquid AI. This repository only redistributes a hardware-optimized (Core ML) form of their released weights.
@article{liquidai2025lfm2,
title={LFM2 Technical Report},
author={Liquid AI},
journal={arXiv preprint arXiv:2511.23404},
year={2025}
}
Model by Liquid AI. Core ML conversion for on-device Apple Neural Engine inference.
Have the files? Publish a torrent.
Publish a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo smdesai/LFM2.5-ColBERT-350M ./model-folderLFM25-ColBERT-doc-6bit.mlmodelc/weights/weight.bin 350 MBLFM25-ColBERT-query-6bit.mlmodelc/weights/weight.bin 349 MBLFM25-ColBERT-doc-6bit.mlmodelc/coremldata.bin 0.4 kBLFM25-ColBERT-query-6bit.mlmodelc/coremldata.bin 0.4 kBLFM25-ColBERT-doc-6bit.mlmodelc/analytics/coremldata.bin 0.2 kBLFM25-ColBERT-query-6bit.mlmodelc/analytics/coremldata.bin 0.2 kBLiquidAI/LFM2.5-ColBERT-350M