Instructions to use Navaneeth-14/rag-hackathon-app with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Navaneeth-14/rag-hackathon-app with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Navaneeth-14/rag-hackathon-app:Q4_K_M # Run inference directly in the terminal: llama cli -hf Navaneeth-14/rag-hackathon-app:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Navaneeth-14/rag-hackathon-app:Q4_K_M # Run inference directly in the terminal: llama cli -hf Navaneeth-14/rag-hackathon-app:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Navaneeth-14/rag-hackathon-app:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Navaneeth-14/rag-hackathon-app:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Navaneeth-14/rag-hackathon-app:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Navaneeth-14/rag-hackathon-app:Q4_K_M
Use Docker
docker model run hf.co/Navaneeth-14/rag-hackathon-app:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Navaneeth-14/rag-hackathon-app with Ollama:
ollama run hf.co/Navaneeth-14/rag-hackathon-app:Q4_K_M
- Unsloth Studio
How to use Navaneeth-14/rag-hackathon-app with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Navaneeth-14/rag-hackathon-app to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Navaneeth-14/rag-hackathon-app to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Navaneeth-14/rag-hackathon-app to start chatting
- Docker Model Runner
How to use Navaneeth-14/rag-hackathon-app with Docker Model Runner:
docker model run hf.co/Navaneeth-14/rag-hackathon-app:Q4_K_M
- Lemonade
How to use Navaneeth-14/rag-hackathon-app with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Navaneeth-14/rag-hackathon-app:Q4_K_M
Run and chat with the model
lemonade run user.rag-hackathon-app-Q4_K_M
List all available models
lemonade list
- Atomic Chat
| """ | |
| Quick Interactive Test for Integrated System | |
| Test the complete workflow with user input | |
| """ | |
| def quick_test(): | |
| """Quick interactive test of the integrated system""" | |
| print("๐ Quick Integration Test") | |
| print("="*40) | |
| print("Testing: Query Parser โ Vector Database โ LLM Reasoning") | |
| print("="*40) | |
| try: | |
| # Import components | |
| print("๐ Loading components...") | |
| from query_parser import AdvancedQueryParser | |
| from vector_database import VectorDatabase | |
| from llm_reasoning import AdvancedLLMReasoning | |
| print("โ Components loaded") | |
| # Initialize components | |
| print("๐ Initializing...") | |
| query_parser = AdvancedQueryParser(use_gpu=False) | |
| vector_db = VectorDatabase( | |
| collection_name="quick_test", | |
| embedding_model="all-MiniLM-L6-v2", | |
| persist_directory="./quick_test_db" | |
| ) | |
| # Try to initialize LLM reasoning | |
| try: | |
| reasoning_engine = AdvancedLLMReasoning(use_gpu=False) | |
| llm_available = True | |
| print("โ LLM reasoning available") | |
| except Exception as e: | |
| print(f"โ ๏ธ LLM reasoning not available: {e}") | |
| llm_available = False | |
| # Add sample documents | |
| print("๐ Adding sample documents...") | |
| sample_docs = [ | |
| { | |
| 'content': 'Heart surgery is covered up to $50,000 with 90-day waiting period.', | |
| 'metadata': {'source': 'policy.pdf', 'section': 'coverage'} | |
| }, | |
| { | |
| 'content': 'Dental treatment is covered up to $2,000 annually with 6-month waiting period.', | |
| 'metadata': {'source': 'policy.pdf', 'section': 'dental'} | |
| }, | |
| { | |
| 'content': 'To file a claim, you need: claim form, medical certificate, receipts, and bills.', | |
| 'metadata': {'source': 'claims.pdf', 'section': 'procedures'} | |
| } | |
| ] | |
| for doc in sample_docs: | |
| vector_db.add_document(doc['content'], doc['metadata']) | |
| print(f"โ Added {len(sample_docs)} documents") | |
| # Interactive testing | |
| print("\n๐ฏ Interactive Testing") | |
| print("="*30) | |
| print("Enter your queries (type 'quit' to exit):") | |
| while True: | |
| try: | |
| query = input("\nโ Your query: ").strip() | |
| if query.lower() in ['quit', 'exit', 'q']: | |
| break | |
| if not query: | |
| continue | |
| print(f"\n๐ Processing: {query}") | |
| print("-" * 40) | |
| # Step 1: Parse query | |
| print("๐ Step 1: Parsing query...") | |
| parsed = query_parser.parse_query(query) | |
| print(f" Type: {parsed.query_type}") | |
| print(f" Intent: {parsed.intent}") | |
| print(f" Confidence: {parsed.confidence:.2f}") | |
| if parsed.entities: | |
| print(f" Entities: {list(parsed.entities.keys())}") | |
| # Step 2: Search vector database | |
| print("\n๐ Step 2: Searching documents...") | |
| results = vector_db.search_documents(query, n_results=2, similarity_threshold=0.3) | |
| print(f" Found {len(results)} relevant documents") | |
| for i, result in enumerate(results, 1): | |
| print(f" {i}. Similarity: {result.get('similarity_score', 0):.2f}") | |
| print(f" Source: {result.get('source_file', 'Unknown')}") | |
| print(f" Content: {result.get('content', '')[:100]}...") | |
| # Step 3: LLM reasoning | |
| if llm_available and results: | |
| print("\n๐ง Step 3: LLM reasoning...") | |
| reasoning_result = reasoning_engine.analyze_query( | |
| query=query, | |
| context=results, | |
| query_type=parsed.query_type | |
| ) | |
| print(f" Decision: {reasoning_result.decision.upper()}") | |
| print(f" Confidence: {reasoning_result.confidence_score:.2f}") | |
| print(f" Justification: {reasoning_result.justification[:150]}...") | |
| if reasoning_result.amount: | |
| print(f" Amount: ${reasoning_result.amount:,.2f}") | |
| if reasoning_result.waiting_period: | |
| print(f" Waiting Period: {reasoning_result.waiting_period}") | |
| # Show explanation | |
| print(f"\n๐ Explanation:") | |
| explanation = reasoning_engine.explain_decision(reasoning_result) | |
| print(explanation) | |
| else: | |
| print("\n๐ง Step 3: LLM reasoning (not available)") | |
| print(" Query parsing and document search completed successfully") | |
| print("\n" + "="*50) | |
| except KeyboardInterrupt: | |
| print("\n\n๐ Goodbye!") | |
| break | |
| except Exception as e: | |
| print(f"\nโ Error processing query: {e}") | |
| # Cleanup | |
| print("\n๐งน Cleaning up...") | |
| import shutil | |
| if os.path.exists("./quick_test_db"): | |
| shutil.rmtree("./quick_test_db") | |
| print("โ Cleanup completed") | |
| print("\n๐ Quick test completed!") | |
| except Exception as e: | |
| print(f"โ Quick test failed: {e}") | |
| import traceback | |
| traceback.print_exc() | |
| def test_specific_query(query_text): | |
| """Test a specific query""" | |
| print(f"๐งช Testing specific query: {query_text}") | |
| print("="*50) | |
| try: | |
| from query_parser import AdvancedQueryParser | |
| from vector_database import VectorDatabase | |
| from llm_reasoning import AdvancedLLMReasoning | |
| # Initialize | |
| query_parser = AdvancedQueryParser(use_gpu=False) | |
| vector_db = VectorDatabase( | |
| collection_name="specific_test", | |
| embedding_model="all-MiniLM-L6-v2", | |
| persist_directory="./specific_test_db" | |
| ) | |
| # Add test document | |
| vector_db.add_document( | |
| "Heart surgery is covered up to $50,000 with 90-day waiting period.", | |
| {'source': 'test.pdf', 'type': 'coverage'} | |
| ) | |
| # Process query | |
| parsed = query_parser.parse_query(query_text) | |
| results = vector_db.search_documents(query_text, n_results=1) | |
| print(f"Query Type: {parsed.query_type}") | |
| print(f"Confidence: {parsed.confidence:.2f}") | |
| print(f"Search Results: {len(results)}") | |
| if results: | |
| print(f"Best Match: {results[0].get('content', '')[:100]}...") | |
| # Try LLM reasoning | |
| try: | |
| reasoning_engine = AdvancedLLMReasoning(use_gpu=False) | |
| reasoning_result = reasoning_engine.analyze_query( | |
| query_text, results, parsed.query_type | |
| ) | |
| print(f"LLM Decision: {reasoning_result.decision}") | |
| print(f"LLM Confidence: {reasoning_result.confidence_score:.2f}") | |
| except Exception as e: | |
| print(f"LLM Reasoning failed: {e}") | |
| # Cleanup | |
| import shutil | |
| if os.path.exists("./specific_test_db"): | |
| shutil.rmtree("./specific_test_db") | |
| except Exception as e: | |
| print(f"โ Test failed: {e}") | |
| if __name__ == "__main__": | |
| import os | |
| import sys | |
| # Check if specific query provided | |
| if len(sys.argv) > 1: | |
| query = " ".join(sys.argv[1:]) | |
| test_specific_query(query) | |
| else: | |
| quick_test() |