51 lines
2.8 KiB
Markdown
51 lines
2.8 KiB
Markdown
# LiteLLM Dashboard for Android
|
|||
|
|
|
||
|
|
A native Android dashboard for a self-hosted LiteLLM proxy. Built with Kotlin and Jetpack Compose.
|
||
|
|
|
||
|
|
See [PROGRESS.md](PROGRESS.md) for completed work, remaining verification, and features not yet started.
|
||
|
|
|
||
|
|
## Features
|
||
|
|
|
||
|
|
- Connect with a proxy URL and bearer API key; the key is encrypted with Android Keystore and excluded from backups.
|
||
|
|
- Overview with total spend, request counts, a daily spend chart, and recent requests.
|
||
|
|
- Searchable model, key, and team inventories with detail views. Key search filters the current page; use page navigation for larger installations.
|
||
|
|
- Recent spend logs with request details and page navigation.
|
||
|
|
- Create models, virtual keys, and teams when the connected key has permission. Newly generated virtual keys are shown once and are not saved by the app.
|
||
|
|
- Explicit loading, empty, authentication, permission, and network error states.
|
||
|
|
|
||
|
|
The app follows the proxy's permissions. An inference-only key may show models but cannot access admin sections. Use an admin key or a management key with appropriate read/write routes. LiteLLM's database-backed management APIs must be enabled for key and team features. Model creation requires `store_model_in_db` on the proxy.
|
||
|
|
|
||
|
|
## Build
|
||
|
|
|
||
|
|
Open the root folder in Android Studio, or run on Windows:
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
./gradlew.bat :app:assembleDebug
|
||
|
|
adb install -r app/build/outputs/apk/debug/app-debug.apk
|
||
|
|
```
|
||
|
|
|
||
|
|
Requires JDK 17+, Android SDK platform 37, and an emulator/device running Android 8.0 or newer. The debug APK is at `app/build/outputs/apk/debug/app-debug.apk`.
|
||
|
|
|
||
|
|
## Connect
|
||
|
|
|
||
|
|
Enter the proxy base URL, for example `https://litellm.example.com`. Public addresses must use HTTPS. HTTP is accepted only for localhost, Android emulator host `10.0.2.2`, and private LAN addresses. Do not append `/ui` or an endpoint path. For a local proxy on the host, use `http://10.0.2.2:4000` from the standard Android emulator.
|
||
|
|
|
||
|
|
The app sends the key only in the `Authorization: Bearer` header. Disconnecting removes the stored connection. LiteLLM versions and deployment settings vary, so unsupported or forbidden endpoints appear as section-specific errors.
|
||
|
|
|
||
|
|
## Local emulator fixture
|
||
|
|
|
||
|
|
The fixture in `tools/mock_proxy.py` exercises the app without a real LiteLLM deployment:
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
python tools/mock_proxy.py
|
||
|
|
adb reverse tcp:8765 tcp:8765
|
||
|
|
```
|
||
|
|
|
||
|
|
Connect to `http://127.0.0.1:8765` with `sk-demo`. The fixture includes models, spend, keys, teams, logs, and creation responses. It is for development only.
|
||
|
|
|
||
|
|
## Sources
|
||
|
|
|
||
|
|
- [LiteLLM proxy API reference](https://docs.litellm.ai/api-reference)
|
||
|
|
- [LiteLLM spend tracking](https://docs.litellm.ai/docs/proxy/cost_tracking)
|
||
|
|
- [LiteLLM model management](https://docs.litellm.ai/docs/proxy/model_management)
|
||
|
|
- [Android Compose BOM](https://developer.android.com/develop/ui/compose/bom)
|