Why I Built a Native ML Inference Engine in Rust
Kjarni 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.
Technical articles on AI inference, search, embeddings, and building developer tools.
Kjarni 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.
Run 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.
Add 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.
Build 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.
Run 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.
Implement 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.
Run 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.
Improve 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.
Build 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.
Implement IChatClient locally in .NET. Run Llama, Qwen or Phi through Microsoft.Extensions.AI and Semantic Kernel with one NuGet package. The model loads into your process, with streaming and multi-turn included.
Three config files disagree about how long an all-MiniLM-L6-v2 input can be, and the answer sentence-transformers uses is 256 tokens. At a 1000-character chunk size, 87% of chunks are longer than that, and the excess is discarded silently.