How krishbaidya/llamarun works
Llama Run is a Windows desktop AI assistant: users choose a model, submit a prompt, and receive generated text in the main window. The AI service manager selects cloud or local Ollama generation; cloud generation also contains MCP tool-call handling. Separate workflows cover first-run and settings, MCP server discovery and management, and Python plugin loading/event dispatch through a native CPython/WinRT bridge. The README documents MCP support and describes Python plugins as in progress. Some UI-to-subsystem wiring is not shown in the excerpts, so those links are omitted or marked unverified.
Main entry points: AIServiceManager.cs AI service manager · OllamaService.cs Local generation · DataStore.cs Application state · AvaliableMCPServers.xaml.cs Server discovery
Components 29
Desktop app
- App lifecycle
LlamaRun/App.xaml.cs - Main window
LlamaRun/MainWindow.xaml.cs - First-run setup
LlamaRun/FirstRunWindow.xaml.cs - App settings
LlamaRun/SettingsWindow.xaml.cs
AI generation
- AI service manager
LlamaRun/AIServiceManager.cs - Cloud generation
LlamaRun/CloudLLMService.cs - Local generation
LlamaRun/OllamaService.cs - Model catalog
LlamaRun/Models.cs - Ollama unavailable
LlamaRun/ShowOllamaUnavaliableWindow.cs
MCP servers
- Server discovery
LlamaRun/MCPServers/AvaliableMCPServers.xaml.cs - Installed servers
LlamaRun/MCPServers/InstalledMCPServers.xaml.cs - Server details
LlamaRun/MCPServers/MCPServerDetailsPage.xaml.cs - Server configuration
LlamaRun/MCPServers/EnvironmentConfigDialog.xaml.cs - Install preview
LlamaRun/MCPServers/ServerInstallPreviewDialog.xaml.cs - Server readme
LlamaRun/MCPServers/SimpleReadmeViewer.xaml.cs - MCP server model
LlamaRun/MCPServers/MCPServer.cs - MCP server data
LlamaRun/MCP_Server.cs
Python plugins
- Plugin settings UI
LlamaRun/PluginPage_SettingsWindow.xaml.cs - Installed plugins UI
LlamaRun/InstalledPluginsPage.xaml.cs - Plugin interop API
CPythonIntrop/PluginManagerIntrop.cpp - Plugin manager
CPythonIntrop/PluginManager.h - Plugin instance
CPythonIntrop/Plugin.h - Plugin definition
CPythonIntrop/PluginDef.h
Shared state
- Application state
LlamaRun/DataStore.cs - Service endpoints
LlamaRun/Constants.cs
Other components
- User
- Cloud LLM provider
- Ollama service
- MCP directory
Connections 27
- User → App lifecycle: launches
LlamaRun/App.xaml.cs - App lifecycle → First-run setup: opens first run
LlamaRun/App.xaml.cs - App lifecycle → Main window: opens main
LlamaRun/App.xaml.cs - Main window → AI service manager: requests generation
LlamaRun/MainWindow.xaml.cs - AI service manager → Cloud generation: dispatches cloud
LlamaRun/AIServiceManager.cs - AI service manager → Local generation: dispatches local
LlamaRun/AIServiceManager.cs - AI service manager → Model catalog: checks models
LlamaRun/AIServiceManager.cs - AI service manager → Application state: stores models
LlamaRun/AIServiceManager.cs - Cloud generation → Application state: reads settings
LlamaRun/CloudLLMService.cs - Cloud generation → Cloud LLM provider: sends requests
- Local generation → Ollama service: generates locally
LlamaRun/OllamaService.cs - Local generation → Ollama unavailable: shows unavailable
LlamaRun/OllamaService.cs - Local generation → AI service manager: updates output
LlamaRun/OllamaService.cs - App settings → Application state: loads and saves
LlamaRun/DataStore.cs - Server discovery → Service endpoints: uses endpoints
LlamaRun/MCPServers/AvaliableMCPServers.xaml.cs - Server discovery → MCP directory: discovers servers
- Installed servers → Application state: reads state
LlamaRun/MCPServers/InstalledMCPServers.xaml.cs - Server details → Service endpoints: uses endpoints
LlamaRun/MCPServers/MCPServerDetailsPage.xaml.cs - Server discovery → Install preview: previews install
- Server details → Server configuration: configures server
- Server details → Server readme: shows readme
- Installed servers → MCP server model: displays servers
- Plugin interop API → Plugin manager: forwards calls
CPythonIntrop/PluginManagerIntrop.cpp - Plugin manager → Plugin instance: creates and dispatches
CPythonIntrop/PluginManager.h - Plugin manager → Plugin definition: registers Python module
- Plugin settings UI → Plugin interop API: manages plugins
- Installed plugins UI → Plugin interop API: lists plugins