CoolFace
Apppublic

Arif-Badhon/RAG-Observability-Platform

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
App README

RAG Observability Platform ๐Ÿš€

RAG Observability Platform - Project Summary

Project Overview

The RAG Observability Platform is a production-grade Retrieval-Augmented Generation (RAG) system that demonstrates advanced MLOps practices and hybrid cloud-local deployment strategies. It combines cutting-edge ML inference optimization (Apple Silicon GPU) with MLOps observability frameworks for enterprise-ready applications.


What This Project Does

Core Functionality

  1. 1.Local RAG Pipeline (Mac M4)
  2. 2.Ingests unstructured text documents
  3. 3.Chunks documents using recursive text splitting
  4. 4.Generates embeddings via sentence-transformers (optimized for Apple Silicon via MPS acceleration)
  5. 5.Stores embeddings in ChromaDB (local vector database)
  6. 6.Retrieves relevant context and generates answers using Llama 3.2 3B model via MLX
  1. 1.Cloud Deployment (Hugging Face Spaces)
  2. 2.Docker containerization for reproducible deployment
  3. 3.Automatic fallback to CPU-based inference when MLX unavailable
  4. 4.Streamlit web UI for interactive chat with documents
  5. 5.Graceful degradation: maintains functionality across platforms
  1. 1.Experiment Tracking (Dagshub + MLflow)
  2. 2.Logs all ingestion runs with parameters and metrics
  3. 3.Centralized experiment monitoring from local machine
  4. 4.Version control for code and data via Git + DVC
  5. 5.Remote MLflow server for team collaboration

Technical Highlights

  • โ€”Cross-Platform Optimization: Native M4 GPU (via MLX) for local development; CPU fallback for cloud
  • โ€”Infrastructure as Code: Docker + UV for reproducible environments
  • โ€”Modern Python Stack: LangChain (LCEL), Pydantic, asyncio-ready
  • โ€”MLOps Best Practices: Experiment tracking, dependency management, secrets handling ---

Key Highlight

  1. 1.GPU Optimization: Understand when to use specialized tools (MLX for Apple Silicon) vs. standard libraries (PyTorch)
  2. 2.Cross-Platform Development: Device abstraction, graceful fallbacks, testing on multiple architectures
  3. 3.Dependency Management: Using UV for faster resolution, managing optional dependencies (local vs. cloud groups)
  4. 4.MLOps Practices: Experiment tracking, versioning data + code, secrets management
  5. 5.Production Deployment: Docker best practices, environment variable injection, port mapping
  6. 6.Modern Python: Type hints, LangChain LCEL (functional composition), error handling
  7. 7.Troubleshooting: Resolved Python version mismatches, binary file handling in Git, device compatibility issues

Why This Project Stands Out

  • โ€”Full Stack: From local GPU optimization to cloud deployment
  • โ€”Senior-Level Considerations:
  • โ€”Device compatibility across platforms
  • โ€”Graceful degradation (MLX โ†’ Transformers fallback)
  • โ€”Secrets management without pushing .env
  • โ€”Experiment observability
  • โ€”Modern Tooling: UV (faster than pip), MLX (Apple Silicon optimization), LangChain LCEL (declarative chains)
  • โ€”Problem Solving: Resolved real-world issues (ONNX version compatibility, Docker base image mismatch, GPU device detection)

GitHub/Portfolio Presentation

Repository Structure (visible in your GitHub):

rag-observability-platform/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ ingestion/      (document loading, chunking, embedding)
โ”‚   โ”œโ”€โ”€ retrieval/      (RAG chain with LCEL)
โ”‚   โ””โ”€โ”€ generation/     (MLX wrapper, device handling)
โ”œโ”€โ”€ app/frontend/       (Streamlit UI)
โ”œโ”€โ”€ Dockerfile          (Cloud deployment)
โ”œโ”€โ”€ pyproject.toml      (UV dependency management)
โ””โ”€โ”€ README.md           (project documentation)

Git History (visible in commits):

  • โ€”Clean, semantic commits showing progression
  • โ€”Branching strategy: master โ†’ mvp โ†’ frontend/backend
  • โ€”Demonstrates collaborative workflow understanding

  1. 1."Why MLX instead of PyTorch?"
  2. 2.MLX is optimized for Apple Silicon; PyTorch CPU mode is 10x slower on M4
  1. 1."How do you handle the MLX import error in Docker?"
  2. 2.Try-except with fallback to transformers; dynamic device selection
  1. 1."Why use Dagshub for this portfolio project?"
  2. 2.Demonstrates understanding of MLOps practices; shows ability to connect local experiments to remote tracking
  1. 1."What would you do at scale?"
  2. 2.Move to managed inference (HF Inference API), DVC for larger datasets, Kubernetes for orchestration