Fix model visibility and config transparency for users

CRITICAL UX FIXES for beginners:

Model Display Issues Fixed:
- TUI now shows ACTUAL configured model, not hardcoded model
- CLI status command shows configured vs actual model with mismatch warnings
- Both TUI and CLI use identical model selection logic (no more inconsistency)

Config File Visibility Improved:
- Config file location prominently displayed in TUI configuration menu
- CLI status shows exact config file path (.mini-rag/config.yaml)
- Added clear documentation in config file header about model settings
- Users can now easily find and edit YAML file for direct configuration

User Trust Restored:
-  Shows 'Using configured: qwen3:1.7b' when config matches reality
- ⚠️ Shows 'Model mismatch!' when config differs from actual
- Config changes now immediately visible in status displays

No more 'I changed the config but nothing happened' confusion!
This commit is contained in:
FSSCoding 2025-08-15 22:17:08 +10:00
parent 75b5175590
commit 8e67c76c6d
3 changed files with 72 additions and 4 deletions

View File

@ -1,5 +1,18 @@
# FSS-Mini-RAG Configuration # FSS-Mini-RAG Configuration
# Edit this file to customize indexing and search behavior #
# 🔧 EDIT THIS FILE TO CUSTOMIZE YOUR RAG SYSTEM
#
# This file controls all behavior of your Mini-RAG system.
# Changes take effect immediately - no restart needed!
#
# 💡 IMPORTANT: To change the AI model, edit the 'synthesis_model' line below
#
# Common model options:
# synthesis_model: auto # Let system choose best available
# synthesis_model: qwen3:0.6b # Ultra-fast (500MB)
# synthesis_model: qwen3:1.7b # Balanced (1.4GB) - recommended
# synthesis_model: qwen3:4b # High quality (2.5GB)
#
# See docs/GETTING_STARTED.md for detailed explanations # See docs/GETTING_STARTED.md for detailed explanations
# Text chunking settings # Text chunking settings
@ -46,7 +59,7 @@ search:
# LLM synthesis and query expansion settings # LLM synthesis and query expansion settings
llm: llm:
ollama_host: localhost:11434 ollama_host: localhost:11434
synthesis_model: auto # 'auto', 'qwen3:1.7b', etc. synthesis_model: qwen3:1.7b # 'auto', 'qwen3:1.7b', etc.
expansion_model: auto # Usually same as synthesis_model expansion_model: auto # Usually same as synthesis_model
max_expansion_terms: 8 # Maximum terms to add to queries max_expansion_terms: 8 # Maximum terms to add to queries
enable_synthesis: false # Enable synthesis by default enable_synthesis: false # Enable synthesis by default

View File

@ -311,6 +311,43 @@ def status_check(project_path: Path):
except Exception as e: except Exception as e:
print(f" ❌ Status check failed: {e}") print(f" ❌ Status check failed: {e}")
print()
# Check LLM status and show actual vs configured model
print("🤖 LLM System:")
try:
from mini_rag.config import ConfigManager
config_manager = ConfigManager(project_path)
config = config_manager.load_config()
synthesizer = LLMSynthesizer(
model=config.llm.synthesis_model if config.llm.synthesis_model != "auto" else None,
config=config
)
if synthesizer.is_available():
synthesizer._ensure_initialized()
actual_model = synthesizer.model
config_model = config.llm.synthesis_model
if config_model == "auto":
print(f" ✅ Auto-selected: {actual_model}")
elif config_model == actual_model:
print(f" ✅ Using configured: {actual_model}")
else:
print(f" ⚠️ Model mismatch!")
print(f" Configured: {config_model}")
print(f" Actually using: {actual_model}")
print(f" (Configured model may not be installed)")
print(f" Config file: {config_manager.config_path}")
else:
print(" ❌ Ollama not available")
print(" Start with: ollama serve")
except Exception as e:
print(f" ❌ LLM status check failed: {e}")
# Show last search if available # Show last search if available
last_search_file = rag_dir / 'last_search' if rag_dir.exists() else None last_search_file = rag_dir / 'last_search' if rag_dir.exists() else None
if last_search_file and last_search_file.exists(): if last_search_file and last_search_file.exists():

View File

@ -79,11 +79,22 @@ class SimpleTUI:
else: else:
config = RAGConfig() config = RAGConfig()
synthesizer = LLMSynthesizer(config=config) # Create synthesizer with proper model configuration (same as main CLI)
synthesizer = LLMSynthesizer(
model=config.llm.synthesis_model if config.llm.synthesis_model != "auto" else None,
config=config
)
if synthesizer.is_available(): if synthesizer.is_available():
# Get the model that would be selected # Get the model that would be selected
synthesizer._ensure_initialized() synthesizer._ensure_initialized()
model = synthesizer.model model = synthesizer.model
# Show what config says vs what's actually being used
config_model = config.llm.synthesis_model
if config_model != "auto" and config_model != model:
# Config specified a model but we're using a different one
return "⚠️ Model mismatch", f"{model} (config: {config_model})"
else:
return "✅ Ready", model return "✅ Ready", model
else: else:
return "❌ Ollama not running", None return "❌ Ollama not running", None
@ -1401,6 +1412,13 @@ Your suggested question (under 10 words):"""
print(f" ⚡ LLM synthesis: {'enabled' if config.llm.enable_synthesis else 'disabled'}") print(f" ⚡ LLM synthesis: {'enabled' if config.llm.enable_synthesis else 'disabled'}")
print() print()
# Show config file location prominently
config_path = config_manager.config_path
print("📁 Configuration File Location:")
print(f" {config_path}")
print(" 💡 Edit this YAML file directly for advanced settings")
print()
print("🛠️ Quick Configuration Options:") print("🛠️ Quick Configuration Options:")
print(" 1. Select AI model (Fast/Recommended/Quality)") print(" 1. Select AI model (Fast/Recommended/Quality)")
print(" 2. Configure context window (Development/Production/Advanced)") print(" 2. Configure context window (Development/Production/Advanced)")