LangMate

Build & Publish NuGet Packages License: MIT Language GitHub Repo stars NuGet


LangMate is a modular and extensible AI chat application and SDK platform built with .NET 9 and fully compatible with .NET Aspire.
It provides a Blazor-powered Web UI, Ollama model integrations, persistent chat history via MongoDB, and a flexible SDK for .NET developers to integrate and use local LLMs (like Gemma, LLaMA2, Mistral) easily and securely.


🌟 Key Features


🧠 Architecture

LangMate/
β”œβ”€β”€ Apps/
β”œβ”€β”€β”€β”€ LangMate.AppHost.AppHost        β†’ .NET Aspire for orchestrating and deploying the apps on Docker, Kubernetes, or any other cloud platform.
β”œβ”€β”€β”€β”€ LangMate.AppHost.BlazorUI        β†’ Blazor ChatBot UI sample project using LangMate SDK
β”œβ”€β”€β”€β”€ LangMate.AppHost.ApiService        β†’ Web API sample project using LangMate SDK
β”œβ”€β”€ SDK/
β”œβ”€β”€β”€β”€ LangMate.Core               β†’ Reusable .NET SDK to interact with Ollama
β”œβ”€β”€β”€β”€ LangMate.Middleware         β†’ Polly-based Resiliency Middleware (retry, timeout, circuit breaker)
β”œβ”€β”€β”€β”€ LangMate.Extensions         β†’ Utilities, helpers and extension methods
β”œβ”€β”€β”€β”€ LangMate.Persistence        β†’ MongoDB chat history, caching layer, repositories and configuration

πŸ“¦ Installation

Prerequisites

Run the App

git clone https://github.com/raminesfahani/LangMate.git
cd LangMate/src/apps/LangMate.AppHost.AppHost

# Restore dependencies and build
dotnet restore
dotnet build

# Run the .NET Aspire Dashboard
dotnet run

Then open https://localhost:17198/ in your browser to see the .NET Aspire dashboard. You can launch Blazor ChatBot or Web API apps over there by their own links.


LangMate.Core SDK

LangMate.Core is a lightweight, extensible .NET SDK designed to make working with Ollama-powered local AI models seamless and developer-friendly. It abstracts away the complexity of managing conversations, interacting with Ollama endpoints, and persisting chat history β€” all while offering resiliency, caching, and extensibility.

πŸ“¦ Installation

To use LangMate.Core, install the required NuGet package NuGet, or include the project reference in your solution.

dotnet add package LangMate.Core

βœ… Sample Usage

You can see Full Documentation and sample usage in this link as well.


🧠 LangMate Blazor Chat UI

The LangMate Blazor App is an intelligent, real-time chat UI built with Blazor Server and integrated with the powerful local AI models provided by Ollama using LangMate.Core SDK.

It provides a complete frontend experience for interacting with AI models, managing chat history, uploading files, and dynamically updating chat state.

✨ Features

Screenshots

LangMate Blazor Chat UI - Home Page


LangMate Blazor Chat UI - Chat user interface


LangMate Blazor Chat UI - Sample chat

πŸ“‘ LangMate WebAPI

The LangMate API Service is the backend layer of the LangMate system, exposing RESTful HTTP APIs for external integration, orchestration, and automation.

It serves as a stateless gateway for interacting with the LangMate core functionalities β€” such as chat sessions, file uploads, model management, and streaming chat completions β€” powered by the LangMate.Core SDK and Ollama.

✨ Features


LangMate Web API documentation

πŸ› οΈ Build and Test

dotnet build --configuration Release
dotnet test

πŸ“¬ Contributing

Contributions are welcome!

  1. Fork the repo and create your branch
  2. Implement your feature or fix
  3. Submit a PR with proper context

πŸ“„ License

Licensed under the MIT License.


πŸ“£ Contact

Created and maintained by @raminesfahani.
For issues and features, open a GitHub Issue.


πŸ™ Acknowledgements

This project uses the Ollama repository for local AI model integration. I am thankful to the maintainers and contributors of Ollama for making this technology available.