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. Built with modern Android development practices using Kotlin, Jetpack Compose, and MVVM architecture.
- 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
- 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/it5prasoon/MultiGPT.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, create app/src/main/res/values/ad_mob_config.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="admob_app_id">your_admob_app_id</string>
<string name="home_banner">your_banner_ad_id</string>
<string name="setup_complete_interstitial">your_interstitial_ad_id</string>
</resources>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
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 MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [email protected]
Note: This is an open source project. For user-facing documentation and app features, see SUPPORT.md.





