Skip to page content
SAVRN
Search Plan a project

Open-weight model · Feature extraction

embeddinggemma-2-coreml

by Fluid Inference Community FluidInference/embeddinggemma-2-coreml

embeddinggemma-2-coreml is an open-weight model for feature extraction from Fluid Inference Community, released under Apache License 2.0. Its published files total 1.2 GB.

The text and audio encoders of google/embeddinggemma-2 converted to Core ML: text runs entirely on the Apple Neural Engine, audio on the GPU. Weights are the original ones (stored fp16 in the model; the token table is the original bf16).

Parameters—
Context—
Weights872.0 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By Fluid Inference Community, published under apache-2.0, revision c0fefd0ab4c1.

The text and audio encoders of google/embeddinggemma-2 converted to Core ML: text runs entirely on the Apple Neural Engine, audio on the GPU. Weights are the original ones (stored fp16 in the model; the token table is the original bf16). The audio encoder is included (see Audio); the vision encoder is not. Output: the same 768-d, L2-normalized embedding as SentenceTransformer("google/embeddinggemma-2").encode(...) (mean pooling over tokens, then normalization). Matryoshka truncation to 512/256/128 works as in the original: keep the first N values and re-normalize. Audio (added): EmbeddingGemma2Audio.mlpackage turns 10 s of 16 kHz audio into 250 tokens in the text model's space; the text…

Read Fluid Inference Community's full model card

EmbeddingGemma 2 (text + audio) — Core ML

The text and audio encoders of google/embeddinggemma-2 converted to Core ML: text runs entirely on the Apple Neural Engine, audio on the GPU. Weights are the original ones (stored fp16 in the model; the token table is the original bf16). The audio encoder is included (see Audio); the vision encoder is not.

Output: the same 768-d, L2-normalized embedding as SentenceTransformer("google/embeddinggemma-2").encode(...) (mean pooling over tokens, then normalization). Matryoshka truncation to 512/256/128 works as in the original: keep the first N values and re-normalize.

Audio (added): EmbeddingGemma2Audio.mlpackage turns 10 s of 16 kHz audio into 250 tokens in the text model's space; the text functions then embed them, so audio and text share one space (search audio with a text query).

Files

File What
EmbeddingGemma2Text.mlpackage ML Program, fp16, 7 functions sharing one set of weights (271 MB)
embeddings.bf16 token embedding table, 262,144 × 512 raw bfloat16 (256 MB); look up rows, multiply by √512
tokenizer.json the original Gemma tokenizer, unchanged
EmbeddingGemma2Audio.mlpackage audio encoder (Gemma 4 USM conformer, 12 layers) + projection, fp16, log-mel in-graph (561 MB)
config.json shapes, function list, token ids, task prefixes, audio window layout

Functions

Every function has fixed shapes, which is what keeps it on the Neural Engine. Variable-length (enumerated) shapes put the whole graph on the CPU.

Function Inputs Output
embed_32 … embed_512 inputs_embeds [1, S, 512] fp16, attention_mask [1, S] fp16 (1 = token, right padding) embedding [1, 768]
pack_256 inputs_embeds [1, 256, 512], attention_bias [1, 1, 256, 256] (0 within a text, −1e4 elsewhere), positions [256, 1] (restart at 0 per text), pool [8, 256] (1/len over each text's tokens) embedding [8, 768]

S ∈ {32, 48, 64, 128, 256, 512}. Inputs longer than 512 tokens must be truncated; on our test set capping at 512 tokens changed nothing measurable. At ≤ 512 tokens every sliding-window layer sees the whole sequence, so a padding mask is all the model needs.

pack_256 runs up to eight short texts in one call. Short calls are bound by streaming the weights from memory, so one 256-token call with eight texts costs about the same as two single calls.

Audio

EmbeddingGemma2Audio.mlpackage: waveform [1, 160160] fp32 (160 zero samples, then up to 10 s of 16 kHz mono, zero-padded) and frame_mask [1, 1000] (frame i valid when i*160 + 321 <= 160 + samples) → audio_tokens [1, 250, 512]; token k is valid when frame_mask[4k] is. Build <bos> <|audio> tokens <audio|> <eos> (special tokens from embeddings.bf16 × √512, audio tokens as they are) and run embed_256. Log-mel (Gemma 4 feature extractor: 20 ms Hann frames, 10 ms hop, 128 HTK mel bins, log(mag + 1e-3)) is computed inside the model.

Run it on the GPU (cpuAndGPU): the chunked local attention's 5-D blocks fall back to the CPU on the Neural Engine (46 ms per window there vs 13.6 ms on the GPU). fp16 drifts from fp32 on a few quiet tokens (window embedding cos ≥ 0.977, mean 0.9993); on a 1-hour earnings-call index, the top hit matched fp32 for 15/15 text queries and the top-5 overlap was 95%.

1 hour of audio, M5 Pro Time
audio model (GPU, fp16) 5.8 s (617× real time)
audio model + text model, one window after another 10.2 s (353×)
fp32 audio model (exact to PyTorch, token cos 1.0000) 13.2 s (272×)

Use

  1. Prepend the task prefix (e.g. title: none | text: for documents, task: search result | query: for queries; all in config.json).
  2. Tokenize with tokenizer.json: <bos> (2), tokens, <eos> (1).
  3. Look up each id's row in embeddings.bf16 (bf16 → float: shift the 16 bits left by 16), multiply by √512 ≈ 22.627417, pass as fp16.
  4. Call the smallest embed_S that fits, or pack several texts into pack_256.

A Swift implementation (tokenizer, table lookup, packing, downloads) is in FluidUse: EmbeddingGemma2Manager.

Requires macOS 15 / iOS 18 (multifunction models). The first load on a device compiles all seven functions for the Neural Engine, which takes several minutes once; Core ML caches the result.

Numbers (M5 Pro, macOS 27)

Result
Neural Engine placement 3,862 / 3,862 ops (100%) in every function
Latency, one text 32 tokens 2.6 ms · 64 tokens 3.2 ms · 128 tokens 5.6 ms · 256 tokens 11.3 ms · 512 tokens 27.4 ms
Throughput, short posts (pack_256, Swift) 644 texts/s (one text per call: 307/s)
vs PyTorch fp32 (sentence-transformers) cosine ≥ 0.9984, mean 0.99996 over 562 posts

The model card warns against fp16: activations reach ~2,000, so squaring them inside RMSNorm overflows fp16. Every RMSNorm here divides by the row's max-abs value first, which keeps the math in range (plain fp16 RMSNorm: cosine 0.95 to the reference; this conversion: 0.9996). The final normalization is rescaled the same way.

License: Apache 2.0, same as the source model.

Configuration

Hidden size
512

Identity and Version

Repository
FluidInference/embeddinggemma-2-coreml
Publisher
Fluid Inference Community
Task
Feature extraction
Modality
Text
Library
coreml
Parameters
Not stated by the source
Languages
on-device
Revision
c0fefd0ab4c1140ab35fb582ddbe51b4f93205e1
First published
2026-10-09
Last updated
2026-10-09

Files and Weights

11 files, 1.2 GB in total. The weights are 4 files totalling 872.0 MB in bin, mlmodel.

Weights4 files · 872.0 MB
Configuration3 files · 3.0 KB
Tokenizer1 file · 32.2 MB
Documentation1 file · 5.5 KB
Other1 file · 268.4 MB
Repository1 file · 1.6 KB
Every file
FileTypeSizeSHA-256
EmbeddingGemma2Audio.mlpackage/Data/com.apple.CoreML/model.mlmodelWeights1.1 MB d40896e5c88d
EmbeddingGemma2Audio.mlpackage/Data/com.apple.CoreML/weights/weight.binWeights586.8 MB 41d7b552caab
EmbeddingGemma2Text.mlpackage/Data/com.apple.CoreML/model.mlmodelWeights7.3 MB 0df9aca02807
EmbeddingGemma2Text.mlpackage/Data/com.apple.CoreML/weights/weight.binWeights276.8 MB 75b97ab036ca
EmbeddingGemma2Audio.mlpackage/Manifest.jsonConfiguration617 B —
EmbeddingGemma2Text.mlpackage/Manifest.jsonConfiguration617 B —
config.jsonConfiguration1.8 KB —
README.mdDocumentation5.5 KB —
embeddings.bf16Other268.4 MB 56ebbdbfd706
.gitattributesRepository1.6 KB —
tokenizer.jsonTokenizer32.2 MB 4d777ef5bdc1

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
872.0 MB
Download from Fluid Inference Community

Released by Fluid Inference Community through its official repository on Hugging Face. Read the license.

Built From

  • Derived from google/embeddinggemma-2
  • Quantized from google/embeddinggemma-2

Memory Requirements

PrecisionWeights in memory
As published872.0 MB

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

Questions About embeddinggemma-2-coreml

Can I use embeddinggemma-2-coreml commercially?

Yes. embeddinggemma-2-coreml 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.

Similar Models

Model · Feature extraction

all-MiniLM-L6-v2

Joshua

https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model to compute embeddings like this: You can convert this Tensor to a nested JavaScript array using.tolist(): Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights apache-2.0 512 tokens transformers.js

Model · Feature extraction

bge-base-en-v1.5

Joshua

https://huggingface.co/BAAI/bge-base-en-v1.5 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model to compute embeddings, as follows: You can also use the model for retrieval. For example: Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights mit 512 tokens transformers.js

For more details please refer to our Github: FlagEmbedding. If you are looking for a model that supports more languages, longer texts, and other retrieval methods, you can try using bge-m3. FlagEmbedding focuses on retrieval-augmented LLMs, consisting of the following projects currently: - 1/30/2024: Release BGE-M3, a new member to BGE model series! M3 stands for Multi-linguality (100+ languages), Multi-granularities (input length up to 8192), Multi-Functionality (unification of dense, lexical, multi-vec/colbert retrieval). It is the first embedding model which supports all three retrieval methods, achieving new SOTA on multi-lingual (MIRACL) and cross-lingual (MKQA) benchmarks. Technical…

Open weights mit 512 tokens sentence-transformers

Model · Feature extraction

wavlm-large

Microsoft

The large model pretrained on 16kHz sampled speech audio. When using the model, make sure that your speech input is also sampled at 16kHz. Note: This model does not have a tokenizer as it was pretrained on audio alone. In order to use this model speech recognition, a tokenizer should be created and the model should be fine-tuned on labeled text data. Check out this blog for more in-detail explanation of how to fine-tune the model. - 60,000 hours of Libri-Light - 10,000 hours of GigaSpeech - 24,000 hours of VoxPopuli Authors: Sanyuan Chen, Chengyi Wang, Zhengyang Chen, Yu Wu, Shujie Liu, Zhuo Chen, Jinyu Li, Naoyuki Kanda, Takuya Yoshioka, Xiong Xiao, Jian Wu, Long Zhou, Shuo Ren, Yanmin…

Open weights transformers

Model · Feature extraction

clap-htsat-unfused

LAION eV

The abstract of the paper states that: You can use this model for zero shot audio classification or extracting audio and/or textual features. You can also get the audio and text embeddings using ClapModel If you are using this model for your work, please consider citing the original paper

Open weights apache-2.0 514 tokens transformers