ChatForge Native

ChatForge Native is the Flutter client for ChatForge, a self-hosted, multi-provider LLM chat platform. It targets Android and Linux and can either connect to a remote ChatForge server or run the server locally as an embedded Node.js backend.

Highlights

  • Streaming chat with Anthropic, OpenAI, Gemini, and Vertex AI models.
  • Remote-server and fully local embedded modes on Android and Linux.
  • Local-only or server-synced conversations, folders, memories, artifacts, model catalogs, and preferences.
  • Markdown, syntax-highlighted code, math, reasoning traces, durable attachments, image vision, PDF/modern Office text extraction, and native media playback.
  • Tool calling with per-tool controls, approval prompts, execution traces, server-routed network tools, and an optional local agent for filesystem and shell operations.
  • Artifact references and @path completion directly in the message composer.
  • Model-accessible artifact list/read/upsert/delete tools backed by the synced ChatForge artifact store.
  • !command composer execution through the configured local agent. Multiline input is sent as one command in the configured workspace; the explicit composer action authorizes it and the exit status/output render in chat.
  • A default-enabled, synced startup update check with an App Updates notice.
  • Manual memory management and optional server-side automatic memory consolidation.
  • Password, passkey, 2FA, and device-link authentication with connected-session management.
  • Real-time WebSocket sync, selective sync policies, encrypted secret sync, data export, and remote/embedded migration.
  • App lock with credential or biometric unlock.
  • Android background response streaming and optional on-device completion notifications. Notification delivery does not use FCM or another push service.
  • Signed APK/AAB and Linux AppImage release tooling with an in-app OTA manifest.

Supported platforms

Platform Status Embedded backend Release format
Android Primary Yes APK / AAB
Linux x86_64 Primary Yes AppImage
Windows Project scaffold available No Manual Flutter build

Repository layout

Path Purpose
flutter/ Flutter application, native platform runners, tests, and release scripts
chatforge-web/ Git submodule containing the shared Express API, embedded backend, worker, and web client
docs/ Architecture notes, implementation plans, and maintenance handoffs
patches/ Historical backend patch series and integration notes

Getting started

Prerequisites

  • Flutter stable with Dart 3.11 or newer
  • Node.js and npm, used to assemble the embedded backend
  • The normal Flutter toolchain for the target platform (flutter doctor will report anything missing)

Clone the repository with its backend submodule:

git clone --recurse-submodules \
  https://git.nocturn9x.space/chatforge/chatforge-flutter
cd chatforge-flutter

If the repository was cloned without submodules, initialize them from the repository root:

git submodule update --init --recursive

Run the Linux client:

cd flutter
flutter pub get
flutter run -d linux

Or run on a connected Android device:

cd flutter
flutter pub get
flutter devices
flutter run -d <device-id>

The sign-in screen lets you choose between a remote server and the embedded backend. Embedded mode stores its database and runtime state in the app's private data directory. Attachment binaries are stored separately from message JSON and are protected together with the embedded database when app lock is enabled.

Attachment intake supports up to six files and 32 MiB total per message. Images are limited to PNG, JPEG, and WebP; documents support PDF, DOCX, XLSX, PPTX, and plain-text formats. Scanned-document OCR, legacy Office files, SVG/GIF/HEIC, drag-and-drop, and model-visible audio/video are not currently supported.

Running a development server

The backend submodule contains the complete server and web application. From the repository root, in another shell:

cd chatforge-web
npm install
cp .env.example .env
# Set a strong CHATFORGE_SECRET in .env.
npm run user:create -- <username> <password> admin
npm run dev

This starts the API on port 3069 and the Vite web client on port 5173. See chatforge-web/README.md for deployment, worker, e-mail, security, and backend configuration details.

Point a development client at the local API with a Dart define:

# Linux host
flutter run -d linux \
  --dart-define=CHATFORGE_API_BASE_URL=http://127.0.0.1:3069/api

# Android emulator (use the ID shown by `flutter devices`)
flutter run -d <device-id> \
  --dart-define=CHATFORGE_API_BASE_URL=http://10.0.2.2:3069/api

For a physical Android device, replace the host with the development machine's LAN address.

Build-time configuration

Dart define Default Description
CHATFORGE_API_BASE_URL https://chat.n9x.co/api Default remote API URL
CHATFORGE_APP_MODE auto Initial mode: auto, remote, or embedded
CHATFORGE_EMBEDDED_PORT 3069 Loopback port used by the embedded backend

The selected backend mode and custom server URL can also be changed in the app.

Development checks

Run these from flutter/:

flutter analyze
flutter test

The embedded backend payload is generated from the checked-out submodule. To refresh it manually:

./scripts/sync_embedded_backend.sh

Android and Linux builds also invoke that sync step automatically.

Release builds

Android release signing must be configured first:

cd flutter
cp android/key.properties.example android/key.properties
# Fill in the keystore path, passwords, and alias.

Build the signed APK, signed AAB, and Linux AppImage together:

./scripts/build_release_artifacts.sh

To target another server:

CHATFORGE_API_BASE_URL=https://chatforge.example.com/api \
  ./scripts/build_release_artifacts.sh

Artifacts are written to:

  • flutter/build/app/outputs/flutter-apk/app-release.apk
  • flutter/build/app/outputs/bundle/release/app-release.aab
  • flutter/build/appimage/chatforge_native-<version>-x86_64.AppImage

The interactive release uploader can publish both platform artifacts and update flutter/ota/versions.json:

./scripts/upload_release_fileax.sh --target all

Versioning

The application version lives in flutter/pubspec.yaml as <semver>+<build-number>. The matching semantic version is stored in flutter/version.txt for packaging and OTA metadata.

Synchronize it manually with:

cd flutter
./scripts/version.sh --semver --write-version-file

License

ChatForge Native is licensed under the Apache License 2.0.

S
Description
A vibecoded Flutter app for the ChatForge server
Readme Apache-2.0
2.8 MiB
0 Stars 1 Watchers 0 Forks
Languages
Dart 96.5%
C++ 1%
Shell 0.8%
CMake 0.7%
Kotlin 0.7%
Other 0.2%