Cross-Platform High-Level LLM Library

LlamaLib is a high-level C++ and C# library for running Large Language Models (LLMs) anywhere - from PCs to mobile devices and VR headsets.
At a glance
Why LlamaLib?
Developer API
- Direct implementation of LLM operations (completion, tokenization, embeddings)
- Clean architecture for services, clients, and agents
- Simple server-client setup with built-in SSL and authentication support
Universal Deployment
- The only library that lets you build for any hardware with runtime detection unlike alternatives limited to specific GPU vendors or CPU-only execution
- GPU backend auto-selection: Automatically chooses NVIDIA, AMD, Metal or switch to CPU
- CPU optimization: Identifies and uses optimal CPU instruction sets
Production Ready
- Embedded deployment: No need for open ports or external processes
- Small footprint: Compact builds ideal for PC or mobile deployment
- Battle-tested: Powers LLM for Unity, the most widely used LLM integration for games
How to help
- ⭐ Star the repo and spread the word!
- ❤️ Sponsor development or support with a

- 💬 Join our Discord community
- 🐛 Contribute with feature requests, bug reports, or pull requests
Projects using LlamaLib
- LLM for Unity: The most widely used solution to integrate LLMs in games
Quick Start
Documentation
Language Guides:
Core classes
LlamaLib provides three main classes for different use cases:
| Class | Purpose | Best For |
| LLMService | LLM backend engine | Building standalone apps or servers |
| LLMClient | Local or remote LLM access | Connecting to existing LLM services |
| LLMAgent | Conversational AI with memory | Building chatbots or interactive AI |
C++ Example
int main() {
llm.start();
std::string response = llm.completion("Hello, how are you?");
std::cout << response << std::endl;
return 0;
}
Main include file for the LLama library.
Runtime loader for LLM libraries.
📖 See the C++ guide for installation, building, and complete API reference.
C# Example
using LlamaLib;
class Program {
static void Main() {
llm.Start();
string response = llm.Completion("Hello, how are you?");
Console.WriteLine(response);
}
}
📖 See the C# guide for installation, NuGet setup, and complete API reference.
License
LlamaLib is licensed under the Apache 2.0.