A native Android app for chatting with multiple AI models simultaneously.
MultiGPT allows users to communicate with multiple AI providers (OpenAI, Anthropic, Google, Groq, AWS Bedrock, Ollama) within a single conversation interface β plus on-device local inference powered by llama-kotlin-android. Built with modern Android development practices using Kotlin, Jetpack Compose, and MVVM architecture.
| Getting Started | Provider Selection | Provider Config |
|---|---|---|
![]() |
![]() |
![]() |
| Chat List | Chat with Agent | Chat Prompt |
|---|---|---|
![]() |
![]() |
![]() |
| Local Provider | Settings |
|---|---|
![]() |
![]() |
- Pattern: MVVM with Clean Architecture
- UI Framework: Jetpack Compose with Material Design 3
- Dependency Injection: Hilt
- Database: Room with SQLite
- Preferences: DataStore
- Networking: Ktor HTTP client
- Async: Kotlin Coroutines and Flow
app/src/main/kotlin/com/matrix/multigpt/
βββ data/ # Data layer
β βββ database/ # Room database entities and DAOs
β βββ datastore/ # DataStore preferences
β βββ dto/ # Data transfer objects for APIs
β βββ model/ # Domain models
β βββ network/ # API client implementations
β βββ repository/ # Repository implementations
βββ di/ # Hilt dependency injection modules
βββ presentation/ # UI layer
β βββ common/ # Shared UI components
β βββ theme/ # Material Design 3 theming
β βββ ui/ # Feature-specific UI screens
βββ util/ # Utility classes and extensions
localinference/src/main/kotlin/com/matrix/multigpt/localinference/
βββ data/ # Model catalog, downloads, storage
βββ di/ # Hilt module for local inference
βββ presentation/ # Model selection UI
βββ service/ # Inference engine & conversation summarizer
βββ LocalInferenceProvider.kt # Provider integration
MultiGPT supports fully offline AI inference directly on your Android device β no API keys, no internet, complete privacy.
The localinference module uses llama-kotlin-android to run GGUF models natively on-device via llama.cpp:
- Browse & download models from a curated catalog (fetched from Firebase)
- Run inference locally with streaming token generation
- Conversation summarization to manage context within device memory limits
- No API key required β works completely offline after model download
| Model | Size | Best For |
|---|---|---|
| Phi-3.5-mini | ~2.4GB | General assistant |
| TinyLlama-1.1B | ~670MB | Low-end devices |
| Qwen2.5-1.5B | ~1GB | Coding, reasoning |
| Llama-3.2-3B | ~2GB | High quality chat |
- Android 12+ (API 31)
- 4GB+ RAM recommended
- arm64-v8a architecture
- Android Studio Hedgehog (2023.1.1) or newer
- Android SDK 34+ (API level 34)
- Kotlin 1.9+
- JDK 17+
-
Clone the repository
git clone https://github.com/CodeShipping/Multi-GPT.git cd MultiGPT -
Open in Android Studio
- Import the project into Android Studio
- Let Gradle sync complete
-
Build and Run
./gradlew assembleDebug ./gradlew installDebug
If building from source, you can add your own google-services.json for Firebase integration:
- Create a Firebase project at Firebase Console
- Download
google-services.json - Place it in
app/directory
For ads, copy the example config and replace with your real IDs:
cp ad_mob_config.xml.example app/src/main/res/values/ad_mob_config.xmlThen edit ad_mob_config.xml with your AdMob unit IDs. The example file uses Google's test IDs which are safe for development.
The app integrates with multiple AI providers through their REST APIs:
- OpenAI: GPT-4o, GPT-4o mini, GPT-4 Turbo, GPT-4
- Anthropic: Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku
- Google: Gemini 1.5 Pro, Gemini 1.5 Flash, Gemini 1.0 Pro
- Groq: Llama 3.1, Llama 3.2, Gemma 2
- AWS Bedrock: Multiple foundation models from various providers
- Ollama: Local AI models via self-hosted API
- Local Inference π: On-device models via llama-kotlin-android β no internet required
The app automatically discovers available models from each provider:
- Fetches current model lists via API
- Falls back to curated lists if fetching fails
- Supports custom model names for advanced users
interface AIProviderAPI {
@POST("v1/chat/completions")
suspend fun createCompletion(
@Body request: CompletionRequest
): CompletionResponse
}
// Implementation example
@Singleton
class OpenAIAPIImpl @Inject constructor(
private val httpClient: HttpClient
) : OpenAIAPI {
// API implementation
}- ChatRoom: Conversation metadata and enabled AI providers
- Message: Individual messages with provider attribution
@Database(
entities = [ChatRoom::class, Message::class],
version = 1
)
abstract class ChatDatabase : RoomDatabase() {
abstract fun chatRoomDao(): ChatRoomDao
abstract fun messageDao(): MessageDao
}- All conversations stored locally using Room database
- API keys encrypted using DataStore with encryption
- No data transmitted to external servers except AI providers
// Secure storage implementation
class SettingDataSourceImpl @Inject constructor(
private val dataStore: DataStore<Preferences>
) {
suspend fun updateToken(apiType: ApiType, token: String) {
dataStore.edit { preferences ->
preferences[apiTokenMap[apiType]!!] = token
}
}
}# Unit tests
./gradlew test
# Instrumented tests (requires device/emulator)
./gradlew connectedAndroidTest
# Test coverage
./gradlew jacocoTestReportapp/src/test/kotlin/com/matrix/multigpt/
βββ data/
β βββ repository/ # Repository tests
βββ presentation/ # ViewModel tests
The project uses GitHub Actions for continuous integration:
- CodeQL Security Analysis: Automated vulnerability scanning
- Debug Builds: APK generation for pull requests
- Release Builds: Signed APK/AAB generation
- Code Quality: Kotlin linting with ktlint
codeql.yml: Security analysisdebug-build.yml: Debug APK generationrelease-build.yml: Release builds with signingktlint.yml: Code formatting checks
The app supports multiple languages through Android's localization system:
values/strings.xml- Default (English)values-ar/strings.xml- Arabicvalues-zh-rCN/strings.xml- Chinese (Simplified)values-ko-rKR/strings.xml- Korean- And more...
Please read CONTRIBUTING.md for development guidelines and CODE_OF_CONDUCT.md for community standards.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a pull request
- Follow Kotlin Coding Conventions
- Use ktlint for formatting
- Write KDoc comments for public APIs
- Include unit tests for new features
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
This project is inspired by and builds upon concepts from GPT Mobile by Taewan Park, which is also licensed under GPL-3.0. See THIRD_PARTY_LICENSES.md for complete attribution and license information.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@codeshipping.org
Note: This is an open source project. For user-facing documentation and app features, see SUPPORT.md.







