This repository is a simple demo for how to use llama.cpp server and mobile application with SmolVLM 500M to get real-time object detection
- Install llama.cpp
- Run
llama-server -hf ggml-org/SmolVLM-500M-Instruct-GGUF --host 0.0.0.0 --port 8080
Note: you may need to add-ngl 99to enable GPU (if you are using NVidia/AMD/Intel GPU)
Note (2): You can also try other models here - Run
ifconfig | grep "inet"to get the LAN (Wi-Fi) address Example: inet 127.0.0.1 netmask 0xff000000 inet 192.168.0.244 netmask 0xffffff00 broadcast 192.168.0.255 - Run KMP App project (eg. Android)
- Optionally change the instruction (for example, make it returns JSON)
- Click on "Start" and enjoy
- Install Termux from Google Play
- pkg update && pkg upgrade
- pkg install cmake clang make git wget
- git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp
- mkdir build cd build cmake .. cmake - -build . - -config Release
- ./bin/llama-server -hf ggml-org/SmolVLM-500M-Instruct-GGUF
git clone <repository-url>
cd kmp-llama
# Android
./gradlew :composeApp:installDebug
# Desktop
./gradlew :composeApp:run
# iOS
open iosApp/iosApp.xcodeproj{
"server_url": "http://192.168.0.244:8080",
"endpoint": "/v1/chat/completions",
"format": "OpenAI-compatible"
}VisionRequest(
model = "smolvlm",
messages = [
Message(
role = "user",
content = [
Content(type = "text", text = "What do you see?"),
Content(type = "image_url",
imageUrl = ImageUrl("data:image/jpeg;base64,..."))
]
)
]
)| Platform | UI | Camera | API | Status |
|---|---|---|---|---|
| Android | ✅ | ✅ CameraX | ✅ Ktor | Complete |
| iOS | ✅ | 🔄 AVFoundation | ✅ Ktor | UI Ready |
| Desktop | ✅ | 🔄 Webcam | ✅ Ktor | UI Ready |
- iOS camera implementation with AVFoundation
- Desktop webcam integration
- Image gallery and history
- Offline model support
- Multi-model support (GPT-4V, Claude Vision)
- Voice commands and audio responses
- Real-time object tracking
- AR overlay integration
- Cloud sync and sharing
- mobile local LLM (inspired by https://github.com/a-ghorbani/pocketpal-ai)
- Fork the repository
- Create 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
This project is licensed under the MIT License - see the LICENSE file for details.
Please use this bibtex if you want to cite this repository in your publications:
@misc{kmpllama,
author = {Sholichin, Fauzi},
title = {KMP-Llama: SmolVLM Camera App},
year = {2025},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/fauzisho/kmp-llama}},
}
Built with ❤️ using Kotlin Multiplatform

