Kjarni library lets C++ developers run transformer models without Python or ONNX
A new open-source library called Kjarni enables C++ developers to run transformer-based semantic search models using just four terminal commands, with no Python, libtorch, or ONNX Runtime required. The library ships as a shared object file alongside a C ABI header and a header-only C++23 wrapper, keeping the total binary footprint under 20 MB. It uses the MiniLM-L6-v2 embedding model, which converts text into 384-dimensional vectors and enables similarity comparisons between semantically related phrases even when they share no common words. For example, 'How do I get my money back?' and 'What is your refund policy?' score 0.55 on cosine similarity despite having no overlapping terms. The library is available for Linux, macOS, and Windows via GitHub releases, and all fallible operations return std::expected rather than throwing exceptions.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in