Skip to content

shreymisr/QueryGuard

Repository files navigation

QueryGuard 🔍🛡️

QueryGuard is an end-to-end Search Query Anomaly Detection system built with:

  • Isolation Forest for anomaly detection
  • FastAPI backend for model inference
  • Streamlit frontend for UI
  • MLflow (local) for tracking experiments (params, metrics, artifacts)

How to Run (Local)

  1. Create & activate virtual environment
# Windows
python -m venv myenv
myenv\Scripts\activate
  1. Install dependencies
pip install -r requirements-api.txt
pip install -r requirements-frontend.txt
pip install mlflow matplotlib
  1. Train model (optional)
python src/train_mlflow.py
  1. Start backend (FastAPI)
uvicorn api.main:app --reload
Backend docs:
http://127.0.0.1:8000/docs
  1. Start frontend (Streamlit)
streamlit run frontend/app.py
Frontend:
http://127.0.0.1:8501

How to Run (DockerHub Images - No Build)

  1. Pull images
docker pull shreymishr/queryguard-backend:latest
docker pull shreymishr/queryguard-frontend:latest
  1. Run using Docker Compose
#Make sure you have the file docker-compose.prod.yml (present in this repo root).
#From the folder containing it, run:

docker compose -f docker-compose.prod.yml up
  1. Open in browser
Frontend:
http://localhost:8501

Backend docs:
http://localhost:8000/docs

#To stop
docker compose -f docker-compose.prod.yml down

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors