Skip to content

Commit d977d99

Browse files
feat: Update version and add Hive models for profile management
- Bump version to 1.7.10+11 in pubspec.yaml - Introduce Hive models for ProfileCard, ActivityLog, ChatMessage, AgentMemory, and DossierEntry to manage user profiles and chat history. - Implement serialization and deserialization methods for the new models. - Create ChatBubble widget for displaying chat messages with support for images and thinking content. - Add ChatHistoryModal for managing chat history and profiles. - Implement ChatInputBar for sending messages with image attachment support. - Develop DebugPanel to show LLM stats and performance metrics.
1 parent 23a10b6 commit d977d99

22 files changed

Lines changed: 2403 additions & 1790 deletions

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ A micro-app that runs **100% on your device** - no cloud, no data sharing. Just
4444

4545
## Features
4646

47-
### 🤖 Local AI (Tiered Intelligence)
48-
- **Featherweight (270M)** - Ultra-fast agentic tools & actions.
49-
- **Middleweight (1B - 1.5B)** - High-quality conversational chat (Gemma 3, DeepSeek R1).
50-
- **Heavyweight (3.8B)** - Advanced reasoning (Phi-4 Mini).
51-
- **Multimodal (Vision)** - Screenshot analysis for interest grading.
47+
### 🤖 On-Device AI (5 Curated Models)
48+
| Model | Context | Capabilities |
49+
|-------|---------|--------------|
50+
| **Gemma 3n E2B** 📷 | 32K | Vision + Audio + Tools |
51+
| **DeepSeek R1** 🧠 | 32K | Reasoning + Thinking + Tools |
52+
| **Phi-4 Mini** 🔬 | 128K | Best context window + Tools |
53+
| **Gemma 3 1B** 💎 | 32K | Recommended chat quality |
54+
| **Qwen 2.5 1.5B** 🌍 | 32K | Multilingual + Tools |
5255

5356
### 🔒 100% Private
5457
- All AI runs on-device via **LiteRT (MediaPipe)**.

docs/MODELS.md

Lines changed: 37 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,72 @@
11
# Wingman LLM Models
22

3-
## Architecture: Multi-Model Intelligence
3+
## Architecture: Curated Model Selection
44

5-
Wingman supports a tiered model strategy to balance speed, intelligence, and privacy.
5+
Wingman uses a curated set of 5 high-quality models focused on:
6+
- **Good context windows** (32K-128K tokens)
7+
- **Multimodal capabilities** (vision, audio)
8+
- **Function calling / tools** support
69

7-
### The Intelligence Tiers
10+
### Model Summary
811

9-
| Tier | Size (Params) | Best For | Recommended Model |
10-
|------|---------------|----------|-------------------|
11-
| **Featherweight** | 270M - 0.5B | Speed & Tools | **FunctionGemma 270M**|
12-
| **Middleweight** | 1B - 1.5B | Chat & Reasoning | **Gemma 3 1B** 💎 |
13-
| **Heavyweight** | 3B - 4B | Advanced Logic | **Phi-4 Mini** 🔬 |
12+
| Model | Params | Size | RAM | Context | Capabilities |
13+
|-------|--------|------|-----|---------|--------------|
14+
| **Gemma 3n E2B** 📷 | 2B eff | 3.6GB | 4GB | 32K | Text + Vision + Audio + Tools |
15+
| **DeepSeek R1** 🧠 | 1.5B | 1.2GB | 4GB | 32K | Text + Thinking + Tools |
16+
| **Phi-4 Mini** 🔬 | 3.8B | 2.8GB | 6GB | 128K | Text + Tools (Best context!) |
17+
| **Gemma 3 1B** 💎 | 1B | 689MB | 4GB | 32K | Text (Recommended for chat) |
18+
| **Qwen 2.5 1.5B** 🌍 | 1.5B | 1.1GB | 4GB | 32K | Text + Tools (Multilingual) |
1419

1520
---
1621

17-
## Model Roster (Verified Official List)
22+
## Model Details
1823

19-
All models are official LiteRT builds from the **`litert-community`** organization on HuggingFace.
24+
### Multimodal
25+
* **Gemma 3n E2B** 📷🎤: Full multimodal - text, image, video, audio input. Best for vision tasks. Requires Gemma license acceptance on HuggingFace.
2026

21-
| Model | Class | Size | RAM | Context | Category |
22-
|-------|-------|------|-----|---------|----------|
23-
| **DeepSeek R1** | 1.5B | 1.2GB | 4GB | 32K | Reasoning/Agent |
24-
| **Phi-4 Mini** | 3.8B | 2.8GB | 6GB | 128K | Logic/Reasoning |
25-
| **Gemma 3 1B** 💎 | 1B | 689MB | 4GB | 32K | General Chat |
26-
| **Gemma 3 270M** | 270M | 276MB | 2GB | 32K | Fast Chat |
27-
| **Qwen 2.5 1.5B** | 1.5B | 1.1GB | 4GB | 32K | Multilingual |
28-
| **Qwen 2.5 0.5B** | 0.5B | 400MB | 2GB | 32K | Fast Actions |
29-
| **Gemma 2 2B IT** | 2B | 1.6GB | 4GB | 8K | High Quality Text |
30-
| **FunctionGemma**| 270M | 150MB | 2GB | 8K | Specialized Agent |
31-
| **TinyLlama 1.1B** | 1.1B | 650MB | 2GB | 2K | Legacy Support |
32-
| **SmolLM 135M** | 135M | 270MB | 1GB | 2K | Ultra-Lightweight |
27+
### Agent & Reasoning
28+
* **DeepSeek R1 1.5B** 🧠: Thinking mode + function calling. Best for complex reasoning and tool chaining.
29+
* **Phi-4 Mini** 🔬: Advanced logic with 128K context - the largest context window available. Best for long conversations.
30+
* **Qwen 2.5 1.5B** 🌍: Strong multilingual support + tools. Best for non-English users.
3331

34-
---
35-
36-
## Model Tiers
37-
38-
### Tier 1: Agent & Tools (The "Brain")
39-
* **DeepSeek R1 1.5B**: Best for complex reasoning and tool chaining.
40-
* **Phi-4 Mini**: Advanced logic for deeper strategy analysis.
41-
* **FunctionGemma 270M**: The core model for simple on-device actions.
42-
* **Qwen 2.5 (1.5B/0.5B)**: Exceptional for multilingual tool requests.
43-
44-
### Tier 2: General Chat (The "Vibe")
45-
* **Gemma 3 1B** 💎: **Recommended.** Best balance of wit, speed, and persona.
46-
* **Gemma 2 2B IT**: High-precision text for nuanced advice.
47-
* **Gemma 3 270M**: Whisper-fast chat for quick check-ins.
48-
49-
### Tier 3: Support Models (The "Safety Net")
50-
* **TinyLlama 1.1B**: Reliable chat for older hardware.
51-
* **SmolLM 135M**: Runs on almost anything; perfect for emergency advice.
32+
### General Chat
33+
* **Gemma 3 1B** 💎: **Recommended.** Best balance of quality, speed, and size. Requires Gemma license.
5234

5335
---
5436

55-
## Technical Setup
56-
57-
### RAM Recommendations
58-
- **Old Devices (2GB)**: Use FunctionGemma 270M.
59-
- **Standard (4GB)**: Gemma 3 1B or DeepSeek R1.
60-
- **Pro Devices (6GB+)**: Phi-4 Mini or Gemma 3n E4B.
37+
## RAM Recommendations
6138

62-
### Context Management
63-
Wingman uses a dynamic sliding-window context. Older messages are summarized once they exceed the model's `contextWindowK` (listed above), ensuring you nunca pierdas el hilo de la conversacion.
39+
- **Standard (4GB)**: Gemma 3 1B (chat) or DeepSeek R1 (reasoning)
40+
- **Pro Devices (6GB+)**: Phi-4 Mini (128K context) or Gemma 3n E2B (multimodal)
6441

6542
---
6643

6744
## Official Sources & Repositories
6845

69-
Wingman uses strictly verified `.task` models to ensure compatibility with MediaPipe/LiteRT.
46+
All models are verified `.task` or `.litertlm` formats for MediaPipe/LiteRT compatibility.
7047

71-
### Primary Source: LiteRT Community
72-
Most models are sourced from the [LiteRT Community HuggingFace Organization](https://huggingface.co/litert-community).
73-
- **DeepSeek R1 1.5B**: [Link](https://huggingface.co/litert-community/DeepSeek-R1-Distill-Qwen-1.5B)
74-
- **Phi-4 Mini**: [Link](https://huggingface.co/litert-community/Phi-4-mini-instruct)
75-
- **Gemma 3 Family**: [Link](https://huggingface.co/litert-community/Gemma3-1B-IT)
76-
- **Qwen 2.5 Family**: [Link](https://huggingface.co/litert-community/Qwen2.5-1.5B-Instruct)
48+
### LiteRT Community (Public - No login required)
49+
- **DeepSeek R1 1.5B**: [litert-community/DeepSeek-R1-Distill-Qwen-1.5B](https://huggingface.co/litert-community/DeepSeek-R1-Distill-Qwen-1.5B)
50+
- **Phi-4 Mini**: [litert-community/Phi-4-mini-instruct](https://huggingface.co/litert-community/Phi-4-mini-instruct)
51+
- **Qwen 2.5 1.5B**: [litert-community/Qwen2.5-1.5B-Instruct](https://huggingface.co/litert-community/Qwen2.5-1.5B-Instruct)
7752

78-
### Specialized Agent Models
79-
- **FunctionGemma 270M**: Sourced from [sasha-denisov/function-gemma-270M-it](https://huggingface.co/sasha-denisov/function-gemma-270M-it). This model is specifically fine-tuned for on-device tool calling and low-latency interaction.
53+
### Google (Gated - Requires Gemma license acceptance)
54+
- **Gemma 3n E2B**: [google/gemma-3n-E2B-it-litert-lm](https://huggingface.co/google/gemma-3n-E2B-it-litert-lm)
55+
- **Gemma 3 1B**: [litert-community/Gemma3-1B-IT](https://huggingface.co/litert-community/Gemma3-1B-IT)
8056

8157
---
8258

83-
## Technical Specifications (Summary)
59+
## Technical Specifications
8460

8561
| Metric | Minimum | Recommended |
8662
|--------|---------|-------------|
87-
| **Device RAM** | 2GB | 4GB - 6GB |
63+
| **Device RAM** | 4GB | 6GB+ |
8864
| **Storage** | 1GB | 5GB+ (for multiple models) |
8965
| **OS** | iOS 16.0+ / Android 11+ | Latest |
9066

9167
---
9268

9369
## Credits
9470
- **Google AI**: For the Gemma architecture and MediaPipe SDK.
95-
- **DeepSeek / Microsoft / Alibaba**: For the weights used in distilled LiteRT models.
96-
- **Sasha Denisov**: For the FunctionGemma fine-tune optimized for mobile agents.
71+
- **DeepSeek / Microsoft / Alibaba**: For model weights used in LiteRT conversions.
72+
- **LiteRT Community**: For maintaining verified on-device model conversions.

docs/ROADMAP.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,18 @@ Local AI dating assistant with on-device LLM, voice input, and CRM-style profile
8282
## Phase 2 - Intelligence & Language Learning
8383

8484
### Screenshot Analysis (Vision Model)
85-
- [x] Gemma 3n E2B multimodal support (already integrated)
85+
- [x] Gemma 3n E2B multimodal support (vision + audio)
8686
- [ ] Auto-detect language in screenshots
8787
- [ ] Extract conversation context
8888
- [ ] Interest level scoring
8989

90+
### Curated Model Selection (5 models)
91+
- [x] Gemma 3n E2B - Multimodal (32K context)
92+
- [x] DeepSeek R1 1.5B - Reasoning + Thinking (32K context)
93+
- [x] Phi-4 Mini - Best context window (128K context)
94+
- [x] Gemma 3 1B - Recommended chat (32K context)
95+
- [x] Qwen 2.5 1.5B - Multilingual + Tools (32K context)
96+
9097
### Agentic Features (Tool Calling)
9198
- [ ] Parse function call responses
9299
- [ ] Auto-copy responses to clipboard
@@ -133,13 +140,17 @@ Local AI dating assistant with on-device LLM, voice input, and CRM-style profile
133140
├─────────────────────────────────────────────┤
134141
│ LlmService (Dart) │
135142
│ ↓ │
136-
│ flutter_gemma (Native Bridge)
143+
│ flutter_gemma 0.11.14 (Native Bridge) │
137144
│ ↓ │
138145
│ MediaPipe GenAI (C++) │
139146
│ ↓ │
140147
│ TensorFlowLite (Metal GPU on iOS) │
141148
│ ↓ │
142-
│ Gemma 3n E2B (~1.5GB from HuggingFace) │
143-
│ • Text chat • Vision • Audio • Tools │
149+
│ 5 Curated Models from HuggingFace: │
150+
│ • Gemma 3n E2B (Vision/Audio/Tools) │
151+
│ • DeepSeek R1 (Reasoning/Thinking) │
152+
│ • Phi-4 Mini (128K context) │
153+
│ • Gemma 3 1B (Recommended chat) │
154+
│ • Qwen 2.5 1.5B (Multilingual) │
144155
└─────────────────────────────────────────────┘
145156
```

docs/wip/flutter_gemma_integration_fixes.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,9 @@ Need to verify each `AvailableModel` has the correct `ModelType` assignment:
394394
|-------|-------------------|-------------------|
395395
| gemma3nE2b | gemmaIt | gemmaIt ✓ |
396396
| deepSeekR1 | deepSeek | deepSeek ✓ |
397-
| functionGemma270m | functionGemma | functionGemma ✓ |
398-
| qwen32bQ4 | qwen | qwen ✓ |
399-
| phi4Mini | general | general (verify) |
400-
| llama32_1b | llama | llama ✓ |
401-
| hammerQ4 | hammer | hammer ✓ |
397+
| phi4Mini | general | general ✓ |
398+
| gemma3_1bIt | gemmaIt | gemmaIt ✓ |
399+
| qwen25_15b | qwen | qwen ✓ |
402400

403401
### Bug #6: fileType Not Being Set
404402

@@ -503,13 +501,11 @@ The library distinguishes between:
503501
- Pay special attention to Phi-4 (uses `general`)
504502

505503
- [ ] **6. Test each model type after fixes**
506-
- Test Gemma 3n E2B (gemmaIt)
507-
- Test DeepSeek R1 (deepSeek + isThinking)
508-
- Test Qwen 3.2B (qwen)
509-
- Test Function Gemma (functionGemma)
510-
- Test Llama 3.2 1B (llama)
511-
- Test Hammer (hammer)
512-
- Test Phi-4 (general)
504+
- Test Gemma 3n E2B (gemmaIt) - Multimodal
505+
- Test DeepSeek R1 (deepSeek + isThinking) - Reasoning
506+
- Test Phi-4 Mini (general) - Best context
507+
- Test Gemma 3 1B (gemmaIt) - Recommended chat
508+
- Test Qwen 2.5 1.5B (qwen) - Multilingual
513509

514510
---
515511

@@ -538,7 +534,11 @@ fileType: _currentConfig?.fileType ?? ModelFileType.task,
538534

539535
### Testing
540536

541-
After implementation, test each model type (gemma, deepseek, qwen, llama, hammer, phi) to verify they work.
537+
After implementation, test each model type:
538+
- gemmaIt: Gemma 3n E2B, Gemma 3 1B
539+
- deepSeek: DeepSeek R1 (+ isThinking)
540+
- qwen: Qwen 2.5 1.5B
541+
- general: Phi-4 Mini
542542

543543
### Don't
544544

ios/Podfile.lock

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
PODS:
2-
- adaptive_platform_ui (0.1.0):
3-
- Flutter
42
- background_downloader (0.0.1):
53
- Flutter
64
- CwlCatchException (2.2.1):
@@ -87,7 +85,6 @@ PODS:
8785
- TensorFlowLiteSwift/Privacy (0.0.1-nightly.20250619)
8886

8987
DEPENDENCIES:
90-
- adaptive_platform_ui (from `.symlinks/plugins/adaptive_platform_ui/ios`)
9188
- background_downloader (from `.symlinks/plugins/background_downloader/ios`)
9289
- file_picker (from `.symlinks/plugins/file_picker/ios`)
9390
- Flutter (from `Flutter`)
@@ -116,8 +113,6 @@ SPEC REPOS:
116113
- TensorFlowLiteSwift
117114

118115
EXTERNAL SOURCES:
119-
adaptive_platform_ui:
120-
:path: ".symlinks/plugins/adaptive_platform_ui/ios"
121116
background_downloader:
122117
:path: ".symlinks/plugins/background_downloader/ios"
123118
file_picker:
@@ -144,7 +139,6 @@ EXTERNAL SOURCES:
144139
:path: ".symlinks/plugins/speech_to_text/darwin"
145140

146141
SPEC CHECKSUMS:
147-
adaptive_platform_ui: f54f620666d1797636f9ef06f49137ef2cc13611
148142
background_downloader: 50e91d979067b82081aba359d7d916b3ba5fadad
149143
CwlCatchException: 7acc161b299a6de7f0a46a6ed741eae2c8b4d75a
150144
CwlCatchExceptionSupport: 54ccab8d8c78907b57f99717fb19d4cc3bce02dc

ios/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10
1+
11

lib/main.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import 'theme/app_theme.dart';
1010

1111
import 'screens/chat_screen.dart';
1212
import 'screens/settings_screen.dart';
13-
import 'models/profile_card.dart';
13+
import 'models/hive_models.dart';
1414
import 'models/user_psychograph.dart';
1515
import 'services/storage_service.dart';
1616
import 'services/logger_service.dart';
17+
import 'services/notification_service.dart';
1718

1819
void main() async {
1920
WidgetsFlutterBinding.ensureInitialized();
@@ -30,6 +31,8 @@ void main() async {
3031
Hive.registerAdapter(ActivityLogAdapter());
3132
Hive.registerAdapter(UserPsychographAdapter());
3233
Hive.registerAdapter(PatternEntryAdapter());
34+
Hive.registerAdapter(AgentMemoryAdapter());
35+
Hive.registerAdapter(DossierEntryAdapter());
3336

3437
// Initialize storage service (opens boxes)
3538
final storageService = StorageService();
@@ -38,6 +41,9 @@ void main() async {
3841
// Initialize FlutterGemma plugin
3942
await FlutterGemma.initialize();
4043

44+
// Initialize notification service for reminders
45+
await NotificationService.instance.initialize();
46+
4147
log.i('Wingman app initialized');
4248

4349
runApp(

0 commit comments

Comments
 (0)