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 |
| Analyze and navigate a codebase with AI |
Code Analysis Assistant |
| Generate and modify code files locally |
Code Writing 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 from contracts (text, PDF, or scanned images) |
Contract Key Terms Extractor |
| Detect and redact PII from documents |
PII Extraction |
| Permanently remove PII from PDFs (detect + redact) |
Smart Redaction |
| 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 |
| Parse PDFs and scans into typed elements (JSON, HTML, DocLang) |
Structured Document Parser |
| Export the data behind every chart as CSV |
Chart Data Harvester |
| Convert PDFs to archival PDF/A (ISO 19005) |
PDF to PDF/A Converter |
| Extract text and coordinates from images with OCR |
VLM OCR with Coordinates |
| Search text in a PDF or image and highlight matches |
Search and Highlight |
| Build a help desk knowledge base |
Help Desk Knowledge Base |
| Translate content between languages |
Text Translator |
| 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.
Legal & Compliance
Attorney-client privilege requires that documents stay within your infrastructure.
Also see the how-to guide: Process Email Archives for Compliance and Legal Discovery
Finance & Accounting
Regulatory requirements demand auditability and data sovereignty.
Manufacturing & Field Operations
Field devices and factory floors often have no internet access.
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.
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 · pgvector Integration
Document Processing Pipeline
Ingest documents, extract text and structure, convert formats, and index for search.
→ Structured Document Parser · Document to Markdown · VLM OCR · Search and Highlight · Document Splitting · Document Processing Agent · PDF Digital Signatures
Code Analysis & Generation
Equip a conversation with file system and web search tools to read, analyze, and write code through natural language.
→ Code Analysis Assistant · Code Writing Assistant
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.
Combine multiple features into real applications.
- Tool Calling Assistant: give the model tools to call.
- Code Analysis Assistant: read files and explore codebases with built-in tools.
- 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.
- Code Writing Assistant: read, create, and modify source files with built-in tools.
- 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
The catalogue below mirrors the LM-Kit.NET capability pillars and matches the on-disk layout under console_net/<pillar>/<category>/<sample>/. Pillar order follows the website navigation.
AI Agents
Chatbots
| Sample |
What It Demonstrates |
| Persona-Driven Chatbot |
AgentTemplates.Chat(model).WithPersonality(...) minimal loop |
Agent Templates
Permissions
Streaming
Resilience
| Sample |
What It Demonstrates |
| Resilience Policies |
Retry, circuit breaker, fallback, composite policies |
Agent Memory
Agent Reasoning
Agent Skills
Delegation
Filter Pipeline
| Sample |
What It Demonstrates |
| Filter Pipeline |
Middleware guardrails for agent conversations |
Graph Orchestration
MCP
Multi-Agent Workflows
Observability
Single Function Call
| Sample |
What It Demonstrates |
| Function Calling |
Register and invoke custom functions |
Document Intelligence
Document Parsing
Document RAG
| Sample |
What It Demonstrates |
| Document RAG |
Index a folder of mixed-format documents, chat with citations |
Chat with PDF
Layout Understanding
| Sample |
What It Demonstrates |
| Layout Understanding |
Lines, paragraphs, bounding boxes via VlmOcr + PageElement |
OCR
| Sample |
What It Demonstrates |
| OCR |
Single-image OCR via VlmOcr.Run |
Image Processing
Document Conversion
Smart Redaction
| Sample |
What It Demonstrates |
| Smart Redaction |
PiiExtraction + PdfRedactor: detect PII, review it with a human in the loop, then permanently remove it |
Email Processing
| Sample |
What It Demonstrates |
| Email Processing |
Convert .eml archives to Markdown for downstream pipelines |
Document Classification
Document Search
Document Splitting
Document Summarization
Document to Markdown
| Sample |
What It Demonstrates |
| Document to Markdown |
Universal document-to-Markdown engine (PDF, DOCX, PPTX, XLSX, EML, MSG, MBOX, HTML, images) |
Vision & Multimodal
Image Understanding
| Sample |
What It Demonstrates |
| Image Understanding |
Caption, describe, count, and reason about an image with a VLM |
Image Classification
Image Labeling
Chat with Image
Image Embeddings
VLM OCR
Background Removal
| Sample |
What It Demonstrates |
| Background Removal |
On-device transparent-background PNG output with the bundled U2-Net |
RAG & Knowledge
Embeddings
| Sample |
What It Demonstrates |
| Text Embeddings |
Vectorise a query and corpus, rank by cosine similarity |
Query Expansion
Reranker
| Sample |
What It Demonstrates |
| Reranker |
Cross-encoder rerank on top of embedding retrieval |
RAG Chat
Vector Database
Text Analysis
Content Classification
| Sample |
What It Demonstrates |
| Keyword Extraction |
Pull key terms from documents and images using VLMs |
Language Detection
Named Entity Recognition
Sentiment Analysis
Multimodal Embeddings
| Sample |
What It Demonstrates |
| Multimodal Embeddings |
Embed text and images into one aligned space (Nomic) for cross-modal search |
Speech & Audio
Real-Time Transcription
Voice Activity Detection
Audio Language Detection
| Sample |
What It Demonstrates |
| Audio Language Detection |
Identify spoken language before transcription, then pin it for accuracy |
Also see the how-to guide: Build a Voice-Commanded Agent That Executes Tools
Text Generation
Content Summarization
Conversations
Grammar & Spell Correction
| Sample |
What It Demonstrates |
| Text Corrector |
Grammar and spelling correction |
Prompt Templates
Structured Content Creation
Text Enhancement
| Sample |
What It Demonstrates |
| Text Rewriter |
Rewrite in different styles |
Text Translation
Local Inference
Model Catalog
| Sample |
What It Demonstrates |
| Model Catalog Browser |
Filter the predefined catalog by capability and load by ModelID |
Hardware Backends
Multi-GPU
Context Hibernation
| Sample |
What It Demonstrates |
| Context Hibernation |
Serialize the KV-cache to disk and rehydrate on next inference call |
Sampling Controls
Encrypted Models
Model Optimization
Fine-Tuning
| Sample |
What It Demonstrates |
| LoRA Fine-Tuning |
Train a local model on your own data and produce a GGUF adapter |
| Text-to-SQL Fine-Tuning |
Teach a model your database schema from a dataset file, then merge one deployable model |
| Vision Display Fine-Tuning |
Train a vision-language model to read seven-segment displays from labeled images |
Model Quantization
| Sample |
What It Demonstrates |
| Quantization |
Reduce model size for edge deployment |
LoRA Integration
| Sample |
What It Demonstrates |
| LoRA Adapter Hot-Swap |
Apply, list, and remove LoRA adapters on a loaded base model at inference time |
Integrations
Microsoft.Extensions.AI
Semantic Kernel
Also see the how-to guide: Migrate from Cloud AI APIs to Local Inference with Microsoft.Extensions.AI
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 |
6 GB |
gemma4:e4b |
| AI Agents (with tools) |
4 GB |
qwen3.5:9b |
| Classification & Analysis |
2 GB |
qwen3.5:2b |
| Data Extraction (NER, PII) |
2 GB |
qwen3.5:2b |
| Document Processing (OCR) |
6 GB |
gemma4:e4b + 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.5:9b |
No GPU? Every sample works on CPU. Use smaller models (qwen3.5:0.8b, qwen3.5:2b, phi4-mini:3.8b) for faster CPU inference. See Choosing the Right Model.
LM-Kit.NET fits into your existing .NET stack:
9. 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