https://github.com/yassineabou/llms
Discover the power of AI with our Kotlin Multiplatform app. Choose from the latest open-source text and image models to boost your creativity. Pick the model that fits you, create unique texts or images.
https://github.com/yassineabou/llms
ai-horde android compose-multiplatform ios kotlin kotlin-multiplatform kotlin-wasm linux llms macos windows
Last synced: 5 months ago
JSON representation
Discover the power of AI with our Kotlin Multiplatform app. Choose from the latest open-source text and image models to boost your creativity. Pick the model that fits you, create unique texts or images.
- Host: GitHub
- URL: https://github.com/yassineabou/llms
- Owner: yassineAbou
- License: apache-2.0
- Created: 2024-08-22T20:32:07.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-17T01:48:31.000Z (about 1 year ago)
- Last Synced: 2025-04-17T15:23:37.687Z (about 1 year ago)
- Topics: ai-horde, android, compose-multiplatform, ios, kotlin, kotlin-multiplatform, kotlin-wasm, linux, llms, macos, windows
- Language: Kotlin
- Homepage: https://yassineabou.github.io/LLMs-Wasm/
- Size: 3.73 MB
- Stars: 20
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
LLMS

Discover the power of AI with our Kotlin Multiplatform app. Choose from the latest open-source text and image models to boost your creativity. Pick the model that fits you, create unique texts or images. and keep everything safe and in sync across your devices.
### π How to Run
You can run the application for **Android**, **Desktop**, **WebAssembly**, and **iOS** directly from your IDE.
1. Open the project in **Android Studio** or **IntelliJ IDEA**.
2. Select your desired run configuration from the dropdown menu (e.g., `composeApp`, `desktopRun`, `iosApp`).
3. Click the **Run βΆοΈ** button.
*For **iOS**, you can alternatively open the `iosApp` folder in **Xcode** and run it from there.*
## π¨ Demo
https://github.com/user-attachments/assets/af1903df-139f-4178-8fcb-c3d7c7b46219
https://github.com/user-attachments/assets/46d00b90-6df8-484c-bfd6-f38c65ad85d9
https://github.com/user-attachments/assets/62ad62f5-a80a-4ac0-b8a7-f0707a45a249
## π Progress
Our development process is divided into five key steps:
#### 1. Prototype with Fake Data π§
- Status: π― Done
#### 2. Connect with AI REST API (Text Models) π
- Status: π― Done
#### 3. Connect with AI REST API (Image Models) πΌοΈ
- Status: π― Done
#### 4. Save Chat History & Generated Images Locally πΎ
- Status: π― Done
#### 5. Sync Data Across Devices with Authentication π
- Status: π in progress
## ποΈ Architecture
- **User Interface**:
Uses [Compose multiplatfrom](https://www.jetbrains.com/lp/compose-multiplatform/).
- **Layers**: All data handling, business logic, and presentation layers are implemented
using [kotlin multiplatform](https://www.jetbrains.com/kotlin-multiplatform/)
- **backend**: The backend is developed using [Ktor framework](https://ktor.io/).
## π¦ Libraries
- [Material 3 Adaptive](https://www.jetbrains.com/help/kotlin-multiplatform-dev/whats-new-compose-170.html#across-platforms) (creates adaptive UIs that will adapt themselves automatically)
- [Compose Navigation](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-navigation-routing.html) (Navigates between composables with built-in infrastructure and features)
- [Kodein](https://github.com/kosi-libs/Kodein) (Painless Kotlin Dependency Injection)
- [Coroutines](https://github.com/Kotlin/kotlinx.coroutines) (asynchronous or non-blocking)
- [Sketch](https://github.com/panpf/sketch) (Image loading)
- [Ktor Client](https://ktor.io/docs/full-stack-development-with-kotlin-multiplatform.html) (HTTP client)
- [Markdown renderer](https://github.com/mikepenz/multiplatform-markdown-renderer) (Markdown renderer)
- [Drag Select](https://github.com/jordond/drag-select-compose) (adding Google Photos style drag-to-select multi-selection to a LazyGrid)
- [SQLDelight](https://sqldelight.github.io/sqldelight/2.1.0/) (SQLDelight generates typesafe Kotlin APIs from your SQL statements.)
- [KotlinMultiplatformAuth](https://github.com/sunildhiman90/KotlinMultiplatformAuth) (Authentification Library Targeting Android, iOS, Desktop and Web Kotlin/Js and Kotlin/Wasm both)
- [kotlinx-rpc](https://github.com/Kotlin/kotlinx-rpc) (is a Kotlin library for adding asynchronous Remote Procedure Call (RPC) services to your applications)
- [Exposed](https://github.com/JetBrains/Exposed) (Kotlin SQL Framework)
## Package Structure
```
LLMS/
βββ composeApp/ # Main application module for the UI, built with Compose Multiplatform
β βββ src/
β βββ org/yassineabou/llms/app/
β β βββ App.kt
β β βββ MainScreen.kt
β β βββ core/
β β β βββ data/
β β β β βββ async/
β β β β βββ local/
β β β β βββ remote/
β β β βββ di/
β β β βββ navigation/
β β β βββ sharedViews/
β β β βββ theme/
β β β βββ util/
β β βββ feature/
β β βββ chat/
β β β βββ data/model/
β β β βββ ui/
β β β βββ chat/
β β β βββ history/
β β β βββ listDetailPane/
β β β βββ view/
β β βββ imagine/
β β β βββ data/model/
β β β βββ ui/
β β β βββ supportingPane/
β β β βββ util/
β β β βββ view/
β β βββ you/
β β βββ model/
β β βββ ui/
β β βββ util/
β β βββ view/
β βββ sqldelight/org/yassineabou/llms/ # SQLDelight source files defining the local database schema
β
βββ server/ # Backend server module, using Ktor, handling API requests and database interactions.
β βββ src/
β βββ org/yassineabou/llms/
β βββ Application.kt
β βββ Environment.kt
β βββ database/
β βββ tables/
β βββ di/
β βββ repository/
β βββ service/
β βββ DatabaseFactory.kt
β
βββ shared/ # Shared API contract and data models, enabling type-safe communication between compose and server module.
βββ src/
βββ org/yassineabou/llms/api/
βββ ChatService.kt
βββ ImageService.kt
βββ MessageService.kt
βββ UserService.kt
βββ Constants.kt
βββ Platform.kt
```
## π΅π΄π‘π’ Google Authentication Setup
This project supports Google Authentication for data syncing across devices (part of Step 5 in Progress). Keys and sensitive files (e.g., `google-services.json`, `GoogleService-Info.plist`) are hidden and not committed to GitHub for security. To enable real Google auth after cloning the repo, follow these platform-specific steps. We've included fake data in the code (e.g., in `commonMain/YouViewModel.kt`) for testing without setupβuncomment the real auth code when ready.
If you are confused in the process, watch this video: [https://youtu.be/-5Ws4HSaYJc?si=uHhDbmnhC7GBZEL3](https://youtu.be/-5Ws4HSaYJc?si=uHhDbmnhC7GBZEL3).
### General Steps
1. Go to the [Firebase Console](https://console.firebase.google.com/).
2. Create a new Firebase project (or select an existing one).
3. Enable **Authentication** β **Sign-in method** β **Google**.
4. For multiplatform support, also go to [Google Cloud Console β APIs & Services β Credentials](https://console.cloud.google.com/apis/credentials) to create OAuth 2.0 Client IDs as needed.
### Compose App
1. In Firebase, click βAdd appβ β **Android**.
2. Register your package name (e.g., `com.yassineabou.llms`), add SHA-1 fingerprints (debug/release).
3. Download `google-services.json`.
4. Replace the placeholder in `composeApp/google-services.json` with your file.
5. In Google Cloud Console, create an βAndroidβ OAuth Client ID with the same package name and SHA-1.
6. In `androidMain/MainActivity.kt`, uncomment the init code for `KMAuthInitializer`.
7. In `commonMain/YouViewModel.kt` and `commonMain/App.kt`, uncomment the Google auth-related code.
8. Sync Gradle and rebuild.
### iOSMain Module
1. In Firebase, click βAdd appβ β **iOS**.
2. Register your bundle ID, App Store ID (optional), and nickname.
3. Download `GoogleService-Info.plist`.
4. Replace the placeholder in `iosApp/GoogleService-Info.plist` with your file.
5. Drag it into Xcode (check βCopy items if neededβ).
6. Add the Google Sign-In SDK via Xcode: `File` β `Add Packagesβ¦` β URL: `https://github.com/google/GoogleSignIn-iOS` β Add **GoogleSignIn** to your target.
7. In `iosApp/Info.plist`, uncomment and paste:
- `GIDClientIDPASTE CLIENT_ID FROM GoogleService-Info.plist HERE`
- For `CFBundleURLTypes`, add the `` with `CFBundleURLSchemesPASTE REVERSED_CLIENT_ID FROM GoogleService-Info.plist HERE`.
### Desktop/WebAssembly (desktopMain Module and commonMain)
1. In Google Cloud Console, create a βWeb applicationβ OAuth Client ID.
2. Add authorized redirect URIs (e.g., `http://localhost:8080/callback`).
3. Copy the generated `CLIENT_ID` and `CLIENT_SECRET`.
4. Paste them into `commonMain/GoogleOAuthConfig.kt` (replace the empty constants).
5. In `desktopMain/main.kt`, uncomment the init code for `KMAuthInitializer.initClientSecret`.
6. In `commonMain/App.kt` and `commonMain/YouViewModel.kt`, uncomment the Google auth-related code.
## π€ Contribution
We welcome contributions to our project! Please follow these guidelines when submitting changes:
- Report bugs and feature requests by creating an issue on our GitHub repository.
- Contribute code changes by forking the repository and creating a new branch.
- Ensure your code follows our coding conventions.
- Improve our documentation by submitting changes as a pull request.
Thank you for your interest in contributing to our project!
## π License
```
Copyright 2025 Yassine Abou
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.