From 8e67c76c6d918fa424ed0d5813c07cedec536601 Mon Sep 17 00:00:00 2001 From: FSSCoding Date: Fri, 15 Aug 2025 22:17:08 +1000 Subject: [PATCH] Fix model visibility and config transparency for users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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! --- .mini-rag/config.yaml | 17 +++++++++++++++-- rag-mini.py | 37 +++++++++++++++++++++++++++++++++++++ rag-tui.py | 22 ++++++++++++++++++++-- 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/.mini-rag/config.yaml b/.mini-rag/config.yaml index 4f552fe..5d0a762 100644 --- a/.mini-rag/config.yaml +++ b/.mini-rag/config.yaml @@ -1,5 +1,18 @@ # 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 # Text chunking settings @@ -46,7 +59,7 @@ search: # LLM synthesis and query expansion settings llm: 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 max_expansion_terms: 8 # Maximum terms to add to queries enable_synthesis: false # Enable synthesis by default diff --git a/rag-mini.py b/rag-mini.py index de83aeb..b9acec8 100644 --- a/rag-mini.py +++ b/rag-mini.py @@ -310,6 +310,43 @@ def status_check(project_path: Path): except Exception as 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 last_search_file = rag_dir / 'last_search' if rag_dir.exists() else None diff --git a/rag-tui.py b/rag-tui.py index db389f8..f1ef851 100755 --- a/rag-tui.py +++ b/rag-tui.py @@ -79,12 +79,23 @@ class SimpleTUI: else: 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(): # Get the model that would be selected synthesizer._ensure_initialized() model = synthesizer.model - return "✅ Ready", 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 else: return "❌ Ollama not running", None except Exception as e: @@ -1401,6 +1412,13 @@ Your suggested question (under 10 words):""" print(f" ⚡ LLM synthesis: {'enabled' if config.llm.enable_synthesis else 'disabled'}") 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(" 1. Select AI model (Fast/Recommended/Quality)") print(" 2. Configure context window (Development/Production/Advanced)")