Kollama is a modern, desktop chat interface for Ollama models built with Kotlin and Jetpack Compose for Desktop. It provides a sleek, user-friendly way to interact with local AI models while offering advanced features like code formatting, markdown support, and animated UI elements.
- 🚀 Modern Desktop UI: Built with Compose for Desktop for a native, responsive experience
- 💬 Real-time Chat Interface: Smooth, chat-like interaction with AI models
- 🎨 Rich Markdown Support: Full markdown rendering including:
- Syntax-highlighted code blocks
- Tables
- Lists and task lists
- Blockquotes
- Headers and formatting
- 🔄 Advanced Message Handling:
- Real-time message streaming
- Message retry functionality
- Copy to clipboard support
- Message status indicators
- 💾 Persistent Storage: Local SQLite database for chat history using Room
- 🎯 Multiple Model Support: Switch between different Ollama models seamlessly
- 🎭 Dark/Light Theme: Automatic theme switching with animated transitions
- ✨ Polished UI Elements:
- Animated message borders
- Pulsating status indicators
- Smooth transitions and animations
- Responsive layout
https://drive.google.com/file/d/11_hz3-sKSTjTnqQ3wgwt7qI8EBqSQcwV/view?usp=sharing
- JDK 17 or higher
- Ollama installed and running on your machine, app uses tcp to communicate with Ollama
- At least one Ollama model downloaded
- Install Ollama following the instructions at Ollama's official website
- Pull at least one model using Ollama CLI:
ollama run deepseek-r1:1.5b
- Clone this repository:
git clone https://github.com/kashif-e/kollama.git
- Build and run using Gradle:
./gradlew run
Kollama follows clean architecture principles and is organized into the following layers:
- Presentation: Compose UI components and ViewModels
- Domain: Business logic and model definitions
- Data: Repository implementations and local database
- DI: Dependency injection using Koin
ChatViewModel
: Manages chat state and user interactionsOllamaService
: Handles communication with Ollama modelsChatDatabase
: Local storage using RoomMarkdownFormatting
: Custom markdown processing and formatting
- Room database for persistent storage
- Entities for chat sessions and messages
- Foreign key relationships for data integrity
- Custom composables for chat bubbles, model selection, and more
- Animated modifiers for enhanced visual feedback
- Markdown rendering with customizable typography
- Kotlin Flow for reactive state updates
- ViewModel for UI state management
- Coroutines for asynchronous operations
kollama/
├── data/
│ ├── local/
│ │ ├── dao/
│ │ └── database/
│ └── repository/
├── domain/
│ ├── model/
│ └── repository/
├── presentation/
│ ├── components/
│ ├── modifier/
│ ├── state/
│ └── theme/
└── di/
# Build the project
./gradlew build
# Run the application
./gradlew run
# Create distribution
./gradlew createDistribution
Configure Ollama model settings in OllamaService.kt
:
fun setGpuLayers(layers: Int)
fun setCudaDevices(devices: String)
fun setMaxRamUsage(ramMb: Int)
fun setMaxGpuMemory(memoryMb: Int)
- Modify themes in
theme
package - Customize markdown styles in
rememberMarkdownTypography
- Adjust animations in
AnimatedModifier.kt
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request