Downloads · 30 days
20
10% of all-time downloads
invincibleambuj/Ambuj-Tripathi-Llama-8B-LoRA
Ambuj-Tripathi-Llama-8B-LoRA is a machine learning model from invincibleambuj. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as llama3.1.
Built with Llama 3.1 | Fine-tuned & Converted by Ambuj Kumar Tripathi
Downloads · 30 days
20
10% of all-time downloads
All-time downloads
197
Public
Parameters
8B
16.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
Built with Llama 3.1 | Fine-tuned & Converted by Ambuj Kumar Tripathi
This model was fine-tuned by Ambuj Kumar Tripathi for educational, research, and AI skill-development purposes only.
Legal domain was chosen specifically because its terminology is complex, structured, and citation-heavy — making it an ideal stress-test for fine-tuning and hallucination analysis.
For critical legal matters, always consult a qualified legal professional. AI outputs are not legally binding.
| Property | Detail |
|---|---|
| Base Model | Meta Llama 3.1 8B Instruct |
| Method | QLoRA — 4-bit quantization + LoRA rank 64 |
| GGUF Format | Q4_K_M (4.92 GB) |
| Trainable Params | 41.94M of 8.07B (0.52%) |
| Training Steps | 1,820 (2 full epochs) |
| Final Loss | 0.566 |
| Training Platform | Kaggle Free Tier — NVIDIA T4 x2 |
| Training Cost | ₹0 |
| Inference | CPU-first — no GPU required |
14,543 Indian Legal QA pairs from 3 sources:
| File | Content | Source Law |
|---|---|---|
| constitution_qa.json | Constitutional QA | Constitution of India |
| ipc_qa.json | Penal Code QA | Indian Penal Code (IPC) |
| crpc_qa.json | Procedure QA | Code of Criminal Procedure (CrPC) |
Dataset sourced from publicly available legal-learning resources on Kaggle, used strictly for non-commercial educational fine-tuning experimentation.
| Parameter | Value |
|---|---|
| LoRA Rank (r) | 64 |
| LoRA Alpha | 16 |
| Target Modules | q/k/v/o_proj, gate/up/down_proj |
| Batch Size | 2 per device |
| Gradient Accumulation | 4 steps |
| Effective Batch Size | 8 |
| Learning Rate | 2e-4 |
| Epochs | 2 |
| Optimizer | adamw_8bit |
| Framework | Unsloth + TRL + PEFT |
| Step | Loss |
|---|---|
| 10 | 3.752 |
| 20 | 1.184 |
| 1800 | 0.661 |
| 1820 | 0.566 |
Consistent convergence across 2 full epochs — significantly better than 1B (1.578) and 3B (0.695) variants.
Ambuj-Tripathi-Llama-3.1-8B-IndianLegal-GGUFollama create legal-llama -f Modelfile
ollama run legal-llama
llama-cli --model Ambuj-Tripathi-Llama-3.1-8B-IndianLegal.Q4_K_M.gguf \
-p "### Instruction:\nWhat is Article 21?\n\n### Response:\n"
| Model | Parameters | Loss | HuggingFace |
|---|---|---|---|
| Llama 3.2 1B | 1.247B | 1.578 | 1B GGUF |
| Llama 3.2 3B | 3.24B | 0.695 | [3B GGUF] |
| Llama 3.1 8B | 8.07B | 0.566 | This model |
For accurate, citation-backed Indian Legal AI with RAG retrieval over 20+ Acts:
👉 Indian Legal AI Expert
👉 Engineering Docs
Ambuj Kumar Tripathi
GenAI Engineer & RAG Systems Specialist
Portfolio ·
GitHub ·
HuggingFace
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.