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
File size: 8,042 Bytes
09281fe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | """
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() |