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
| #!/usr/bin/env python3 | |
| """ | |
| Test app2.py API Server | |
| This script tests the new app2.py Flask API server | |
| """ | |
| import requests | |
| import json | |
| import time | |
| # Your ngrok URL | |
| BASE_URL = "https://0468c638cef7.ngrok-free.app" | |
| def test_health(): | |
| """Test health endpoint""" | |
| print("π§ͺ Testing Health Endpoint...") | |
| try: | |
| response = requests.get(f"{BASE_URL}/api/health", timeout=10) | |
| print(f"Status: {response.status_code}") | |
| if response.status_code == 200: | |
| print("β Health check passed!") | |
| print(f"Response: {response.json()}") | |
| else: | |
| print(f"β Health check failed: {response.text}") | |
| return response.status_code == 200 | |
| except Exception as e: | |
| print(f"β Error: {e}") | |
| return False | |
| def test_root(): | |
| """Test root endpoint""" | |
| print("\nπ§ͺ Testing Root Endpoint...") | |
| try: | |
| response = requests.get(f"{BASE_URL}/", timeout=10) | |
| print(f"Status: {response.status_code}") | |
| if response.status_code == 200: | |
| print("β Root endpoint passed!") | |
| data = response.json() | |
| print(f"Message: {data.get('message')}") | |
| print(f"Version: {data.get('version')}") | |
| print(f"Endpoints: {len(data.get('endpoints', {}))} available") | |
| else: | |
| print(f"β Root endpoint failed: {response.text}") | |
| return response.status_code == 200 | |
| except Exception as e: | |
| print(f"β Error: {e}") | |
| return False | |
| def test_simple_query(): | |
| """Test simple query without document URL""" | |
| print("\nπ§ͺ Testing Simple Query...") | |
| url = f"{BASE_URL}/hackrx/run" | |
| headers = { | |
| "Content-Type": "application/json", | |
| "Accept": "application/json", | |
| "Authorization": "Bearer test_key_123" | |
| } | |
| payload = { | |
| "questions": [ | |
| "What is the grace period for premium payment?", | |
| "What is the waiting period for pre-existing diseases?" | |
| ] | |
| } | |
| try: | |
| response = requests.post(url, json=payload, headers=headers, timeout=60) | |
| print(f"Status: {response.status_code}") | |
| if response.status_code == 200: | |
| print("β Simple query passed!") | |
| result = response.json() | |
| print(f"Answers: {len(result.get('answers', []))} received") | |
| for i, answer in enumerate(result.get('answers', [])): | |
| print(f" {i+1}. {answer[:100]}...") | |
| else: | |
| print(f"β Simple query failed: {response.text}") | |
| return response.status_code == 200 | |
| except Exception as e: | |
| print(f"β Error: {e}") | |
| return False | |
| def test_hackathon_format(): | |
| """Test hackathon format with document URL""" | |
| print("\nπ§ͺ Testing Hackathon Format...") | |
| url = f"{BASE_URL}/hackrx/run" | |
| headers = { | |
| "Content-Type": "application/json", | |
| "Accept": "application/json", | |
| "Authorization": "Bearer test_key_123" | |
| } | |
| payload = { | |
| "documents": "https://hackrx.blob.core.windows.net/assets/policy.pdf?sv=2023-01-03&st=2025-07-04T09%3A11%3A24Z&se=2027-07-05T09%3A11%3A00Z&sr=b&sp=r&sig=N4a9OU0w0QXO6AOIBiu4bpl7AXvEZogeT%2FjUHNO7HzQ%3D", | |
| "questions": [ | |
| "What is the grace period for premium payment under the National Parivar Mediclaim Plus Policy?", | |
| "What is the waiting period for pre-existing diseases (PED) to be covered?", | |
| "Does this policy cover maternity expenses, and what are the conditions?", | |
| "What is the waiting period for cataract surgery?", | |
| "Are the medical expenses for an organ donor covered under this policy?" | |
| ] | |
| } | |
| try: | |
| print("β³ Processing (this may take 30-60 seconds)...") | |
| response = requests.post(url, json=payload, headers=headers, timeout=120) | |
| print(f"Status: {response.status_code}") | |
| if response.status_code == 200: | |
| print("β Hackathon format passed!") | |
| result = response.json() | |
| print(f"Answers: {len(result.get('answers', []))} received") | |
| for i, answer in enumerate(result.get('answers', [])): | |
| print(f" {i+1}. {answer[:100]}...") | |
| else: | |
| print(f"β Hackathon format failed: {response.text}") | |
| return response.status_code == 200 | |
| except Exception as e: | |
| print(f"β Error: {e}") | |
| return False | |
| def test_api_query(): | |
| """Test API query endpoint""" | |
| print("\nπ§ͺ Testing API Query Endpoint...") | |
| url = f"{BASE_URL}/api/query" | |
| headers = { | |
| "Content-Type": "application/json", | |
| "Accept": "application/json" | |
| } | |
| payload = { | |
| "query": "What is the grace period for premium payment?" | |
| } | |
| try: | |
| response = requests.post(url, json=payload, headers=headers, timeout=60) | |
| print(f"Status: {response.status_code}") | |
| if response.status_code == 200: | |
| print("β API query passed!") | |
| result = response.json() | |
| print(f"Answer: {result.get('answer', '')[:100]}...") | |
| print(f"Confidence: {result.get('confidence', 0)}") | |
| print(f"Processing time: {result.get('processing_time', 0):.2f}s") | |
| else: | |
| print(f"β API query failed: {response.text}") | |
| return response.status_code == 200 | |
| except Exception as e: | |
| print(f"β Error: {e}") | |
| return False | |
| def main(): | |
| """Run all tests""" | |
| print("π Testing app2.py API Server") | |
| print("=" * 50) | |
| print(f"Testing API at: {BASE_URL}") | |
| print("=" * 50) | |
| # Test health first | |
| if not test_health(): | |
| print("\nβ Health check failed! Make sure app2.py is running.") | |
| print("Run: python app2.py") | |
| return | |
| # Test root endpoint | |
| test_root() | |
| # Test simple query | |
| test_simple_query() | |
| # Test hackathon format | |
| test_hackathon_format() | |
| # Test API query | |
| test_api_query() | |
| print("\n" + "=" * 50) | |
| print("π APP2.PY TESTING GUIDE") | |
| print("=" * 50) | |
| print("1. Start the server:") | |
| print(" python app2.py") | |
| print() | |
| print("2. Health Check:") | |
| print(f" GET {BASE_URL}/api/health") | |
| print() | |
| print("3. Root Endpoint:") | |
| print(f" GET {BASE_URL}/") | |
| print() | |
| print("4. Simple Query:") | |
| print(f" POST {BASE_URL}/hackrx/run") | |
| print(" Headers: Content-Type: application/json") | |
| print(" Headers: Authorization: Bearer test_key_123") | |
| print(" Body: {\"questions\": [\"Your question here\"]}") | |
| print() | |
| print("5. Hackathon Format:") | |
| print(f" POST {BASE_URL}/hackrx/run") | |
| print(" Headers: Content-Type: application/json") | |
| print(" Headers: Authorization: Bearer test_key_123") | |
| print(" Body: {\"documents\": \"URL\", \"questions\": [\"Q1\", \"Q2\"]}") | |
| print() | |
| print("6. API Query:") | |
| print(f" POST {BASE_URL}/api/query") | |
| print(" Headers: Content-Type: application/json") | |
| print(" Body: {\"query\": \"Your question here\"}") | |
| print() | |
| print("7. Upload Document:") | |
| print(f" POST {BASE_URL}/hackrx/upload") | |
| print(" Body: form-data with 'file' field") | |
| print("=" * 50) | |
| if __name__ == "__main__": | |
| main() |