What You Can Build with LM-Kit.NET
Standalone .NET samples across multiple capability areas. Every sample runs entirely on your machine with no cloud API calls, no internet dependency, and no data leaving your infrastructure. Clone the repo, open a project, and run.
Browse all samples on GitHub →
Tip
New to LM-Kit.NET? Start with Your First AI Agent to set up your environment and build a working agent in minutes.
1. Get Running in 60 Seconds
git clone https://github.com/LM-Kit/lm-kit-net-samples.git
cd lm-kit-net-samples
Open any .csproj in your IDE and run. Models download automatically on first launch. No API keys. No configuration files. No cloud accounts.
| Platform | GPU Support |
|---|---|
| Windows x64 | CUDA 12/13, Vulkan, CPU |
| Linux x64 / ARM64 | CUDA 12/13, Vulkan, CPU |
| macOS (Apple Silicon) | Metal, CPU |
2. Solve a Real Problem
Find the right sample for your use case:
| I need to... | Start with |
|---|---|
| Have a conversation with a local LLM | Multi-Turn Chat |
| Build an autonomous agent that reasons and acts | Research Assistant |
| Ask questions about my documents | Conversational RAG |
| Chat with a specific PDF | Chat with PDF |
| Give an agent web search, calculators, and file access | Tool Calling Assistant |
| Extract structured data from unstructured text | Structured Data Extraction |
| Parse resumes (text, PDF, or scanned images) into structured profiles | Resume Parser |
| Extract expense data from receipts (text, PDF, or photos) | Receipt & Expense Scanner |
| Extract key terms and clauses from contracts | Contract Key Terms Extractor |
| Detect and redact PII from documents | PII Extraction |
| Classify documents by category | Document Classification |
| Analyze customer sentiment at scale | Sentiment Analysis |
| Transcribe audio locally | Speech to Text |
| Convert scanned documents to searchable Markdown | Document to Markdown |
| Extract text and coordinates from images with OCR | VLM OCR with Coordinates |
| Build a help desk knowledge base | Help Desk Knowledge Base |
| Translate content between languages | Text Translator |
| Fine-tune a model on my own data | Fine-Tuning |
| Turn meeting recordings into action items | Smart Meeting Assistant |
| Analyze CSV or JSON data locally | Data Analyst Agent |
| Classify and draft responses to emails | Email Triage Agent |
| Monitor agent performance with telemetry | Telemetry & Observability |
3. Industry Solutions
Healthcare & Life Sciences
Patient data cannot leave your network. Local AI keeps PHI on-premises.
| Capability | Sample |
|---|---|
| Redact patient PII before sharing records | PII Extraction, Batch PII Extraction |
| Transcribe clinical dictations locally | Speech to Text |
| Generate meeting notes with action items | Smart Meeting Assistant |
| Extract structured data from lab reports | Structured Data Extraction |
| Classify medical documents by type | Document Classification |
Legal & Compliance
Attorney-client privilege requires that documents stay within your infrastructure.
| Capability | Sample |
|---|---|
| Review contracts and flag compliance issues | Multi-Agent Document Review |
| Extract named entities from legal filings | Named Entity Recognition |
| Search case files with natural language | Conversational RAG |
| Summarize lengthy documents | Document Summarizer |
| Extract key terms and risk flags from contracts | Contract Key Terms Extractor |
Also see the how-to guide: Process Email Archives for Compliance and Legal Discovery
Finance & Accounting
Regulatory requirements demand auditability and data sovereignty.
| Capability | Sample |
|---|---|
| Extract invoice data from PDFs and images | Invoice Data Extraction |
| Scan receipts and extract expense data | Receipt & Expense Scanner |
| Analyze market sentiment from reports | Sentiment Analysis |
| Classify financial documents by type | Batch Document Classification |
| Analyze financial data locally with AI | Data Analyst Agent |
| Detect emotions in customer communications | Emotion Detection |
Manufacturing & Field Operations
Field devices and factory floors often have no internet access.
| Capability | Sample |
|---|---|
| Transcribe inspection notes offline | Speech to Text |
| Extract text from equipment manuals (OCR) | VLM OCR |
| Build a searchable knowledge base for procedures | Help Desk Knowledge Base |
| Detect language in multilingual documents | Language Detection |
Also see the how-to guide: Build and Deploy an Offline AI Application for Edge Environments
Customer Service
Respond faster with AI that understands your product documentation.
| Capability | Sample |
|---|---|
| Build a support chatbot grounded in your docs | Conversational RAG |
| Route tickets to the right team | Custom Classification |
| Detect sarcasm and escalation cues | Sarcasm Detection |
| Triage and draft email responses | Email Triage Agent |
| Extract structured info from web content | Web Content Extractor to JSON |
4. Architecture Patterns
Each sample demonstrates a proven pattern you can adapt to your application:
Single Agent
One model, one task. The agent reasons, calls tools, and returns a result.
→ Research Assistant · Tool Calling Assistant · Web Search Assistant
Multi-Agent Pipeline
Multiple agents execute in sequence, each transforming the output for the next stage.
→ Content Creation Pipeline · Multi-Agent Document Review · Smart Meeting Assistant
Supervisor Delegation
A supervisor agent routes tasks to specialized worker agents based on the request.
→ Smart Task Router · Email Triage Agent
RAG (Retrieval-Augmented Generation)
Embed documents into vectors, retrieve relevant chunks, and generate grounded answers.
→ Conversational RAG · Single-Turn RAG · Help Desk Knowledge Base · Qdrant Integration
Document Processing Pipeline
Ingest documents, extract text and structure, convert formats, and index for search.
→ Document to Markdown · VLM OCR · Document Splitting · Document Processing Agent
External Tool Servers (MCP)
Connect agents to external tool servers via the Model Context Protocol.
→ MCP Integration · MCP Stdio Integration
5. Learning Paths
Beginner: Your First Week
Build confidence with core capabilities.
- Single-Turn Chat: send one prompt, get one response.
- Multi-Turn Chat: hold a conversation with history.
- Sentiment Analysis: classify text by sentiment.
- Text Translator: translate between languages.
- Speech to Text: transcribe audio locally.
Intermediate: Production Capabilities
Combine multiple features into real applications.
- Tool Calling Assistant: give the model tools to call.
- Conversational RAG: ground answers in your documents.
- PII Extraction: detect and redact sensitive data.
- Document to Markdown: convert any document to searchable text.
- Persistent Memory Assistant: remember facts across sessions.
Advanced: Enterprise Patterns
Build multi-agent systems with orchestration, delegation, and observability.
- Research Assistant: ReAct planning with web search and tool use.
- Smart Task Router: supervisor-based delegation across specialist agents.
- Content Creation Pipeline: sequential multi-agent workflows.
- Filter Pipeline: add middleware guardrails to agent conversations.
- Telemetry & Observability: instrument agents with OpenTelemetry.
6. All Samples at a Glance
AI Agents
| Sample | What It Demonstrates |
|---|---|
| Content Creation Pipeline | Sequential multi-agent workflow |
| Data Analyst Agent | Local data analysis with built-in tools |
| Document Processing Agent | PDF and image processing with built-in tools |
| Email Triage Agent | Email classification and response drafting |
| Filter Pipeline | Middleware guardrails for agent conversations |
| MCP Integration | Connect to external MCP tool servers |
| MCP Stdio Integration | Stdio-based MCP server connectivity |
| News Monitoring Agent | Automated news tracking with web search |
| Multi-Agent Document Review | Parallel multi-perspective document analysis |
| Multi-Turn Chat with Memory | Agent memory with semantic recall |
| Persistent Memory Assistant | Long-term knowledge across sessions |
| Research Assistant | ReAct planning with web search |
| Skill-Based Assistant | Load agent skills from SKILL.md files |
| Smart Meeting Assistant | Audio transcription to meeting notes pipeline |
| Smart Task Router | Supervisor-based task delegation |
| Tool Calling Assistant | Custom tool implementation |
| Web Search Assistant | Real-time web search integration |
Chat & Conversation
| Sample | What It Demonstrates |
|---|---|
| Chat Playground (MAUI) | Cross-platform desktop chat app |
| Multi-Turn Chat | Basic multi-turn conversation |
| Multi-Turn Chat with Chat History Guidance | History management strategies |
| Multi-Turn Chat with Coding Assistant | Code generation and review |
| Multi-Turn Chat with Custom Sampling | Temperature, top-p, and sampler control |
| Multi-Turn Chat with MCP | MCP tool integration in chat |
| Multi-Turn Chat with Persistent Session | Save and restore conversation state |
| Multi-Turn Chat with Tools | Function calling in multi-turn chat |
| Multi-Turn Chat with Vision | Image understanding in conversations |
| Multi-Turn Chat with Yes/No Assistant | Constrained output formatting |
| Single-Turn Chat | Simplest possible interaction |
Classification & Analysis
| Sample | What It Demonstrates |
|---|---|
| Batch Document Classification | Classify documents at scale |
| Custom Classification | Define your own categories |
| Document Classification | Automatic document type detection |
| Emotion Detection | Identify emotions in text |
| Keyword Extraction | Pull key terms from documents |
| Language Detection from Document | Detect language from PDFs and images |
| Sarcasm Detection | Detect sarcasm and irony |
| Sentiment Analysis | Positive/negative/neutral classification |
Data Extraction
| Sample | What It Demonstrates |
|---|---|
| Batch PII Extraction | PII detection across many documents |
| Contract Key Terms Extractor | Extract clauses, parties, dates, and risk flags from contracts |
| Invoice Data Extraction | Extract fields from invoices |
| Named Entity Recognition | Identify people, places, organizations |
| PII Extraction | Detect personal information |
| Receipt & Expense Scanner | Extract expense data from receipts and photos using VLMs |
| Resume Parser | Extract candidate profiles from resumes and scanned images using VLMs |
| Structured Data Extraction | Schema-driven field extraction |
| Web Content Extractor to JSON | Parse web content into structured JSON |
Document Processing
| Sample | What It Demonstrates |
|---|---|
| Chat with PDF | Interactive PDF Q&A |
| Document Processing Agent | Agent-driven PDF and image processing |
| Document Splitting | Intelligent document segmentation |
| Document Summarizer | Automatic document summarization |
| Document to Markdown | Convert any document to Markdown |
| Image to Markdown | OCR images to Markdown |
| Text Summarizer | Summarize plain text |
| VLM OCR | Vision-based OCR |
| VLM OCR with Coordinates | OCR with bounding box positions |
Embeddings & RAG
| Sample | What It Demonstrates |
|---|---|
| Conversational RAG | Multi-turn retrieval-augmented generation |
| Help Desk Knowledge Base | Build a searchable support system |
| Image Similarity Search | Find visually similar images |
| Retrieval Quality Tuning | Optimize retrieval precision and recall |
| Single-Turn RAG | Simple question-answering over documents |
| Single-Turn RAG with Qdrant | External vector database integration |
Integrations (Microsoft AI Ecosystem)
| Sample | What It Demonstrates |
|---|---|
| Microsoft.Extensions.AI Integration | Use LM-Kit as an IChatClient drop-in |
| Semantic Kernel Integration Memory Demo | LM-Kit as a Semantic Kernel backend |
Also see the how-to guide: Migrate from Cloud AI APIs to Local Inference with Microsoft.Extensions.AI
Function Calling
| Sample | What It Demonstrates |
|---|---|
| Function Calling | Register and invoke custom functions |
Model Operations
| Sample | What It Demonstrates |
|---|---|
| Fine-Tuning | Train a model on custom data (LoRA) |
| Quantization | Reduce model size for edge deployment |
Observability & Monitoring
| Sample | What It Demonstrates |
|---|---|
| Telemetry & Observability | OpenTelemetry tracing and metrics |
Prompt Templates
| Sample | What It Demonstrates |
|---|---|
| Prompt Templates with Logic | Variables, conditionals, loops, and filters |
Speech & Audio
| Sample | What It Demonstrates |
|---|---|
| Audio Transcription App (MAUI) | Cross-platform transcription desktop app |
| Smart Meeting Assistant | Transcription to meeting notes pipeline |
| Speech to Text | Local Whisper transcription |
Also see the how-to guide: Build a Voice-Commanded Agent That Executes Tools
Text Generation & Transformation
| Sample | What It Demonstrates |
|---|---|
| Text Corrector | Grammar and spelling correction |
| Text Rewriter | Rewrite in different styles |
| Text Translator | Multilingual translation |
7. Hardware Quick Reference
All samples run on CPU. GPU acceleration is optional but recommended for larger models.
| Sample Category | Minimum VRAM | Recommended Model |
|---|---|---|
| Chat & Conversation | 2 GB | gemma3:4b |
| AI Agents (with tools) | 4 GB | qwen3:8b |
| Classification & Analysis | 2 GB | gemma3:4b |
| Data Extraction (NER, PII) | 2 GB | gemma3:4b |
| Document Processing (OCR) | 4 GB | gemma3:4b + vision model |
| Embeddings & RAG | 2 GB | qwen3-embedding:0.6b + chat model |
| Speech & Audio | < 1 GB | whisper-large-turbo3 |
| Fine-Tuning | 8+ GB | Depends on base model |
| Multi-Agent Orchestration | 4 GB | qwen3:8b |
No GPU? Every sample works on CPU. Use smaller models (
gemma3:1b,qwen3:0.6b,phi4-mini:3.8b) for faster CPU inference. See Choosing the Right Model.
8. Platform & Integration Support
LM-Kit.NET fits into your existing .NET stack:
| Integration | What It Provides | Sample |
|---|---|---|
| Microsoft.Extensions.AI | IChatClient and IEmbeddingGenerator interfaces |
Extensions.AI Integration |
| Semantic Kernel | Use LM-Kit as a Semantic Kernel AI backend | Semantic Kernel Memory Demo |
| Model Context Protocol (MCP) | Connect to external tool servers | MCP Integration |
| Qdrant | External vector database for production RAG | Single-Turn RAG with Qdrant |
| OpenTelemetry | Distributed tracing and metrics | Telemetry & Observability |
| .NET MAUI | Cross-platform desktop and mobile apps | Chat Playground |
9. What's New
Recently added to the how-to guides:
- Build and Deploy an Offline AI Application for Edge Environments: model selection, backend configuration, and air-gapped deployment.
- Migrate from Cloud AI APIs to Local Inference with Microsoft.Extensions.AI: swap OpenAI or Azure for local inference without code changes.
- Process Email Archives for Compliance and Legal Discovery: ingest EML and MBOX files, detect PII, classify, and index.
- Build a Voice-Commanded Agent That Executes Tools: connect speech-to-text to an agent with web search and calculator tools.
- Build a Real-Time Document Monitoring and Indexing Agent: watch a folder, classify incoming documents, extract data, and build a searchable archive.
Explore all how-to guides: How-To Guides
10. Share & Get Involved
Found a sample useful? Use the share buttons below this article (copy link, X, LinkedIn, Reddit) to share it with your team.
⭐ Star the samples repo on GitHub · Report an issue · Contribute a sample