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
Simple Flask API for RAG System
A simplified Flask API server that provides localhost access to the main.py RAG system functionality.
Features
- Localhost Only: Runs only on 127.0.0.1 (localhost)
- Simple Authentication: No authentication required for localhost use
- Core Operations: Document upload and query processing
- GET/POST Operations: Simple REST endpoints
API Endpoints
1. Health Check
GET http://127.0.0.1:5000/health
Check if the server is running.
Response:
{
"status": "healthy",
"rag_system_initialized": true
}
2. System Status
GET http://127.0.0.1:5000/hackrx/status
Check if the RAG system is ready.
Response:
{
"status": "ready",
"message": "RAG system is ready"
}
3. Document Upload
POST http://127.0.0.1:5000/hackrx/upload
Upload and process a document.
Form Data:
file: The document file to upload
Supported File Types:
- PDF (.pdf)
- Text (.txt)
- Word (.docx)
- HTML (.html, .htm)
- Email (.eml, .msg)
- CSV (.csv)
- JSON (.json)
Response:
{
"success": true,
"message": "Document processed successfully",
"chunks_processed": 45,
"processing_time": 2.34,
"filename": "document.pdf"
}
4. Query Processing
POST http://127.0.0.1:5000/hackrx/run
Process questions about uploaded documents.
Request Body:
{
"questions": [
"What is covered under this policy?",
"What is the maximum coverage amount?",
"What documents are required for claims?"
]
}
Response:
{
"answers": [
{
"question": "What is covered under this policy?",
"answer": "Based on the policy document, the following are covered...",
"decision": "COVERED",
"confidence": 0.85,
"processing_time": 1.23
}
]
}
Usage Examples
Python Example
import requests
import json
BASE_URL = "http://127.0.0.1:5000"
# 1. Upload a document
with open("document.pdf", "rb") as f:
files = {"file": f}
response = requests.post(f"{BASE_URL}/hackrx/upload", files=files)
print("Upload response:", response.json())
# 2. Process queries
questions = [
"What is covered under this policy?",
"What is the maximum coverage amount?"
]
payload = {"questions": questions}
response = requests.post(
f"{BASE_URL}/hackrx/run",
json=payload,
headers={"Content-Type": "application/json"}
)
answers = response.json()["answers"]
for answer in answers:
print(f"Q: {answer['question']}")
print(f"A: {answer['answer']}")
print(f"Decision: {answer['decision']}")
print(f"Confidence: {answer['confidence']}")
print("---")
cURL Examples
Health Check:
curl http://127.0.0.1:5000/health
System Status:
curl http://127.0.0.1:5000/hackrx/status
Upload Document:
curl -X POST -F "file=@document.pdf" http://127.0.0.1:5000/hackrx/upload
Process Queries:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"questions": ["What is covered under this policy?"]}' \
http://127.0.0.1:5000/hackrx/run
Running the Server
Start the server:
python app.pyTest the API:
python test_api.py
Error Responses
200: Success400: Bad Request (missing parameters, invalid data)500: Internal Server Error
Error response format:
{
"error": "Error description"
}
Notes
- Localhost Only: The server only accepts connections from localhost (127.0.0.1)
- No Authentication: No API keys or authentication required for localhost use
- Simple Interface: Focused on core document upload and query processing
- Automatic Cleanup: Uploaded files are automatically cleaned up after processing