You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-49Lines changed: 60 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,16 @@
5
5
> An end-to-end analytics and decision support system that combines predictive modeling (ML) and natural-language insight generation (LLM) for Daraz sellers.
6
6
7
7
---
8
+
## Project Overview & LLMOps Objectives
9
+
10
+
This project integrates **Machine Learning** and **Large Language Models (LLM)** into a unified pipeline to help sellers optimize their product listings.
11
+
12
+
### Core Objectives
13
+
-**Predictive Analytics:** Estimate product success scores based on metadata (Price, Ratings, Categories).
14
+
-**Context-Aware Chat:** Provide intelligent Q&A using **RAG (Retrieval-Augmented Generation)**.
15
+
-**LLMOps Automation:** CI/CD pipelines for testing, linting, and containerization.
16
+
-**Monitoring & Observability:** Track model drift, system health, and RAG metrics.
We implemented a custom **Policy Engine** (`src/app/guardrails.py`) that intercepts requests at two stages to ensure system safety and compliance.
118
+
119
+
### 1. Input Validation (Pre-RAG)
120
+
Before the User Query reaches the RAG system, it is scanned using Regex and Keyword Matching. If a rule is triggered, the API returns a `400 Bad Request` immediately, saving RAG computational costs.
121
+
122
+
***PII Detection:** Blocks Pakistani CNIC patterns (`\d{5}-\d{7}-\d{1}`) and Phone numbers to protect sensitive data.
The LLM's generated answer is scanned before being sent back to the user.
132
+
133
+
* **Toxicity Filter:** Checks against a ban-list of toxic/inappropriate terms.
134
+
* **Hallucination/Quality Check:** Flags responses that are unusually short or empty.
135
+
* **Action:** If triggered, the answer is replaced with a standard safety message ("I cannot answer this due to safety guidelines").
136
+
137
+
### 3. Observability
138
+
All events are logged to Prometheus using a custom counter `guardrail_events_total`, labeled by trigger type (`input_validation`, `output_moderation`).
139
+
81
140
82
141
## Monitoring
83
142
@@ -226,51 +285,3 @@ Answer 'Y' if prompted.
226
285
227
286
**Q: Pre-commit hook fails?**
228
287
**A:** Run pre-commit run --all-files locally. This will show you the errors and automatically fix many of them. Commit the changes made by the hooks.
We implemented a custom **Policy Engine** (`src/app/guardrails.py`) that intercepts requests at two stages to ensure system safety and compliance.
256
-
257
-
### 1. Input Validation (Pre-RAG)
258
-
Before the User Query reaches the RAG system, it is scanned using Regex and Keyword Matching. If a rule is triggered, the API returns a `400 Bad Request` immediately, saving RAG computational costs.
259
-
260
-
***PII Detection:** Blocks Pakistani CNIC patterns (`\d{5}-\d{7}-\d{1}`) and Phone numbers to protect sensitive data.
The LLM's generated answer is scanned before being sent back to the user.
270
-
271
-
* **Toxicity Filter:** Checks against a ban-list of toxic/inappropriate terms.
272
-
* **Hallucination/Quality Check:** Flags responses that are unusually short or empty.
273
-
* **Action:** If triggered, the answer is replaced with a standard safety message ("I cannot answer this due to safety guidelines").
274
-
275
-
### 3. Observability
276
-
All events are logged to Prometheus using a custom counter `guardrail_events_total`, labeled by trigger type (`input_validation`, `output_moderation`).
0 commit comments