A cross-platform AI chat application built with Flutter, supporting Claude, DeepSeek, and Mistral models via AWS Bedrock.
- Multi-model support: Claude Opus/Sonnet/Haiku, DeepSeek R1, Mistral Large
- Real-time streaming: Token-by-token response streaming
- DeepSeek thinking: Expandable reasoning section for DeepSeek R1
- File attachments: Images, PDFs, documents, code files
- End-to-end encryption: Client-side AES-GCM encryption with PBKDF2 key derivation
- Cross-device sync: Encrypted chat storage via S3
- Local caching: Instant load with background sync
- Dark/Light themes: System-aware theming
┌─────────────────────────────────────────────────────────────┐
│ Flutter App (Web/iOS/Android) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Cognito │ │ WebSocket │ │ Local Storage │ │
│ │ Auth │ │ Client │ │ (SharedPrefs) │ │
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
└─────────┼────────────────┼────────────────────┼─────────────┘
│ │ │
▼ ▼ │
┌─────────────────┐ ┌─────────────────────┐ │
│ Cognito User │ │ API Gateway │ │
│ Pool │ │ (WebSocket) │ │
└─────────────────┘ └──────────┬──────────┘ │
│ │
▼ │
┌─────────────────────┐ │
│ Lambda │ │
│ (bedrock-proxy) │ │
│ │ │
│ • Origin check │ │
│ • Chat streaming │ │
│ • S3 operations │ │
└──────────┬──────────┘ │
│ │
┌──────────┴──────────┐ │
▼ ▼ │
┌─────────────────┐ ┌─────────────────┐
│ Bedrock │ │ S3 │
│ (AI Models) │ │ (Encrypted │
│ │ │ Chat Storage) │
└─────────────────┘ └─────────────────┘
- Flutter SDK 3.19+
- AWS CLI configured
- Xcode (for iOS)
- Android Studio (for Android)
git clone https://github.com/charsree/chariot.git
cd chariot
flutter pub getCreate config.local.json in the project root:
{
"AWS_REGION": "us-east-1",
"COGNITO_USER_POOL_ID": "YOUR_USER_POOL_ID",
"COGNITO_CLIENT_ID": "YOUR_CLIENT_ID",
"WS_ENDPOINT": "wss://YOUR_API_ID.execute-api.us-east-1.amazonaws.com/prod",
"S3_BUCKET_NAME": "your-chat-storage-bucket"
}See config.local.json.example for template.
Set environment variables for Flutter build:
# Web
flutter run -d chrome \
--dart-define=AWS_REGION=us-east-1 \
--dart-define=COGNITO_USER_POOL_ID=YOUR_USER_POOL_ID \
--dart-define=COGNITO_CLIENT_ID=YOUR_CLIENT_ID \
--dart-define=WS_ENDPOINT=wss://YOUR_API_ID.execute-api.us-east-1.amazonaws.com/prod
# Or use config.local.json with a build script
./scripts/build.sh./build.shOr build individually:
flutter build web --release
# Output: build/web/
# Deploy to Cloudflare Pages, S3+CloudFront, or any static host# APK (for direct install)
flutter build apk --release
# Output: build/app/outputs/flutter-apk/app-release.apk
# App Bundle (for Play Store)
flutter build appbundle --release
# Output: build/app/outputs/bundle/release/app-release.aab# Build for App Store
flutter build ios --release
# Then open in Xcode for archive/upload
open ios/Runner.xcworkspacechariot/
├── lib/
│ ├── config/
│ │ ├── aws_config.dart # AWS configuration
│ │ └── theme.dart # App themes
│ ├── models/
│ │ ├── ai_model.dart # AI model definition
│ │ ├── chat.dart # Conversation/Message models
│ │ └── user_settings.dart # User preferences
│ ├── providers/
│ │ └── app_providers.dart # Riverpod state management
│ ├── screens/
│ │ ├── home_screen.dart # Main chat interface
│ │ ├── login_screen.dart # Authentication
│ │ ├── signup_screen.dart # Registration
│ │ ├── verify_screen.dart # Email verification
│ │ └── settings_screen.dart # User settings
│ ├── services/
│ │ ├── auth_service.dart # Cognito authentication
│ │ ├── bedrock_service.dart # AI model streaming
│ │ ├── config_service.dart # Remote config
│ │ ├── encryption_service.dart # E2E encryption
│ │ ├── s3_sync_service.dart # S3 operations
│ │ └── storage_service.dart # Local + remote storage
│ ├── widgets/
│ │ ├── chat_view.dart # Chat messages UI
│ │ ├── chat_drawer.dart # Conversation list
│ │ └── model_selector.dart # Model picker
│ └── main.dart # App entry point
├── infrastructure/
│ ├── lambda/
│ │ └── bedrock_proxy.py # Lambda function
│ └── template.yaml # CloudFormation template
├── web/
│ └── _redirects # SPA routing for Cloudflare
├── SETUP.md # AWS setup guide
└── README.md # This file
- Add to Lambda
MODELSlist ininfrastructure/lambda/bedrock_proxy.py - Deploy Lambda:
./deploy-lambda.sh - App fetches updated models automatically
Edit infrastructure/lambda/bedrock_proxy.py:
- Chunk buffering: Adjust
> 0threshold - Timeout: Modify Lambda timeout in
template.yaml
For UI development without backend:
- Comment out S3 sync calls in
storage_service.dart - Data persists in local SharedPreferences only
cd infrastructure/lambda
zip -r ../function.zip bedrock_proxy.py
aws lambda update-function-code \
--function-name chariot-bedrock-proxy \
--zip-file fileb://../function.zip \
--region us-east-1cd infrastructure
aws cloudformation deploy \
--template-file template.yaml \
--stack-name chariot-api \
--capabilities CAPABILITY_NAMED_IAM \
--region us-east-1MIT


