Blog

Technical articles on AI inference, search, embeddings, and building developer tools.

· 5 min read

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.

rust machine-learning inference embeddings transformers nlp kjarni
Read more
· 6 min read

Document Search in C# without Elasticsearch

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.

C# dotnet search-engine semantic-search bm25 reranking machine-learning nlp kjarni
Read more
· 5 min read

ML from the Command Line without Writing Code

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.

cli machine-learning sentiment-analysis embeddings search nlp kjarni devops
Read more
· 5 min read

Local Embeddings for Microsoft.Extensions.AI, no Ollama

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.

C# dotnet microsoft-extensions-ai semantic-kernel embeddings iembeddinggenerator rag local-ai nlp kjarni
Read more
· 6 min read

Local LLM Chat in C# without Ollama or an API Key

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.

C# dotnet llm llama mistral local-ai chatbot inference nlp kjarni
Read more
· 7 min read

Reranking in C# with a Cross-Encoder

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.

C# dotnet reranking cross-encoder search semantic-search relevance rag local-ai kjarni
Read more
· 6 min read

RAG in C# without a Vector Database

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.

C# dotnet rag retrieval-augmented-generation vector-database semantic-search reranking llm local-ai kjarni
Read more
· 4 min read

A local IChatClient for Microsoft.Extensions.AI

Implement IChatClient with the model inside your .NET process. No daemon, no localhost port. Streaming, multi-turn and Semantic Kernel.

C# dotnet microsoft-extensions-ai ichatclient semantic-kernel llm llama local-ai inference kjarni
Read more
· 4 min read

The 256-token limit in all-MiniLM-L6-v2

Three config files disagree about how long a MiniLM input can be. sentence-transformers uses 256 tokens, everything past that is dropped silently, and extending the window is not the fix.

embeddings sentence-transformers rag minilm chunking semantic-search nlp kjarni
Read more
· 10 min read

Semantic Search in C++ without Python, libtorch or ONNX Runtime

Run embeddings, classification and reranking from C++ with no Python, no libtorch and no ONNX Runtime. Works with C++11, C++14, C++17 and C++23: only the optional header wrapper needs C++23. Four commands from nothing to output.

cpp c++11 c++17 c++23 semantic-search embeddings machine-learning reranking inference nlp kjarni
Read more