Spaces:
Sleeping
Sleeping
File size: 21,270 Bytes
8fec90e e63b3ab b8a0f1b e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab fc72b2a e63b3ab fc72b2a e63b3ab fc72b2a e63b3ab 2215d95 e63b3ab 3e14763 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 4a3f117 e63b3ab 2215d95 e63b3ab 2215d95 e63b3ab 268a4fa e63b3ab 09c4e61 e63b3ab 268a4fa e63b3ab 2215d95 e63b3ab 2215d95 fc72b2a 2215d95 e63b3ab fc72b2a e63b3ab 900c573 fc72b2a 3e14763 fc72b2a e63b3ab 900c573 e63b3ab fc72b2a 900c573 e63b3ab fc72b2a e63b3ab 900c573 3e14763 fc72b2a e63b3ab 268a4fa e63b3ab 268a4fa e63b3ab 900c573 e63b3ab 900c573 268a4fa e63b3ab 268a4fa 2215d95 fc72b2a 2215d95 e63b3ab 2215d95 900c573 2215d95 e63b3ab 2215d95 e63b3ab 2215d95 fc72b2a 4a3f117 e63b3ab fc72b2a 900c573 e63b3ab fc72b2a 900c573 e63b3ab | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | ---
title: CodeSage
emoji: ๐ง
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: "1.35.0"
app_file: demo.py
pinned: false
---
<div align="center">
<!-- Animated Banner -->
<img width="100%" src="https://capsule-render.vercel.app/api?type=waving&color=gradient&customColorList=6,11,20&height=200§ion=header&text=CodeSage%20๐ง&fontSize=60&fontColor=fff&animation=twinkling&fontAlignY=35&desc=LLM%20vs%20RAG%20vs%20Fine-Tuning%20โ%20Live%20Trade-off%20Platform&descAlignY=60&descSize=18" />
<!-- Typing SVG -->
<img src="https://readme-typing-svg.demolab.com?font=Fira+Code&weight=700&size=22&pause=1200&color=A78BFA¢er=true&vCenter=true&multiline=true&repeat=true&width=700&height=60&lines=Same+Question.+Three+Architectures.+Real+Numbers." alt="Typing SVG" />
<br/>
<!-- Primary Badges -->
<p align="center">
<a href="https://github.com/Adityax-07/LLM-vs-RAG-vs-Fine-Tuning-/stargazers">
<img src="https://img.shields.io/github/stars/Adityax-07/LLM-vs-RAG-vs-Fine-Tuning-?style=for-the-badge&logo=starship&color=f59e0b&logoColor=white&labelColor=1a1a2e" />
</a>
<a href="https://github.com/Adityax-07/LLM-vs-RAG-vs-Fine-Tuning-/network/members">
<img src="https://img.shields.io/github/forks/Adityax-07/LLM-vs-RAG-vs-Fine-Tuning-?style=for-the-badge&logo=git&color=8b5cf6&logoColor=white&labelColor=1a1a2e" />
</a>
<img src="https://img.shields.io/badge/License-MIT-22c55e?style=for-the-badge&logo=opensourceinitiative&logoColor=white&labelColor=1a1a2e" />
<img src="https://img.shields.io/badge/Status-Production%20Ready-22c55e?style=for-the-badge&logo=checkmarx&logoColor=white&labelColor=1a1a2e" />
<img src="https://img.shields.io/badge/Python-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a2e" />
</p>
<!-- Live Demo Button -->
<p align="center">
<a href="https://huggingface.co/spaces/Adityax-07/CodeSage">
<img src="https://img.shields.io/badge/๐ค%20Live%20Demo-Try%20CodeSage%20on%20HF%20Spaces-FFD21E?style=for-the-badge&labelColor=1a1a2e" />
</a>
</p>
<!-- Tech Stack Badges -->
<p align="center">
<img src="https://img.shields.io/badge/Streamlit-FF4B4B?style=for-the-badge&logo=streamlit&logoColor=white" />
<img src="https://img.shields.io/badge/LangChain-1C3C3C?style=for-the-badge&logo=langchain&logoColor=white" />
<img src="https://img.shields.io/badge/Groq_API-F55036?style=for-the-badge&logo=groq&logoColor=white" />
<img src="https://img.shields.io/badge/HuggingFace-FFD21E?style=for-the-badge&logo=huggingface&logoColor=black" />
<img src="https://img.shields.io/badge/FAISS-0467DF?style=for-the-badge&logo=meta&logoColor=white" />
<img src="https://img.shields.io/badge/LoRA%2FPEFT-EF4444?style=for-the-badge&logo=pytorch&logoColor=white" />
<img src="https://img.shields.io/badge/Plotly-3F4F75?style=for-the-badge&logo=plotly&logoColor=white" />
<img src="https://img.shields.io/badge/Google_Colab-F9AB00?style=for-the-badge&logo=googlecolab&logoColor=black" />
</p>
<!-- Skill Icons -->
<p align="center">
<img src="https://skillicons.dev/icons?i=python,pytorch,tensorflow,git,github,vscode&theme=dark" />
</p>
<br/>
<blockquote>
๐งช <strong>CodeSage</strong> is a live, side-by-side AI research platform that fires the same programming question at three fundamentally different architectures โ <strong>Baseline LLM</strong>, <strong>RAG</strong>, and <strong>Fine-Tuning</strong> โ then auto-scores every answer on accuracy, hallucination, groundedness, relevance, and cost.<br/><br/>
No cherry-picking. No manual grading. <strong>Real numbers, real trade-offs.</strong>
</blockquote>
<br/>
<!-- Quick stats strip -->
<p align="center">
<img src="https://img.shields.io/badge/50-Benchmark%20Questions-8b5cf6?style=flat-square" />
<img src="https://img.shields.io/badge/3-AI%20Systems%20Compared-06b6d4?style=flat-square" />
<img src="https://img.shields.io/badge/8-Auto%20Eval%20Metrics-f59e0b?style=flat-square" />
<img src="https://img.shields.io/badge/85.3%25-Fine--Tune%20Accuracy-22c55e?style=flat-square" />
<img src="https://img.shields.io/badge/0%25-Hallucination%20Rate-ef4444?style=flat-square" />
</p>
</div>
## ๐ Table of Contents
| | Section |
|:---:|:---|
| โก | [Benchmark Results](#-benchmark-results) |
| ๐ง | [What is CodeSage?](#-what-is-codesage) |
| โจ | [Features](#-features) |
| ๐๏ธ | [Architecture](#๏ธ-architecture) |
| ๐ | [Evaluation Pipeline](#-evaluation-pipeline) |
| ๐ | [Quick Start](#-quick-start) |
| ๐ | [Knowledge Base](#-knowledge-base) |
| ๐ก | [Decision Guide](#-decision-guide) |
| ๐ ๏ธ | [Tech Stack](#๏ธ-tech-stack) |
| ๐๏ธ | [Project Structure](#๏ธ-project-structure) |
| ๐ฎ | [Roadmap](#-roadmap) |
## โก Benchmark Results
> **Full evaluation:** `3 systems` ร `50 Q&A pairs` ร `8 metrics` โ fully automated, zero manual grading
| ๐ Metric | ๐ต Baseline LLM | ๐ข RAG Chatbot | ๐ฃ Fine-Tuned (Qwen2.5 + LoRA) |
|:---|:---:|:---:|:---:|
| ๐ฏ **Answer Accuracy** | 61.4% | 81.6% | **85.3% โจ** |
| ๐ซ **Hallucination Rate** | 43.2% โ | 9.8% | **0.0% โจ** |
| ๐ **Answer Relevance** | 0.714 | 0.768 | **0.891 โจ** |
| ๐ **Groundedness** | โ | **0.87 โจ** | โ |
| โก **Avg Latency** | ~1.2s | ~2.1s | **~0.4s โจ** |
| ๐ฐ **Cost / Query** | ~$0.0020 | ~$0.0030 | **$0.0002 โจ** |
### ๐ Key Findings
| Insight | Detail |
|:---|:---|
| ๐ซ **Hallucination gap** | Baseline hallucinates on `43.2%` of questions โ Fine-Tuning eliminates this entirely โ `0%` |
| ๐ **RAG cuts hallucination 4.4ร** | From `43.2%` โ `9.8%` purely through grounded retrieval, no retraining needed |
| ๐ฐ **Fine-Tuning is 10ร cheaper** | `$0.0002` vs `~$0.002` per query โ smaller model, fully local inference |
| โก **Fine-Tuning is 3ร faster** | `0.4s` vs `1.2s` โ no retrieval pipeline, no large-model API round-trip |
| ๐ฏ **No universal winner** | RAG wins on updatability ยท Fine-Tuning wins on cost/speed/precision ยท Baseline wins on zero-setup |
## ๐ง What is CodeSage?
CodeSage is a **decision-making tool** for AI engineers. When building a domain-specific assistant, you always hit the same three-way fork:
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Domain-Specific AI Assistant โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ BASELINE LLM โ โ RAG PIPELINE โ โ FINE-TUNING โ
โ โ โ โ โ โ
โ + Zero setup โ โ + Always fresh โ โ + 10x cheaper โ
โ + Broad topics โ โ + Grounded โ โ + 0% hallucin. โ
โ - Hallucinates โ โ - Retrieval lag โ โ - Hard to update โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
```
> CodeSage makes this trade-off **visible and measurable** โ same question, same moment, real output from all three.
---
## โจ Features
<div align="center">
<table>
<tr>
<td align="center" width="220">
<strong>๐ Side-by-Side Compare</strong><br/><br/>
Three answers to one question,<br/>simultaneously, in one view
</td>
<td align="center" width="220">
<strong>๐ Auto Evaluation</strong><br/><br/>
8-metric LLM-as-Judge scores<br/>every response automatically
</td>
<td align="center" width="220">
<strong>๐ Winner Badge</strong><br/><br/>
Best answer highlighted;<br/>hallucination flag raised on low-confidence
</td>
</tr>
<tr>
<td align="center">
<strong>๐ Analytics Dashboard</strong><br/><br/>
Plotly charts + paper-style TABLE II<br/>aggregated over 50 benchmarks
</td>
<td align="center">
<strong>๐พ Persistent Cache</strong><br/><br/>
Results stored in <code>benchmark_cache.json</code><br/>โ instant reload, no re-running
</td>
<td align="center">
<strong>๐ PDF Ingestion</strong><br/><br/>
Drop any PDF into <code>data/pdfs/</code><br/>โ RAG ingests it automatically
</td>
</tr>
</table>
</div>
---
## ๐๏ธ Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฅ๏ธ Streamlit UI โ
โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ โก System 1 โ โ ๐ System 2 โ โ ๐ง System 3 โ โ
โ โ Baseline LLM โ โ RAG Pipeline โ โ Fine-Tuned โ โ
โ โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โ
โโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ
โ Groq API โ โ FAISS Index โ โ Qwen2.5-1.5B โ
โ Llama-3.1-8Bโ โ all-MiniLM-L6-v2 โ โ + LoRA Adapters โ
โ (zero-shot) โ โ (top-3 chunks) โ โ (PEFT, local) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ
โ
Groq API (with context)
โ
โโโโโโโโโโโผโโโโโโโโโโโ
โ ๐๏ธ LLM-as-Judge โ
โ 8 metrics, auto โ
โโโโโโโโโโโโโโโโโโโโโโ
```
### โก System 1 โ Baseline LLM
Sends the question directly to **Llama-3.1-8B** via Groq with a minimal system prompt. No extra knowledge. Represents what an off-the-shelf LLM can do โ the floor every other system must beat.
### ๐ System 2 โ RAG Pipeline
1. Question โ `all-MiniLM-L6-v2` embedding
2. Top-3 chunks retrieved from **FAISS** vector store (17 documents)
3. Chunks injected as context into **Llama-3.1-8B** via Groq
4. Groundedness scored โ answers must be traceable to retrieved text
### ๐ง System 3 โ Fine-Tuned Model
**Qwen2.5-1.5B** fine-tuned with **LoRA** (`r=8, ฮฑ=32`) on curated CS Q&A pairs via Google Colab T4 GPU. Adapters loaded locally via `peft` โ zero cloud inference cost, sub-second latency.
---
## ๐ Evaluation Pipeline
Each answer is auto-scored by an LLM judge across **8 dimensions**:
| Icon | Metric | Description | Unit |
|:---:|:---|:---|:---:|
| ๐ฏ | **Answer Accuracy** | Cosine similarity of answer vs reference embedding | % |
| ๐ | **Groundedness** | Cosine similarity of answer vs retrieved context | 0โ1 |
| ๐ซ | **Hallucination Rate** | % of answers with accuracy < 0.5 | % |
| ๐ | **Answer Relevance** | Cosine similarity of answer vs question | 0โ1 |
| ๐ | **Faithfulness (ROUGE-L)** | Token overlap with source context or reference | 0โ1 |
| โฑ๏ธ | **Avg Response Time** | Mean latency per query | sec |
| ๐ฐ | **Cost per Query** | Token-count-based cost estimate | USD |
| โญ | **Overall Score** | 30% Acc + 20% Ground + 20% (1โHR) + 15% Rel + 15% Faith | 1โ5 |
---
## ๐ Quick Start
### `Step 1` โ Clone & Install
```bash
git clone https://github.com/Adityax-07/LLM-vs-RAG-vs-Fine-Tuning-.git
cd LLM-vs-RAG-vs-Fine-Tuning-
pip install -r requirements.txt
```
### `Step 2` โ Configure API Key
```bash
echo "GROQ_API_KEY=your_key_here" > .env
```
> ๐ Free key at [console.groq.com](https://console.groq.com)
### `Step 3` โ Launch
```bash
streamlit run demo.py
```
> FAISS vector store builds automatically on first launch. **Systems 1 & 2 are ready instantly.**
### `Step 4` โ (Optional) Activate Fine-Tuned Model
```bash
python -c "
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-1.5B-Instruct')
model = PeftModel.from_pretrained(base, 'checkpoint-25')
model.merge_and_unload().save_pretrained('finetuned_model')
AutoTokenizer.from_pretrained('checkpoint-25').save_pretrained('finetuned_model')
"
```
> Or open `system3_finetune_colab.ipynb` in **Google Colab** to train from scratch on a free T4 GPU (~10 min).
### `Step 5` โ Regenerate Benchmark *(optional)*
```bash
# Pre-computed results already included in data/benchmark_cache.json
python run_benchmark.py
```
---
## ๐ Knowledge Base
The RAG system retrieves from **17 hand-crafted topic documents** in `data/docs/`:
<div align="center">
<table>
<tr>
<td valign="top" width="33%">
<strong>๐งฎ Algorithms & DSA</strong><br/><br/>
<code>binary_search</code><br/>
<code>sorting_algorithms</code><br/>
<code>dynamic_programming</code><br/>
<code>graph_algorithms</code><br/>
<code>trees</code><br/>
<code>linked_list</code><br/>
<code>stack_queue</code><br/>
<code>recursion</code><br/>
<code>backtracking</code>
</td>
<td valign="top" width="33%">
<strong>๐ More DSA</strong><br/><br/>
<code>greedy_algorithms</code><br/>
<code>hashing</code><br/>
<code>string_algorithms</code><br/>
<code>two_pointers</code><br/>
<code>big_o_notation</code><br/>
<code>heaps</code>
</td>
<td valign="top" width="33%">
<strong>๐ Web & Tooling</strong><br/><br/>
<code>react_hooks</code><br/>
<code>rest_api</code><br/>
<code>javascript_promises</code><br/>
<code>css_flexbox</code><br/>
<code>typescript_basics</code><br/>
<code>sql_basics</code><br/>
<code>git_basics</code>
</td>
</tr>
</table>
</div>
---
## ๐ก Decision Guide
| ๐ค Situation | โ
Best Choice | ๐ Why |
|:---|:---:|:---|
| Prototyping or general queries | **Baseline LLM** | Zero setup, covers broad topics well |
| Knowledge changes frequently | **RAG** | Update docs without retraining |
| Fixed domain, cost/latency matters | **Fine-Tuning** | 10ร cheaper, 3ร faster, 0% hallucination |
| Need citations & traceability | **RAG** | Groundedness score + visible source chunks |
| Production with tight latency SLA | **Fine-Tuning** | Local inference, no API round-trip |
---
## ๐ ๏ธ Tech Stack
<div align="center">
<table>
<tr>
<th>Layer</th>
<th>Technology</th>
<th>Purpose</th>
</tr>
<tr>
<td>๐ <strong>UI</strong></td>
<td>
<img src="https://img.shields.io/badge/Streamlit-FF4B4B?style=flat-square&logo=streamlit&logoColor=white" />
<img src="https://img.shields.io/badge/Plotly-3F4F75?style=flat-square&logo=plotly&logoColor=white" />
</td>
<td>3-way comparison dashboard + analytics charts</td>
</tr>
<tr>
<td>โก <strong>LLM</strong></td>
<td><img src="https://img.shields.io/badge/Groq_API-F55036?style=flat-square&logo=groq&logoColor=white" /></td>
<td>Llama-3.1-8B โ Baseline + RAG generation</td>
</tr>
<tr>
<td>๐ค <strong>Embeddings</strong></td>
<td><img src="https://img.shields.io/badge/sentence--transformers-FFD21E?style=flat-square&logo=huggingface&logoColor=black" /></td>
<td><code>all-MiniLM-L6-v2</code> โ RAG semantic retrieval</td>
</tr>
<tr>
<td>๐ <strong>Vector DB</strong></td>
<td><img src="https://img.shields.io/badge/FAISS-0467DF?style=flat-square&logo=meta&logoColor=white" /></td>
<td>CPU-based semantic search over knowledge base</td>
</tr>
<tr>
<td>๐ง <strong>Fine-Tuning</strong></td>
<td>
<img src="https://img.shields.io/badge/PEFT%2FLoRA-EF4444?style=flat-square&logo=pytorch&logoColor=white" />
<img src="https://img.shields.io/badge/Transformers-FFD21E?style=flat-square&logo=huggingface&logoColor=black" />
</td>
<td>LoRA adapter (r=8, ฮฑ=32) on Qwen2.5-1.5B</td>
</tr>
<tr>
<td>๐๏ธ <strong>Base Model</strong></td>
<td><img src="https://img.shields.io/badge/Qwen2.5--1.5B-FFD21E?style=flat-square&logo=huggingface&logoColor=black" /></td>
<td>Alibaba's compact LLM โ LoRA fine-tuned locally</td>
</tr>
<tr>
<td>โ๏ธ <strong>Training</strong></td>
<td><img src="https://img.shields.io/badge/Google_Colab-F9AB00?style=flat-square&logo=googlecolab&logoColor=black" /></td>
<td>Free T4 GPU โ LoRA training in ~10 minutes</td>
</tr>
<tr>
<td>๐ <strong>Orchestration</strong></td>
<td><img src="https://img.shields.io/badge/LangChain-1C3C3C?style=flat-square&logo=langchain&logoColor=white" /></td>
<td>RAG pipeline, FAISS integration, PDF ingestion</td>
</tr>
<tr>
<td>๐ <strong>Metrics</strong></td>
<td><img src="https://img.shields.io/badge/rouge--score-EF4444?style=flat-square&logo=python&logoColor=white" /></td>
<td>ROUGE-L + cosine similarity for auto-evaluation</td>
</tr>
</table>
</div>
---
## ๐๏ธ Project Structure
```
๐ฆ LLM-vs-RAG-vs-Fine-Tuning/
โ
โโโ ๐ demo.py โ Streamlit app (main entry point)
โโโ ๐ system1_baseline.py โ Baseline LLM via Groq API
โโโ ๐ system2_rag.py โ RAG pipeline: FAISS + LangChain + Groq
โโโ ๐ system3_inference.py โ Fine-tuned model inference (PEFT)
โโโ ๐ system3_finetune_colab.ipynb โ LoRA training notebook (Colab T4)
โโโ ๐ evaluate.py โ Standalone evaluation script
โโโ ๐ run_benchmark.py โ Regenerates benchmark_cache.json
โ
โโโ ๐ checkpoint-25/ โ Trained LoRA weights (included)
โ โโโ adapter_model.safetensors
โ โโโ adapter_config.json โ r=8, alpha=32
โ โโโ tokenizer.json
โ
โโโ ๐ finetuned_model/ โ Merged model (after merge step)
โ
โโโ ๐ data/
โ โโโ ๐ docs/ โ 17 knowledge base .txt files
โ โโโ ๐ faiss_index/ โ FAISS vector store (auto-built)
โ โโโ ๐ pdfs/ โ Drop PDFs here for RAG ingestion
โ โโโ benchmark_cache.json โ Pre-computed 50Q benchmark results
โ โโโ reference_answers.json โ Ground-truth Q&A pairs
โ โโโ finetune_data.jsonl โ LoRA training data (ChatML format)
โ
โโโ ๐ requirements.txt
```
---
## ๐ฎ Roadmap
| Status | Feature |
|:---:|:---|
| โ
| 50-question auto-benchmark with persistent cache |
| โ
| LoRA fine-tune checkpoint (`checkpoint-25`) included |
| โ
| Analytics dashboard with Plotly + TABLE II |
| โ
| PDF ingestion into RAG knowledge base |
| ๐ | Push Qwen2.5 LoRA adapter to HuggingFace Hub |
| ๐ | Full 3-system live demo on HuggingFace Spaces |
| ๐ | Expand knowledge base: 17 โ 50+ documents |
| ๐ | RAGAS-style faithfulness + context precision metrics |
| ๐ | Custom knowledge base upload via Streamlit UI |
---
<!-- Wave footer -->
<img width="100%" src="https://capsule-render.vercel.app/api?type=waving&color=gradient&customColorList=6,11,20&height=120§ion=footer" />
<div align="center">
<strong>Built with ๐ง by <a href="https://github.com/Adityax-07">Adityax-07</a></strong>
<br/>
<em>Powered by Groq ยท HuggingFace ยท FAISS ยท LangChain ยท Streamlit</em>
<br/><br/>
<a href="https://github.com/Adityax-07">
<img src="https://img.shields.io/badge/GitHub-Adityax--07-181717?style=for-the-badge&logo=github&logoColor=white" />
</a>
<br/><br/>
โญ <strong>If CodeSage helped you understand the LLM trade-off space, drop a star!</strong>
</div>
|