PocketLLM is a cross-platform assistant that pairs a Flutter application with a FastAPI backend to deliver secure, low-latency access to large language models. Users can connect their own provider accounts, browse real-time catalogues, import models, and chat across mobile and desktop targets with a shared experience.
IMPORTANT NOTICE β PLEASE READ BEFORE PROCEEDING
π§ Development of this application has been temporarily halted by the original author (me). This project is NOT abandoned, but it is not actively maintained or receiving updates at this time.
If someone has forked or continued this project, feel free to use their version instead.
Work is currently focused on PocketLLM Lite and Mugshot Studios both open-source and actively developed. This project may be resumed in the future.
PocketLLM focuses on three pillars:
- Unified catalogue β aggregate models from OpenAI, Groq, OpenRouter, and ImageRouter using official SDKs with per-user API keys.
- Bring your own keys β users activate providers securely; secrets are encrypted at rest and never fall back to environment credentials.
- Consistent chat experience β Flutter renders the same responsive interface on Android, iOS, macOS, Windows, Linux, and the web.
The backend exposes REST APIs that the Flutter client consumes. A Supabase instance stores provider configurations, encrypted secrets, and chat history.
| Area | Highlights |
|---|---|
| Model management | Dynamic /v1/models endpoint returns live catalogues with helpful status messaging when keys are missing or filters remove all results. Users can import, favourite, and set defaults. |
| Provider operations | Granular activation flows validate API keys with official SDKs, support base URL overrides, and expose a status dashboard. |
| Chat experience | Streaming responses, Markdown rendering, inline code blocks, and token accounting. |
| Security | Secrets encrypted using Fernet + project key, strict error messages when configuration is incomplete, and no environment fallback for user operations. |
| Observability | Structured logging across services and catalogue caching with per-provider metrics. |
| Onboarding & referrals | Invite-gated signup, /v1/waitlist applications, backend-validated invite codes, and a Flutter referral center for sharing codes and tracking rewards. |
PocketLLM
βββ lib/ # Flutter client (Riverpod, GoRouter, Material 3)
β βββ component/ # Shared widgets and UI primitives
β βββ pages/ # Screens including Library, API Keys, Chat
β βββ services/ # State management, API bridges, secure storage
βββ pocketllm-backend/ # FastAPI application
β βββ app/api/ # Versioned routes (/v1)
β βββ app/services/ # Provider catalogue, auth, jobs, models
β βββ app/utils/ # Crypto helpers, security utilities
β βββ database/ # Dataclasses mirroring Supabase tables
βββ docs/ # Operational guides and API references
| Component | Requirement |
|---|---|
| Flutter | 3.19.6 (see AGENTS.md setup script) |
| Dart | Included with Flutter SDK |
| Python | 3.11+ for FastAPI backend |
| Node / pnpm | Optional for tooling around Supabase migrations |
| Supabase | Service-role key and project URL configured in .env |
cd pocketllm-backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # configure Supabase credentials and ENCRYPTION_KEY
uvicorn main:app --reloadKey endpoint: GET /v1/models
GET /v1/models
Authorization: Bearer <JWT>
{
"models": [
{
"provider": "openai",
"id": "gpt-4o",
"name": "GPT-4 Omni",
"metadata": {"owned_by": "openai"}
}
],
"message": null,
"configured_providers": ["openai"],
"missing_providers": ["groq", "openrouter", "imagerouter"]
}When no API keys are stored the endpoint responds with an empty models array and a descriptive message, enabling the Flutter UI to prompt users to add credentials.
cd ..
flutter pub get
flutter run # chooses a connected device or emulatorThe API Keys page surfaces provider status, preview masks, and validation results. The Model Library consumes the unified /v1/models response and displays grouped catalogues with filtering options.
| Layer | Command |
|---|---|
| Flutter | flutter analyze && flutter test |
| Backend | cd pocketllm-backend && pytest |
Note: Some integration suites stub external SDKs; install
openai,groq, andopenrouterpackages locally for full coverage.
docs/api-documentation.mdβ REST endpoints and schemas.docs/backend-guide.mdβ Environment variables, Supabase integration, and deployment playbooks.docs/groq-guide.mdβ Official SDK usage for catalogue, chat, audio, and reasoning APIs.docs/frontend_cleanup_tasks.mdβ Outstanding UI refinements.
Contributions are welcome! Please review CONTRIBUTING.md and ensure:
- New features include unit or widget tests.
- Backend changes run through
pytestwith optional SDKs installed. - Documentation and changelogs reflect API or workflow updates.
- Secrets and API keys are never committed.
PocketLLM is released under the MIT License.
Have questions or ideas? Open an issue or join the discussion β weβd love to hear how you are using PocketLLM.