A clean AI chat app for Windows and Android, built with Flutter. Bring your own API key for Claude, ChatGPT, DeepSeek, Gemini, OpenRouter, Groq, or any OpenAI-compatible server (Ollama, LM Studio, vLLM).
Get the latest build from the Releases page:
- Android: download
Chatbot-android.apkon your phone and open it. Allow "Install unknown apps" for your browser when asked.Chatbot-android-x86_64.apkis only for emulators and Intel Chromebooks. - Windows: download
Chatbot-windows-x64.zip, unzip it, and runai_chatbot.exeinside the folder. Keep the other files next to it. The exe is unsigned, so if SmartScreen warns, choose More info → Run anyway.
No GitHub Actions? Build the APK in Google Colab:
Choose Runtime → Run all. After about 15–20 minutes the APK downloads and is saved to your
Google Drive (
MyDrive/Chatbot). If the repo is private, paste a read-only GitHub token when the
notebook asks.
Windows builds are made automatically by GitHub Actions on every push. Android builds are currently paused; the latest release retains the previous APKs. Android builds use the permanent signing key when the configured signing secrets are available. Keep that key unchanged so updates retain existing app data.
- Multiple providers. Switch models from the composer. Keys are stored encrypted on the device (Android Keystore / Windows Credential Manager) and sent only to the provider you chat with. Main can optionally serve your private lab network.
- Streaming replies with a stop button, regenerate, edit-and-resend, and copy.
- File uploads: photos, camera capture (Android), PDFs, and text/code files. Drag and drop
works on Windows.
- Images are downscaled to 1568px and sent to vision models.
- PDFs go natively to Claude, ChatGPT and Gemini. For other providers the text is extracted and sent instead.
- Text and code files are inlined with their filename.
- Rich markdown: syntax-highlighted code blocks with copy, tables, LaTeX, and links.
- Thinking: reasoning from Claude, DeepSeek-reasoner and Gemini appears in a collapsible "Thought process" section.
- On-device models (offline): download a small GGUF model, such as Liquid AI's LFM2,
Gemma 3 1B or Qwen 2.5 1.5B, or paste any Hugging Face
.gguflink. It runs on the phone or PC through llama.cpp (llamadart), with no internet and no API key. See Offline models. - Chat history grouped by date, with search, rename and delete. It is stored locally.
- Two theme styles: choose Cream or White / black in Settings → Appearance. Both support light/dark/system mode and use bundled fonts, including Inter.
- Desktop navigation: Chat, Models, Clients, Tools, Logs and Settings on wide screens. Analytics shows measured request data. Phones keep the chat drawer.
- Windows roles: choose Main, Client or Relay on first start, or change the role in Settings. Main approves each PC; signed relay paths preserve the original PC identity through up to eight relays. Choosing a role does not start sharing or grant access.
- Keyboard shortcuts (Windows): Enter sends, Shift+Enter adds a new line, Ctrl+N starts a new chat, Ctrl+, opens settings.
- Main: add named sources under Models → AI sources. FreeLLMAPI, OpenAI-compatible NVIDIA NIM / Cloudflare endpoints and native Gemini, Groq, OpenRouter and other providers can be configured. Credentials stay encrypted. Add multiple keys, then an Auto chain.
- Routing: Manual, Fastest, Most reliable or Smartest (your priorities). Health and token totals come from observed requests. Failed keys cool down; fallback stops once any answer, reasoning or tool output begins. Mixed providers can share a chain; protected tool history pins subsequent requests to its actual provider format. Configure source/key budgets and reset windows, model on/off switches and known Vision/Tools/context capabilities. Unknown account allowances and capabilities are never guessed.
- Clients: pair with Main or a relay, then approve on Main. Set models, tools, services, expiry and daily request/token limits. Block, expiry and Stop all interrupt active model requests. Unknown provider usage keeps the reserved token allowance charged.
- Package access: enable it in Share this device and grant the PC Package downloads. Settings → Coding tools opens a terminal where git, pip and npm use a loopback proxy to Main. These session settings preserve existing global configuration. Proxy port is the host port + 2 (normally 8486); only the fixed package host allowlist is reachable.
- Local coding tools: install Claude Code or Codex on the Windows client, pair with Main, select a project folder and approved model in Settings → Coding tools. The app must stay open. A loopback shim keeps the Main key out of CLI settings and environment. Codex uses an isolated app-owned configuration and the Responses endpoint; unsupported API features report an error. External CLI compatibility still needs a Windows smoke test.
- Main navigation: Sources and Agents have direct menu entries. Chat has its own web-search switch and system-prompt editor. Windows coding setup detects installed programs, remembers the workspace and writes reusable app-owned launchers; Stop deactivates those launchers.
- Analytics and Logs: measured success, failures, tokens, latency and first-text timing, filtered by PC/model over 24 hours, 7 days or 30 days. Logs retain request metadata only; unknown usage is shown as unknown. History is bounded and retention is disclosed.
- LAN updates: Main checks the official rolling Windows release and caches a verified ZIP. Approved clients download from Main (including through relays), verifying size and SHA256. Authorized clients see a notice when Main has a verified update that they have not downloaded. Installation remains manual; archives are never executed automatically.
- LabVIEW: Tools → LabVIEW connects DynasBrain's real
/mcpendpoint and offers an expert prompt that preserves and can restore your previous prompt, real MCP diagnostics, and a direct configured DynasBrain terminal. Main can opt into sharing those tools; each remote call requires a separate Main approval and explicit PC permission. Changing shared tools updates the MCP catalogue; legacy sessions may need to reconnect. Already accepted hardware actions cannot be undone by disconnecting.
Use the lab network only. Permit Windows firewall access to your chosen Main ports on the private network. Provider HTTPS stays verified; package CONNECT tunnels keep destination TLS end to end. This does not replace a router or provide unrestricted client internet access.
- Install Flutter 3.47.9, matching CI.
flutter pub get- Run it:
- Android:
flutter run -d android(device or emulator) - Windows:
flutter run -d windows - Try the UI without a key:
flutter run --dart-define=DEMO=true
- Android:
- Open Settings → API keys, paste a key, and tap Test & load models.
| Provider | Where to get a key |
|---|---|
| Claude | https://console.anthropic.com/settings/keys |
| ChatGPT | https://platform.openai.com/api-keys |
| DeepSeek | https://platform.deepseek.com/api_keys |
| Gemini | https://aistudio.google.com/apikey |
| OpenRouter | https://openrouter.ai/keys |
| Groq | https://console.groq.com/keys |
Open Settings → On-device models (or the model picker → On-device → Download).
| Model | Download | RAM needed | Notes |
|---|---|---|---|
| LFM2 350M | 230 MB | ~1 GB | Tiny, very fast |
| LFM2 700M | 470 MB | ~1.5 GB | Fast on most phones |
| LFM2 1.2B | 730 MB | ~2 GB | Recommended |
| LFM2 2.6B | 1.6 GB | ~4 GB | Needs a recent phone or a PC |
| Gemma 3 1B | 810 MB | ~2 GB | |
| Qwen 2.5 1.5B | 1.1 GB | ~2.5 GB | Good at code |
- Use + → Add a GGUF model to paste any Hugging Face link (
hf://owner/repo/file.gguf) or pick a.gguffile already on the device. Q4_K_M files work best on phones. - Expect roughly 5–20 words per second on a phone with a 1B model, and much faster on a PC. On-device models are simpler than the cloud models.
- Images aren't supported offline. Text files and PDF text are.
- Android needs a 64-bit phone with Android 10 or later. The model list lives in
lib/data/local/local_models.dart.
Turn an old phone or a PC into a private AI server for your other devices.
On the host (e.g. the old phone): Settings → Share this device, then turn on Share AI on this Wi-Fi. Choose what to share: on-device models, and optionally cloud models that then use the host's API keys. On Android a notification shows while sharing; keep the app open in the background.
On your other devices: Settings → Connect to a home server. The host appears
automatically; tap it and enter the 6-digit PIN shown on the host. You can also type the
address (e.g. 192.168.1.23:8484). The shared models then appear in the model picker under
Home server.
Other apps (Open WebUI, Continue, the OpenAI SDKs, curl) can use the host's OpenAI-compatible API. On the host, tap Create access key, then use:
curl http://192.168.1.23:8484/v1/chat/completions \
-H "Authorization: Bearer cbh_..." -H "Content-Type: application/json" \
-d '{"model": "local/LFM2-1.2B-Q4_K_M", "messages": [{"role": "user", "content": "Hi"}]}'GET /v1/models lists what the host shares. Model ids look like local/<model> or
anthropic/claude-sonnet-5-5. Streaming ("stream": true) and
stream_options.include_usage work as with OpenAI.
The host also speaks the common tool and agent protocols, all with the same access key:
| Protocol | Address | Use it from |
|---|---|---|
| MCP (Streamable HTTP) | http://<host>:8485/mcp |
Claude Desktop, Claude Code, Cursor, VS Code: tools list_models and chat |
| UTCP v1 manual | http://<host>:8484/utcp |
UTCP clients: HTTP tools list_models and chat (POST /tools/chat); set the variable CHATBOT_HOST_KEY to your key |
| A2A 1.0 | Agent Card at http://<host>:8484/.well-known/agent-card.json, JSON-RPC at /a2a |
Agent frameworks: SendMessage and SendStreamingMessage; pick a model with metadata.model |
For example, to add the host to Claude Code:
claude mcp add --transport http phone-ai http://192.168.1.23:8485/mcp \
--header "Authorization: Bearer cbh_..."Security: only paired devices and apps with an access key can use the server; remove a device on the host to revoke it. Wrong PINs are rate-limited and the PIN rotates. Traffic on the Wi-Fi isn't encrypted, so share only on networks you trust.
The AI can use tools while it answers. Add them under Settings → Tools:
| Type | What you enter | Notes |
|---|---|---|
| MCP server | Streamable HTTP URL (+ optional bearer key) | Any MCP server; tools are listed automatically |
| UTCP manual | Manual URL (+ optional key, NAME=value variables) |
HTTP tools are called directly; cli tools run on a PC if their programs are allowlisted |
| A2A agent | Agent URL or agent card URL (+ optional key) | Becomes an "ask" tool; A2A 1.0 and 0.3 |
| CLI program (Windows/PC) | Program name or path, e.g. git |
Allowlist: the AI can only run programs you add, and every run asks you first, showing the exact command |
If you're paired with a home server, Tools from adds its MCP tools in one tap.
Every tool call appears in the chat. Tap it to see the input and result. Tools from MCP, UTCP and A2A run on their own unless you turn on Ask before each run for that source. Tool use works with Claude, ChatGPT and other OpenAI-compatible APIs, Gemini, on-device models (if the model supports tool calling) and models on your home server.
- On the internet PC, open Settings → Share this device → Coding agents.
- Install and sign in to Claude Code or Codex on that PC, then use Check again.
- Enable the agent and add a project folder. Choose whether file edits are allowed.
- On the other PC, pair with the host, then open Settings → Tools → Tools from .
- Ask the agent to work on that project. Approve the request on the client and on the host.
The task goes through stdin to the agent on the host. Progress continues during approval and execution; client cancellation stops the run. If the MCP port is unavailable, the host screen shows an error while the main chat API can remain available. Read-only uses the agent's permission mode; Claude Code plan mode is not a full operating-system sandbox.
Before committing changes, run both commands from the repository folder:
flutter analyze
flutter testAnalysis must report No issues found! and all tests must pass. Navigation widget tests cover 1400px desktop and 400px phone windows; additional tests cover saved themes and Windows roles. The native Windows build is checked by GitHub Actions. Lab Router implementation status and remaining phases are described in the plan.
flutter build apk --release --split-per-abi --target-platform android-arm64,android-x64
flutter build appbundle --release # Play Store
flutter build windows --release # build/windows/x64/runner/Release/ (run on Windows)The Build GitHub Actions workflow runs analyze and the tests, then builds and uploads the
zipped Windows app. Android builds are paused with BUILD_ANDROID: 'false'. When re-enabled,
they use the permanent signing secrets documented below; never replace an existing signing key.
Android only installs an update over the old app when both are signed with the same key. Without a key, each GitHub build uses a new temporary key, so you would have to uninstall the app (and lose its chats) before every update. Set this up once:
-
Open https://colab.research.google.com, create a new notebook, paste this into a cell and run it:
import subprocess, base64, getpass pw = getpass.getpass("Choose a keystore password (min 6 chars): ") subprocess.run(["keytool", "-genkeypair", "-keystore", "upload-keystore.jks", "-alias", "upload", "-keyalg", "RSA", "-keysize", "2048", "-validity", "10000", "-storepass", pw, "-keypass", pw, "-dname", "CN=Chatbot"], check=True) open("keystore-base64.txt", "w").write(base64.b64encode(open("upload-keystore.jks", "rb").read()).decode()) from google.colab import files files.download("upload-keystore.jks"); files.download("keystore-base64.txt")
-
Back up
upload-keystore.jksand the password somewhere safe (e.g. a password manager). If you lose them, existing installs can't be updated. -
On GitHub: Settings → Secrets and variables → Actions → New repository secret. Add:
ANDROID_KEYSTORE_BASE64: the whole contents ofkeystore-base64.txtANDROID_KEYSTORE_PASSWORD: your passwordANDROID_KEY_ALIAS:upload
-
Re-run the latest build (Actions → Build → Re-run all jobs). From then on, every APK is signed with your key and installs as an update.
lib/
core/ theme, storage (Hive + secure key store), platform helpers
data/models.dart conversations, messages, attachments, provider catalog
data/llm/ provider adapters: Anthropic, OpenAI-compatible, Gemini, demo; SSE parser
state/ AppState (ChangeNotifier) + AppScope
features/
chat/ chat screen, composer, message tiles, markdown, model picker
sidebar/ history drawer / sidebar
settings/ keys, models, theme, custom instructions
attachments/ picking, image resizing, PDF text extraction
test/ SSE parser, provider request/stream tests, AppState tests
To add a provider that speaks the OpenAI Chat Completions API, add an entry to
ProviderKind in lib/data/models.dart. No other code is needed.
- Claude requests use the Messages API (
anthropic-version: 2026-10-21) with adaptive thinking (summarized). On Opus 5.5, Sonnet 5.5, Opus 5 and Fable 5.1 they also enable server-side refusal fallbacks (fallbacks: "default"). - PDF text extraction uses
syncfusion_flutter_pdf, which is free under the Syncfusion Community License for individuals and small companies. Check their terms for commercial use. - Fonts (Inter, Source Serif 4, JetBrains Mono, SIL OFL) are bundled in
assets/google_fonts.