Tài liệu này mô tả tất cả các dropdown menu đã được cải thiện trong ứng dụng QueryMaster RAG System.
Component: ModelSelector.tsx
Section: Mô hình AI (Sidebar)
Chọn nền tảng để chạy AI models (LLM và Embedding)
| Platform | Tên Hiển Thị | Description | Icon | Khi Nào Dùng |
|---|---|---|---|---|
huggingface |
Hugging Face | Chạy trên trình duyệt | 🖥️ | Không cần cài đặt gì, chạy trực tiếp trong browser |
ollama |
Ollama | Chạy trên máy cục bộ | 🖥️ | Đã cài Ollama, muốn chạy offline |
llamacpp |
LlamaCPP | Server cục bộ | 🖥️ | Có LlamaCPP server đang chạy |
- ✅ Label: "Nền tảng AI" (thay vì "Platform")
- ✅ Icon: Server icon cho mỗi platform
- ✅ Description: Giải thích ngắn gọn ở bên phải
- ✅ Layout: Two-column (tên + description)
- ✅ Disabled khi đang loading model
<Select value={selectedPlatform} onValueChange={handlePlatformChange}>
<SelectTrigger>
<SelectValue placeholder="Chọn nền tảng" />
</SelectTrigger>
<SelectContent>
<SelectItem value="huggingface">
<Server /> Hugging Face - Chạy trên trình duyệt
</SelectItem>
</SelectContent>
</Select>Component: ModelSelector.tsx
Section: Mô hình AI (Sidebar)
Chọn model ngôn ngữ lớn (Large Language Model) để xử lý queries
| Model ID | Tên Hiển Thị | Parameters | Use Case |
|---|---|---|---|
llama-3.1-sonar-small-128k-online |
Llama 3.1 Sonar Small | 8B | Truy vấn thông thường, nhanh |
llama-3.1-sonar-large-128k-online |
Llama 3.1 Sonar Large | 70B | Cân bằng speed vs accuracy |
llama-3.1-sonar-huge-128k-online |
Llama 3.1 Sonar Huge | 405B | Độ chính xác cao nhất |
local-embedding-model |
Local Embedding Model | Nhẹ | Offline, không cần internet |
bkai-vietnamese-encoder |
BKAI Vietnamese Encoder | Trung bình | Tối ưu tiếng Việt |
| Model ID | Tên Hiển Thị | Parameters | Yêu Cầu |
|---|---|---|---|
llama3:8b |
Llama 3 8B | 8B | Cài Ollama, pull model |
- ✅ Label: "Mô hình Ngôn ngữ (LLM)" (giải thích rõ hơn)
- ✅ Parameters badge: Hiển thị trong badge đẹp (8B, 70B, 405B)
- ✅ Info button: Tooltip "Xem thông tin chi tiết model"
- ✅ Empty state: Message khi không có model khả dụng
- ✅ Auto-filter: Chỉ hiện models của platform đã chọn
- ✅ Disabled khi loading
- Model 70B+: Cảnh báo nếu RAM < 8GB
- Màu amber alert với icon AlertCircle
- Message: "Model này yêu cầu nhiều RAM hơn"
Component: ModelSelector.tsx
Section: Mô hình AI (Sidebar)
Chọn model để chuyển văn bản thành vectors (embeddings) cho tìm kiếm semantic
| Model ID | Tên Hiển Thị | Description | Dimensions | Platform |
|---|---|---|---|---|
mixedbread-ai/mxbai-embed-small-v1 |
MXBai Embed Small | Đa ngôn ngữ, nhỏ | 384 | HuggingFace |
mixedbread-ai/mxbai-embed-large-v1 |
MXBai Embed Large | Đa ngôn ngữ, lớn | 1024 | HuggingFace |
mixedbread-ai/mxbai-embed-xsmall-v1 |
MXBai Embed XSmall | Cực nhỏ, thiết bị yếu | 256 | HuggingFace |
Xenova/all-MiniLM-L6-v2 |
MiniLM-L6-v2 ⭐ | Đa năng, gọn nhẹ | 384 | HuggingFace |
bkai-foundation-models/vietnamese-bi-encoder |
BKAI Vietnamese | Tối ưu tiếng Việt | 768 | HuggingFace |
- ✅ Label: "Mô hình Vector Embedding" (giải thích rõ)
- ✅ Two-line display: Tên + description
- ✅ Description trong dropdown item
- ✅ Tooltip: "Embedding models chuyển văn bản thành vector để tìm kiếm"
- ✅ Info button
- Mặc định:
Xenova/all-MiniLM-L6-v2(reliable, fast, 384D) - Tiếng Việt:
bkai-foundation-models/vietnamese-bi-encoder - Thiết bị yếu:
mixedbread-ai/mxbai-embed-xsmall-v1
Component: OcrConfigPanel.tsx
Section: Cấu hình OCR (Sidebar) → Dialog
Chọn độ phân giải để scan/OCR documents
| Value | Label | Description | DPI | Use Case |
|---|---|---|---|---|
low |
Thấp | Nhanh, 150 DPI | 150 | Văn bản rõ, cần speed |
medium |
Trung bình | Cân bằng, 300 DPI | 300 | ✅ Khuyến nghị (default) |
high |
Cao | Chính xác, 600 DPI | 600 | Văn bản mờ, cần quality |
- ✅ Radio buttons thay vì dropdown
- ✅ Hiển thị DPI values
- ✅ Font-weight bold cho label
- ✅ Gray color cho description
- ✅ Radio button size 4x4 (dễ click)
- ✅ Cursor pointer
- ✅ Label: "Độ phân giải quét"
- Mặc định: Medium (300 DPI) - cân bằng tốt
- Nhanh: Low nếu văn bản rõ ràng
- Chất lượng: High nếu scan từ giấy cũ/mờ
Component: OcrConfigPanel.tsx
Section: Cấu hình OCR (Sidebar) → Dialog
Chọn ngôn ngữ chính trong documents để OCR chính xác hơn
| Value | Display | Emoji | Use Case |
|---|---|---|---|
vietnamese |
🇻🇳 Tiếng Việt | 🇻🇳 | Tài liệu 100% tiếng Việt |
english |
🇬🇧 Tiếng Anh | 🇬🇧 | Tài liệu 100% English |
mixed |
🌐 Hỗn hợp (Việt + Anh) | 🌐 | ✅ Khuyến nghị - Văn bản kỹ thuật |
- ✅ Emoji cờ quốc gia
- ✅ Description chi tiết
- ✅ Focus ring màu xanh
- ✅ Tooltip: "Chọn ngôn ngữ chính trong tài liệu"
- ✅ Label: "Ngôn ngữ nhận diện"
- Mặc định: Mixed (hỗn hợp) - phù hợp tiêu chuẩn kỹ thuật VN
- Tiêu chuẩn xây dựng VN thường có cả Việt + English terms
Component: OcrConfigPanel.tsx
Section: Cấu hình OCR (Sidebar) → Dialog
Chọn ưu tiên giữa tốc độ và độ chính xác
| Value | Display | Emoji | Description | Use Case |
|---|---|---|---|---|
speed |
⚡ Tốc độ | ⚡ | Xử lý nhanh | Nhiều files, cần nhanh |
balanced |
⚖️ Cân bằng | ⚖️ | ✅ Khuyến nghị | Mặc định, phù hợp nhất |
accuracy |
🎯 Độ chính xác | 🎯 | Chậm hơn | Văn bản quan trọng |
- ✅ Emoji biểu tượng
- ✅ Description trong ngoặc
- ✅ Focus ring
- ✅ Tooltip: "Chọn ưu tiên giữa tốc độ và độ chính xác"
- ✅ Label: "Chế độ xử lý" (thay vì "Ưu tiên")
- Mặc định: Balanced (cân bằng)
- Batch import: Speed nếu có nhiều files
- Legal docs: Accuracy cho documents quan trọng
- ✅ Icons: Server, Info, Download icons với Lucide React
- ✅ Emojis: Cờ quốc gia 🇻🇳🇬🇧🌐 và symbols ⚡⚖️🎯
- ✅ Badges: Parameters trong rounded badge (8B, 70B)
- ✅ Two-line display: Name + description trong dropdown items
- ✅ Focus rings: Blue ring khi focus vào select/input
- ✅ Tooltips: Title attributes cho all buttons
- ✅ Cursor: Pointer cursor cho interactive elements
- ✅ Labels: Descriptive labels thay vì technical terms
- ✅ Placeholders: Clear placeholders cho empty state
- ✅ Tooltips: Giải thích function của mỗi control
- ✅ Disabled states: Visual feedback khi loading
- ✅ Empty states: Message khi không có options
- ✅ Help text: Descriptions ngay trong dropdown
- ✅ Vietnamese: All labels trong tiếng Việt
- ✅ Technical terms: Giải thích (LLM, Embedding, DPI)
- ✅ Use cases: Description cho mỗi option
- ✅ Recommendations: Khuyến nghị (⭐) cho best options
- ✅ Platform names: Full names thay vì codes
App.tsx
└── SidebarContent
├── FolderList
├── ModelSelector ← Platform, LLM, Embedding dropdowns
└── OcrConfigPanel ← Resolution, Language, Accuracy dropdowns
// Platform state
const [selectedPlatform, setSelectedPlatform] = useState<PlatformType>('ollama');
// Model states
const [selectedModel, setSelectedModel] = useState<AiModelType>('llama3:8b');
const [embeddingModel, setEmbeddingModel] = useState<EmbeddingModelType>('Xenova/all-MiniLM-L6-v2');
// OCR config state
const { config, updateConfig } = useOcrConfig();
// config: { resolution: 'medium', language: 'vietnamese', accuracy: 'balanced' }// Auto-filter models by selected platform
const filteredModels = getModelsByPlatform(selectedPlatform);
// If current model not in filtered list, switch to first available
if (!filteredModels.some(m => m.id === selectedModel)) {
setSelectedModel(filteredModels[0]?.id);
}-
Chọn Platform (Nền tảng AI)
- User opens app → sees "Hugging Face" pre-selected
- Can switch to Ollama if installed locally
-
Chọn LLM Model (Mô hình Ngôn ngữ)
- Dropdown auto-filters based on platform
- User sees parameters (8B, 70B) to make informed choice
- Click Info button to see full details
-
Chọn Embedding Model (Mô hình Vector)
- User sees description right in dropdown
- Default "MiniLM-L6-v2" pre-selected (reliable)
-
Load Models (Tải Models)
- Click "Tải LLM" button
- Click "Tải Embedding" button
- See progress spinner + toast notifications
-
Configure OCR (Optional)
- Click Settings icon
- Adjust resolution (default: Medium 300 DPI)
- Select language (default: Mixed)
- Choose accuracy (default: Balanced)
- Save config
-
Import Documents
- Models loaded → ready to process
- Upload files → RAG pipeline starts
- OCR settings applied automatically
- Clear Vietnamese label
- Helpful description/tooltip
- Visual indicators (icons/emojis)
- Default value pre-selected
- Disabled state when loading
- Empty state message
- Accessibility (titles, labels)
- Responsive design
- Consistent styling
- All dropdowns render correctly
- Platform filtering works
- Model info displays
- OCR config saves
- Tooltips show on hover
- Focus states visible
- Empty states handled
- Loading states show
- Search in dropdowns: Filter options by typing
- Model favorites: Star frequently used models
- Preset configs: Save/load OCR presets
- Model comparison: Side-by-side comparison view
- Usage stats: Show which models used most
- Auto-detect: Suggest best platform based on system
- Dark mode support for dropdowns
- Keyboard shortcuts (Ctrl+P for platform, etc.)
- Recent selections history
- Model recommendations based on document type
Last updated: October 5, 2025
Version: 1.0 - Post YOLO Mode Improvements
Status: ✅ All dropdowns verified and improved