GraySoft
Projects Models Compare Cloud benchmarks FAQ Download guIDE โ†’
Model Intelligence Sheet

GSMS-B/Indian-Legal-Llama-3.2-3B-GGUF overview

โš–๏ธ๐Ÿฆ™ Indian Legal Llama 3.2 โ€” 3B ยท GGUF <p align="center" <img src="https://img.shields.io/badge/Base%20Model Llama%203.2%203B 7C3AED?style=for the badge&logo=โ€ฆ

ggufllamalegalindian-lawBNSBNSSBSAcriminal-lawllama3quantizedollamallama-cppunslothdomain-adaptationinstruction-tuningquestion-answeringlawindiatext-generationendataset:GSMS-B/Indian-Legal-QA-BNS-BNSS-BSAlicense:apache-2.0endpoints_compatibleregion:us

Runs locally from ~1.88 GB disk (4 GB VRAM class GPUs with llama.cpp / guIDE).

Downloads
0
Likes
0
Pipeline
text-generation
Author

Repository Files & Downloads

1 GGUF files detected
Direct downloads for local inference
FileTypeQuantizationSizeLink
llama-3.2-3b-instruct.Q4_K_M.ggufGGUFGGUF1.88 GBDownload

Model Details

Model IDGSMS-B/Indian-Legal-Llama-3.2-3B-GGUF
AuthorGSMS-B
Pipelinetext-generation
Licenseapache-2.0
Base modelunsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit
Last modified2026-06-23T12:52:14.000Z

Model README

---

language:

  • en

license: apache-2.0

base_model: unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit

tags:

  • legal
  • indian-law
  • BNS
  • BNSS
  • BSA
  • criminal-law
  • llama
  • llama3
  • gguf
  • quantized
  • ollama
  • llama-cpp
  • unsloth
  • domain-adaptation
  • instruction-tuning
  • question-answering
  • law
  • india

datasets:

  • GSMS-B/Indian-Legal-QA-BNS-BNSS-BSA

pipeline_tag: text-generation

---

โš–๏ธ๐Ÿฆ™ Indian Legal Llama 3.2 โ€” 3B ยท GGUF

<p align="center">

<img src="https://img.shields.io/badge/Base%20Model-Llama%203.2%203B-7C3AED?style=for-the-badge&logo=meta" alt="Base Model"/>

<img src="https://img.shields.io/badge/Type-GGUF%20Quantized-F59E0B?style=for-the-badge" alt="Type"/>

<img src="https://img.shields.io/badge/Domain-Indian%20Criminal%20Law-DC2626?style=for-the-badge" alt="Domain"/>

<img src="https://img.shields.io/badge/Runtime-Ollama%20%7C%20llama.cpp-10B981?style=for-the-badge" alt="Runtime"/>

<img src="https://img.shields.io/badge/Acts-BNS%20%7C%20BNSS%20%7C%20BSA-16A34A?style=for-the-badge" alt="Acts"/>

<img src="https://img.shields.io/badge/License-Apache%202.0-F59E0B?style=for-the-badge" alt="License"/>

</p>

> ๐ŸŸก This is the GGUF quantized version โ€” optimised for CPU inference via Ollama or llama.cpp. No GPU required. For full-precision PyTorch usage, see the Merged Model.

---

๐Ÿ“– Model Description

Indian Legal Llama 3.2 โ€” 3B (GGUF) is a quantized, CPU-friendly version of the domain-adapted Llama 3.2 3B model, fine-tuned via QLoRA on unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit and covering all 1,059 sections of India's three 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 |

Trained on 6,354 instruction-format QA pairs โ€” 6 question types per section covering definitions, scenarios, legal elements, exceptions, and consequences.

---

๐Ÿ”— Model Family โ€” Llama 3.2 3B

| Variant | Repo | Best For |

|---|---|---|

| ๐ŸŸข Merged | GSMS-B/Indian-Legal-Llama-3.2-3B | Out-of-the-box inference, Gradio / API deployment |

| ๐Ÿ”ต LoRA Adapter | GSMS-B/Indian-Legal-Llama-3.2-3B-Adapter | Lightweight loading on top of base model |

| ๐ŸŸก GGUF (this repo) | GSMS-B/Indian-Legal-Llama-3.2-3B-GGUF | CPU inference via Ollama / llama.cpp |

---

๐Ÿš€ Quick Start

๐Ÿ–ฅ๏ธ Run with Ollama (easiest)

ollama run hf.co/GSMS-B/Indian-Legal-Llama-3.2-3B-GGUF

๐Ÿ Run with llama-cpp-python

from llama_cpp import Llama

llm = Llama.from_pretrained(
    repo_id="GSMS-B/Indian-Legal-Llama-3.2-3B-GGUF",
    filename="*Q4_K_M.gguf",   # recommended quant
    n_ctx=2048,
    verbose=False
)

response = llm.create_chat_completion(
    messages=[
        {"role": "system",  "content": "You are an expert legal assistant specializing in Indian criminal law โ€” BNS, BNSS, and BSA 2023."},
        {"role": "user",    "content": "What is a Zero FIR under BNSS 2023?"}
    ],
    max_tokens=300,
    temperature=0.1
)
print(response["choices"][0]["message"]["content"])

๐Ÿฆœ LangChain integration

from langchain_community.llms import LlamaCpp

llm = LlamaCpp(
    model_path="path/to/Indian-Legal-Llama-3.2-3B.Q4_K_M.gguf",
    n_ctx=2048,
    temperature=0.1,
    verbose=False
)
print(llm.invoke("Explain the presumption of innocence under BSA 2023."))

---

๐ŸŽฏ Recommended Use Cases

> โš ๏ธ 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.

โœ… Where this model excels

| Use Case | ๐Ÿ’ก How to Use |

|---|---|

| ๐Ÿ” RAG Pipeline (CPU) | Run a full retrieval-augmented legal assistant entirely on CPU โ€” no GPU needed |

| ๐Ÿ–ฅ๏ธ Local / Offline Deployment | Deploy in air-gapped environments, court offices, or law firms without cloud dependency |

| ๐Ÿค– Legal Chatbot Backend | Integrate via Ollama's REST API into any chatbot stack |

| ๐Ÿ“š Legal Education Tool | Build Q&A apps for law students and practitioners on standard hardware |

| ๐Ÿ”Ž Section Lookup Assistant | Surface the exact BNS / BNSS / BSA provision relevant to a query on-device |

| ๐Ÿงช Research & Benchmarking | Evaluate quantization impact on Indian legal domain understanding |

| ๐Ÿ“ Structured Legal Summarization | Summarize specific sections when the section text is supplied as context |

| ๐Ÿ›๏ธ Edge / Low-Resource Deployment | Run on laptops, edge servers, or Raspberry Pi-class devices with sufficient RAM |

โŒ Not recommended for

  • Standalone legal advice without a retrieval component
  • High-stakes legal decisions without qualified human review
  • Jurisdictions or acts outside BNS / BNSS / BSA 2023

---

๐Ÿ‹๏ธ Training Details

| Property | Value |

|---|---|

| ๐Ÿค– Base model | unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit |

| ๐Ÿ”ง Fine-tuning method | QLoRA |

| ๐ŸŽ›๏ธ LoRA rank | 64 |

| ๐ŸŽ›๏ธ LoRA alpha | 128 |

| ๐Ÿงฉ 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 (effective) | 4 |

| ๐Ÿ“ˆ Learning rate | 2e-4 |

| โš™๏ธ Optimizer | adamw_8bit |

| ๐Ÿ’ป Hardware | Google Colab T4 GPU |

| ๐Ÿ› ๏ธ Framework | Unsloth + TRL SFTTrainer |

| ๐Ÿ’ฌ Prompt format | ChatML |

---

๐Ÿ“Š Training Dataset

| ๐Ÿ“‚ Dataset | ๐Ÿ”— Link |

|---|---|

| Indian Legal QA โ€” BNS + BNSS + BSA 2023 | GSMS-B/Indian-Legal-QA-BNS-BNSS-BSA |

6 question types per section:

definitional_topic ยท definitional_section ยท scenario ยท elements ยท exceptions ยท consequence

---

๐Ÿ‘ค Author

GSMS-B โ€” Bugatha Ganasyam Mani Sankar

๐Ÿค— Hugging Face Profile

---

โš ๏ธ Disclaimer

This model is intended for research and educational purposes only. It does not constitute legal advice. Outputs should not be relied upon for any legal decision without review by a qualified legal professional. The model's responses reflect patterns in training data and may contain errors or omissions.

---

โšก Fine-tuned using Unsloth for training efficiency. Quantized to GGUF for broad CPU compatibility.

Run GSMS-B/Indian-Legal-Llama-3.2-3B-GGUF with guIDE

Download guIDE โ€” the AI-native code editor with local LLM inference and 69 built-in tools.

Download guIDE โ†’ ยท Browse 524k+ models ยท Compare models

Source: Hugging Face ยท Compare models