An ONNX conversion of Microsoft's microsoft/harrier-oss-v1-270m, a multilingual
text embedding model for retrieval, semantic similarity, and clustering.
This export produces one normalized 640-dimensional embedding per input.
The weights come directly from the Microsoft checkpoint at revision
31de22b673913c7d658c0f03f792d77c2dcf8ebd, not from another ONNX conversion.
Microsoft describes the source model as trained with multilingual contrastive
learning and knowledge distillation from larger embedding models. This conversion
does not train or quantize the weights.
| Component | Description |
|---|---|
| Model family | Harrier OSS v1, approximately 270 million parameters |
| Backbone | Gemma3 text, decoder-only transformer |
| Layers | 18, using full causal attention rather than sliding-window attention |
| Hidden / feed-forward width | 640 / 2,048 |
| Grouped-query attention | 4 query heads sharing 1 key/value head; head dimension 256 |
| Position encoding | Rotary position embeddings (RoPE) |
| Vocabulary | 262,144 tokens |
| Context limit | 32,768 tokens, including special tokens and instructions |
| Sentence embedding | Last non-padding token, followed by L2 normalization |
The ONNX graph includes pooling and output normalization. It is an embedding model, not a text-generation interface.
Weights, projections, residuals, normalization, pooling, and output use FP32.
Only the fused com.microsoft::GroupQueryAttention inputs and rotary caches use
BF16; attention output returns to FP32. This is an unquantized mixed FP32/BF16
export, not an all-FP16 or all-BF16 model.
The validated configuration is ONNX Runtime 1.31.0 + CUDA plugin v0.3.0,
with a compatible CUDA 13 installation on native Windows ARM64. These are tested
versions, not established minimum versions. Other configurations are unvalidated.
Obtain the standalone plugin from Microsoft's ONNX Runtime release
plugin-ep-cuda/v0.3.0; CUDA and plugin binaries are not included.
This graph requires BF16-capable CUDA attention. It is not CPU-only compatible with the tested runtime. Numerical model computation runs on CUDA; tokenization, runtime orchestration, and shape/metadata bookkeeping use the CPU. The wrapper returns embeddings to host memory.
The graph declares ONNX opset 21, IR version 10, and com.microsoft opset 1.
The Python onnx package is needed for export/checking, not inference.
Keep the core and plugin compatible: supporting the standard opset alone does
not guarantee support for the contributed attention operator. Recheck numerical
correctness and provider placement when changing the software stack.
Download this repository and install the inference dependencies:
python -m pip install -r requirements.txt
Then load the included wrapper, supplying your plugin and CUDA DLL directories:
from inference import EmbeddingModel, PROMPT, tokenize
model = EmbeddingModel(
r"onnx\model.onnx",
r"<plugin-directory>\onnxruntime_providers_cuda.dll",
r"<CUDA-directory>\bin\arm64",
)
ids, mask = tokenize(".", [PROMPT + "What does summit mean?"])
query_embeddings = model.encode_tokens(ids, mask)
ids, mask = tokenize(".", ["A summit is the highest point of a mountain."])
document_embeddings = model.encode_tokens(ids, mask)
scores = query_embeddings @ document_embeddings.T
PROMPT supplies the upstream web-search query instruction. Do not add it to
documents. Other task instructions are in config_sentence_transformers.json.
Use the included tokenizer without changing its special-token behavior.
The wrapper truncates text beyond the context limit; split longer documents
explicitly if truncation is inappropriate. Do not pool or normalize again.
Keep onnx\model.onnx and onnx\model.onnx_data together. Direct ONNX callers
must supply int64 input_ids and attention_mask of identical nonempty
[batch, sequence] shape, with sequence length 1-32,768, token IDs in
[0, 262143], and binary contiguous right padding with at least one real token
per row. Output sentence_embedding is float32 [batch, 640].
manifest.json records source provenance, precision, and file SHA-256 digests.
download_source.py, export_model.py, and requirements-export.txt provide
the source-download and export tools. Consult Microsoft's source model card for
language coverage, intended uses, training details, and limitations. This is an
independent conversion, not a new trained model or an official Microsoft export.
The source model card declares the MIT license. Standard MIT text and attribution
are supplied in LICENSE and NOTICE; the pinned source repository does not
contain a separate license file. Credit for the model weights and training
belongs to Microsoft.
microsoft/harrier-oss-v1-270m