AI-PoweredLanguage Translation for .NET
Break language barriers with on-device AI translation. High-accuracy language detection, context-preserving translations, multimodal support, and 34+ languages. 100% local processing, zero cloud dependency.
Elevate Your .NET Apps with On-Device AI Translation
LM-Kit.NET brings cutting-edge AI-powered translation capabilities directly to your .NET applications. Break language barriers effortlessly with advanced Language Detection and Text Translation functionalities. By leveraging compact Large Language Models (LLMs) that run entirely on-device, LM-Kit ensures fast, secure, and private processing without the need for cloud services.
The TextTranslation class preserves the original layout and formatting of input content while processing and translating. Language detection supports plain text, images, and attachments, enabling multimodal translation workflows.
New in 2026: TranslatorAgentTemplate for building agentic translation workflows. Combine with planning strategies, tool integration, and multi-agent orchestration for sophisticated multilingual processing pipelines.
34+ Languages
Support for major world languages including CJK, RTL scripts, and European languages.
Multimodal Detection
Detect language from text, images, and document attachments with VLM integration.
Format Preservation
Maintain original layout, structure, and formatting during translation.
100% On-Device
Complete privacy with local inference. Your data never leaves your infrastructure.
Detect Languages with High Precision
Accurately identify the language of any text, image, or document. Process user inputs, sort multilingual content, and enhance search functionalities with confidence scoring.
Multimodal Language Detection Engine
LM-Kit's Language Detection engine allows you to accurately identify the language of any given content. Whether you're processing user inputs, sorting multilingual documents, or enhancing search functionalities, LM-Kit ensures your application understands and responds appropriately to multilingual content.
High Accuracy Detection
Advanced AI models detect languages with high confidence across a wide range of languages and dialects.
Confidence Scoring
Access detailed confidence scores for each detection to handle ambiguous cases effectively.
Async Processing
Choose between DetectLanguage() and DetectLanguageAsync() for optimal performance.
Customizable Language Sets
Specify target languages for detection to optimize performance for your use case.
using LMKit.Model; using LMKit.Translation; using LMKit.TextGeneration; // Load the language model var model = LM.LoadFromModelID("llama-3.2-1b"); var translator = new TextTranslation(model); // Detect language from text string text = "Bonjour, comment allez-vous?"; Language detected = translator.DetectLanguage(text); Console.WriteLine($"Detected: {detected}"); Console.WriteLine($"Confidence: {translator.Confidence:P1}"); // Detect from limited set for faster processing var candidates = new List<Language> { Language.English, Language.German, Language.French }; string germanText = "Guten Morgen!"; Language result = translator.DetectLanguage( germanText, candidates); // Output: German // Async detection var asyncResult = await translator .DetectLanguageAsync(text);
DetectLanguage(string, IEnumerable<Language>)
Synchronous language detection with optional candidate languages.
DetectLanguage(ImageBuffer, IEnumerable<Language>)
Detect language from image content using VLM.
DetectLanguage(Attachment, IEnumerable<Language>)
Detect language from document attachments.
Translate Text While Preserving Context
Seamlessly translate text between languages while maintaining original structure and formatting. Powered by sophisticated AI models for accurate, context-aware translations.
Context-Aware Translation Engine
LM-Kit's Text Translation engine empowers your applications to translate text between languages seamlessly. Maintain the original structure and formatting while providing accurate translations, enhancing user experience in multilingual environments.
Powered by sophisticated AI models and LM-Kit's proprietary technologies, the TextTranslation engine delivers exceptional performance. It supports a vast array of languages and scripts, enabling you to handle diverse translation tasks with ease.
-
Enhance Global Reach Break down language barriers to expand your application's global footprint.
-
Improve User Experience Provide content in users' preferred language, increasing engagement.
-
Automate Processing Streamline workflows by automating translation tasks.
-
Maintain Data Privacy On-device processing ensures sensitive data never leaves your infrastructure.
Translate(string, Language)
Synchronous translation preserving original layout and formatting.
TranslateAsync(string, Language)
Asynchronous translation for non-blocking operations.
using LMKit.Model; using LMKit.Translation; using LMKit.TextGeneration; // Load the language model var model = LM.LoadFromModelID("llama-3.2-1b"); var translator = new TextTranslation(model); // Translate French to English string french = @"Bonjour, comment vas-tu ? J'ai récemment lu un article fascinant sur l'impact de l'intelligence artificielle sur la littérature moderne. Qu'en penses-tu ?"; string english = translator.Translate( french, Language.English); Console.WriteLine(english); // "Hello, how are you? I recently read a // fascinating article about the impact of // artificial intelligence on modern literature. // What do you think?" // Async translation var result = await translator.TranslateAsync( french, Language.Spanish); // Event handling for completion translator.AfterTextCompletion += (s, e) => { Console.WriteLine($"Completed: {e.Text}"); };
34+ Supported Languages
Comprehensive language coverage including CJK scripts, RTL languages, and all major European languages.
TranslatorAgentTemplate
Build sophisticated translation workflows with the new agent framework.
Agentic Translation Workflows
The TranslatorAgentTemplate is part of LM-Kit's 18 pre-built agent templates. Combine translation capabilities with planning strategies, tool integration, and multi-agent orchestration for sophisticated multilingual processing pipelines.
Use with PipelineOrchestrator for sequential translation workflows, or ParallelOrchestrator for batch processing multiple documents simultaneously.
New in 2026using LMKit.Agents; using LMKit.Agents.Templates; // Create translator agent from template var agent = AgentTemplates .TranslatorAgentTemplate() .WithModel(model) .Build(); // Execute translation task var result = await agent.ExecuteAsync( "Translate to Japanese: Hello world"); Console.WriteLine(result.Output);
Text Translator Demo
Explore a working example demonstrating translation capabilities.
Text Translator Sample
The Text Translator Demo showcases how to utilize the LM-Kit.NET SDK for text translation tasks. This example demonstrates the integration of large language models into a .NET application to translate text across different languages, highlighting the versatility of advanced AI models in enabling multilingual communication.
Key Classes & Methods
Core components for building translation pipelines.
TextTranslation
Main class for text translation and language detection with sync and async methods.
View DocumentationLanguage
Enumeration defining all 34+ supported languages for translation and detection.
View DocumentationConfidence
Property returning the confidence score from the most recent language detection.
View DocumentationGetTrainingData
Retrieve training data for fine-tuning language detection models from built-in datasets.
View DocumentationReady to Build Multilingual Applications?
Break language barriers with on-device AI translation. 100% local, 100% your infrastructure.