goformer
A pure Go library that loads HuggingFace safetensors directly and runs BERT inference to generate embeddings, with no ONNX export step or Python in the build pipeline. Embeddings match the Python reference to cosine similarity > 0.9999, running at about 154ms per embedding.
What it addresses
Using BGE-small-en-v1.5 and FAISS from Go means CGO, requiring a C toolchain and platform-specific binaries in builds; this library eliminates those ML dependencies.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
goformer
A pure Go library that loads HuggingFace safetensors directly and runs BERT inference to generate embeddings, with no ONNX export step or Python in the build pipeline. Embeddings match the Python reference to cosine similarity > 0.9999, running at about 154ms per embedding.
Problem: Using BGE-small-en-v1.5 and FAISS from Go means CGO, requiring a C toolchain and platform-specific binaries in builds; this library eliminates those ML dependencies.
Posted by @mikeayles · Original source ↗
Source text · @mikeayles · · Source ↗
goformer (https://www.mikeayles.com/blog/goformer/) loads HuggingFace safetensors directly and runs BERT inference. No ONNX export step, no Python in the build pipeline. It produces embeddings that match the Python reference to cosine similarity > 0.9999.