Views
No views yet
🟡 This is the GGUF-quantized version — for CPU inference via Ollama or llama.cpp. For full-precision inference see the Merged Model · For lightweight adapter loading see the Adapter.
GSMS-B/Indian-Legal-Qwen2.5-3B, a domain-adapted model fine-tuned using QLoRA on a structured question-answer dataset covering all 1,059 sections of India's three landmark 2023 criminal justice reform acts:| Act | Full Name | Replaces | Sections |
|---|---|---|---|
| 📕 BNS 2023 | Bharatiya Nyaya Sanhita | IPC 1860 | 358 |
| 📗 BNSS 2023 | Bharatiya Nagarik Suraksha Sanhita | CrPC 1973 | 531 |
| 📘 BSA 2023 | Bharatiya Sakshya Adhiniyam | Indian Evidence Act 1872 | 170 |
llama.cpp or Ollama.| Variant | Repo | Best For |
|---|---|---|
| 🟢 Merged | GSMS-B/Indian-Legal-Qwen2.5-3B | Out-of-the-box inference, Gradio / API deployment |
| 🔵 LoRA Adapter | GSMS-B/Indian-Legal-Qwen2.5-3B-Adapter | Lightweight loading on top of base model |
| 🟡 GGUF (this repo) | GSMS-B/Indian-Legal-Qwen2.5-3B-GGUF | CPU inference via Ollama / llama.cpp |
ollama run hf.co/GSMS-B/Indian-Legal-Qwen2.5-3B-GGUF1./llama-cli \
2 -hf GSMS-B/Indian-Legal-Qwen2.5-3B-GGUF \
3 -p "What is a Zero FIR under BNSS 2023?" \
4 -n 300 \
5 --temp 0.11from llama_cpp import Llama
2
3llm = Llama.from_pretrained(
4 repo_id="GSMS-B/Indian-Legal-Qwen2.5-3B-GGUF",
5 filename="*.gguf",
6)
7
8SYSTEM = "You are an expert legal assistant specializing in Indian criminal law — BNS, BNSS, and BSA 2023."
9
10response = llm.create_chat_completion(
11 messages=[
12 {"role": "system", "content": SYSTEM},
13 {"role": "user", "content": "What is a Zero FIR under BNSS 2023?"}
14 ],
15 temperature=0.1,
16 max_tokens=300
17)
18
19print(response["choices"][0]["message"]["content"])⚠️ Important Note: This model has been domain-adapted on structured QA data and works best as a component in a larger pipeline rather than a standalone answer engine. Direct usage without retrieval context may produce incomplete or imprecise answers on complex legal queries.
| Use Case | 💡 How to Use |
|---|---|
| 🔍 RAG Pipeline | Pair with a BM25 or vector retriever over BNS/BNSS/BSA texts; feed retrieved sections as context for grounded, citation-backed answers |
| 🤖 Legal Chatbot Backend | Use as the generation backbone of a legal assistant app with a ChromaDB / FAISS document store |
| 📚 Legal Education Tool | Build interactive Q&A apps for law students and practitioners learning the 2023 criminal justice reforms |
| 🔎 Section Lookup Assistant | Combine with a section index to surface the exact BNS / BNSS / BSA provision relevant to a given situation |
| 💻 Offline / Edge Deployment | Run on consumer CPUs without a GPU — ideal for local apps, kiosks, or low-resource environments |
| 📝 Structured Legal Summarization | Summarize individual sections when the section text is supplied as input context |
| 🏛️ Legal NLP Research | Benchmark Indian criminal law understanding across model families (Qwen vs Llama) |
| ⚖️ Comparative Law Analysis | Highlight differences between old acts (IPC/CrPC/IEA) and their 2023 replacements |
| Property | Value |
|---|---|
| 🤖 Base model | unsloth/Qwen2.5-3B-Instruct-bnb-4bit |
| 🔧 Fine-tuning method | QLoRA |
| 🎛️ LoRA rank | 16 |
| 🎛️ LoRA alpha | 16 |
| 🧩 Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| 📊 Training data | 6,354 QA pairs — 1,059 sections × 6 question types |
| 🔁 Epochs | 3 |
| 📦 Batch size (per device) | 2 |
| 📈 Learning rate | 2e-4 |
| ⚙️ Optimizer | adamw_8bit |
| 💻 Hardware | Google Colab T4 GPU |
| 🛠️ Framework | Unsloth + TRL SFTTrainer |
| 💬 Prompt format | ChatML |
| 🗜️ Quantization | GGUF (converted from merged FP16 model) |
| 📂 Dataset | 🔗 Link |
|---|---|
| Indian Legal QA — BNS + BNSS + BSA 2023 | GSMS-B/Indian-Legal-QA-BNS-BNSS-BSA |
definitional_topic · definitional_section · scenario · elements · exceptions · consequence