Kjarni against PyTorch, ONNX Runtime and llama.cpp: the numbers and why
Same weights, every engine at its best settings. Where a 28 MB Rust inference engine is level, where it's ahead, where it's behind, and the measured reason for each.
Read more29 posts
Same weights, every engine at its best settings. Where a 28 MB Rust inference engine is level, where it's ahead, where it's behind, and the measured reason for each.
Read moreRerank search results with ms-marco-MiniLM-L-6-v2 from Python, without sentence-transformers or PyTorch. The same scores as CrossEncoder, a 28 MB install, and loaded in 0.09 seconds. With an example of what a reranker fixes that embeddings get wrong.
Read moreTranscribe audio from Python with OpenAI's Whisper, running locally, without installing PyTorch or openai-whisper. The same transcript, 28 MB installed instead of 2.2 GB, no ffmpeg, and loaded in 0.4 seconds instead of 2.
Read moreTurn recordings into text and subtitles-style timestamps from your terminal with OpenAI's Whisper, running locally. One binary, no Python, no pip, no GPU. A whole folder of recordings in a three-line shell loop.
Read moreRun all-MiniLM-L6-v2 and other sentence-transformers models from Rust with one crate: no ONNX export, no libtorch, no Python. The same scores as sentence-transformers, a 25 MB binary, and 1,000 sentences embedded in about a second.
Read moreA semantic search HTTP service in 60 lines of Go. The embedding model runs inside the Go process, the native library is embedded in the binary, and it builds with CGO_ENABLED=0. Under 10 ms per search on a CPU.
Read moreTranscribe audio files from C# with OpenAI's Whisper running locally: no API key, no Python, no whisper.cpp build. One NuGet package, timestamps per segment, and 3 minutes of speech transcribed in 25 seconds on a CPU.
Read moreRun all-MiniLM-L6-v2 from Python without installing PyTorch or sentence-transformers. The same similarity scores to four decimals, 28 MB installed instead of 1.4 GB, and loaded in 0.07 seconds instead of 3.4.
Read moreSearch a folder of photos by typing what is in them, from C#, with no cloud API, no Python and no ONNX export. CLIP runs in your process from one NuGet package. Tested on 1,000 COCO photos: 19 ms per photo to index, and the right photo in the top 5 for 85% of captions.
Read moreA grep that finds lines by what they mean, in 50 lines of C#. Ask "is this safe to call from several threads" and get the comments that answer it, where grep finds nothing. One NuGet package, offline, no Python.
Read moreRun a local LLM inside a Qt 6 / QML application: stream tokens to the UI, stop generation, and keep conversation history, with no server and no API key. Complete source, with real timings and memory use from Llama 3.2 1B.
Read moreAdd offline speech to text to a Qt 6 / QML app: capture the microphone with QAudioSource, transcribe with Whisper on a worker thread, and keep the UI responsive. No Python and no cloud API. A complete CMake project with real timings.
Read moreAdd keyword, semantic and hybrid search with cross-encoder reranking to a Qt 6 / QML application, running locally in C++ with no Python, no ONNX Runtime and no server. A complete working example with real results.
Read moreRun transformer models inside a Unity game with no server and no API key: match free-text player commands by meaning, moderate chat with toxic-bert, and give an NPC a local LLM. Two DLLs, .NET Standard 2.1, Mono and IL2CPP.
Read moreWhich Kjarni file you need on Windows and where it comes from: Kjarni.dll and kjarni_ffi.dll for C# and Unity, kjarni_ffi.lib and kjarni.h for C++, and kjarni.exe for the command line. Nothing else to install from 0.2.4.
Read moreLoad Llama, Mistral, Qwen or Phi inside a C++ program and generate text in-process. One header and one shared library, blocking replies and token streaming, with the model running on your own machine.
Read moreIndex a directory, then search it by keyword, by meaning, or both, from Python. One pip install with no dependencies, running on your own machine, with a worked example of where hybrid search goes wrong and what fixes it.
Read moreRun embeddings, classification and reranking from C++ with no libtorch and no ONNX Runtime: one header and one shared library that links only against libc. Works with C++11, C++14, C++17 and C++23, and takes four commands from nothing to output.
Read moreall-MiniLM-L6-v2 truncates at 256 tokens, about 900 characters, and drops the rest without a warning. Why the configs say 128, 256 and 512, what chunk size to use, and why raising max_seq_length to 512 makes retrieval worse.
Read moreImplement IChatClient with the model inside your .NET process. No daemon, no localhost port. Streaming, multi-turn and Semantic Kernel.
Read moreBuild a retrieval-augmented generation pipeline in C#: index documents, search them, rerank the hits, and answer with a local LLM. One NuGet package, start to finish, with every stage running on your own machine.
Read moreImprove search relevance in .NET with cross-encoder reranking. Rescore your existing search results from Elasticsearch, SQL LIKE, or vector search, locally in C# and in your own process.
Read moreRun Llama, Mistral, Qwen or Phi locally from C#. One NuGet package, loaded in-process and answering offline. Streaming, multi-turn conversations and sampling control in .NET.
Read moreImplement IEmbeddingGenerator locally in .NET. Plug Kjarni into Microsoft.Extensions.AI and Semantic Kernel with one NuGet package that has zero dependencies. Runs on CPU, in your process, offline.
Read moreRun sentiment analysis, generate embeddings, detect toxicity, and search documents from your terminal. One binary, reads stdin, writes JSON, pipes into any script or CI pipeline.
Read moreBuild a full-text search engine in C# with keyword search, semantic search, hybrid ranking, and reranking. Index files and query them in 10 lines of code, with the index living on your own disk.
Read moreAdd semantic search to your C# app in 5 lines. Match text by meaning, not keywords. One NuGet package with zero dependencies, running on CPU in your own process.
Read moreRun sentiment analysis locally in C# using transformer models. Positive, negative, neutral, emotions, toxicity. Three lines of code, one NuGet package, running on your own machine.
Read moreKjarni is a single native library that runs transformer models in your own process, from Rust, C#, Go, C++ or the command line. One install, on CPU, offline after the first run.
Read more