GPT-OSS-20B Indian Legal Advisory (Full 16-Bit Merged Standalone Model)
This is the full 16-bit merged standalone model (bfloat16 safetensors) fine-tuned and aligned for the Indian Legal System, Direct & Indirect Taxation, and the 2023 Criminal & Evidence Law reforms.
Achieves a 10.0 / 10 Composite Benchmark Score (100% Statutory Recall) across GST, Customs, Income Tax, Bharatiya Nyaya Sanhita (BNS 2023), Bharatiya Nagarik Suraksha Sanhita (BNSS 2023), and Bharatiya Sakshya Adhiniyam (BSA 2023).
🏛️ Specialized Legal Domains Covered
- GST / Indirect Tax:
- CGST & IGST Acts 2017 (Section 17(5) blocked credit, Safari Retreats functionality test).
- Show Cause Notice timelines and penalties (Section 73 vs Section 74).
- Place of Supply rules & 'Bill-to Ship-to' transactions (Section 7 & Section 10(1)(b) IGST Act).
- Customs Taxation:
- Assessable valuation under Section 14 Customs Act, 1962.
- Related party transactions & Special Valuation Branch (SVB) under CBIC Circular No. 5/2016.
- Recovery of duties & extended 5-year limitation under Section 28(1) and 28(4).
- Income Tax / Direct Tax:
- Reassessment procedures under Section 148 & Section 148A.
- 3-year and 10-year limitation thresholds (₹50 lakh asset criterion) under Section 149.
- Concessional Default Tax Regime under Section 115BAC and Chapter VI-A deductions.
- New Criminal & Evidence Codes (2023 Reforms):
- BNS 2023: Concordance mapping for Murder (Sec 103(1)), Cheating (Sec 318(4)), and Sovereignty offences (Sec 152).
- BNSS 2023: 24-hour Magistrate production (Sec 58) & 15-day police custody remand across the first 40/60 days (Sec 187).
- BSA 2023: Admissibility of Electronic Records and mandatory Section 63(4) Certificate (replacing Sec 65B IEA).
🔬 Multi-Stage Alignment Pipeline
Trained on a single NVIDIA GeForce RTX 4060 Ti through:
- Domain-Specialized SFT: Multi-epoch LoRA fine-tuning ($r=32, lpha=32$) over 20,179 curated statutory provisions and rulings.
- Stochastic Weight Averaging (SWA): Trajectory delta checkpoint averaging to eliminate high-frequency gradient noise.
- TIES-Merging with WSO Calibration: Merging indirect tax, direct tax, and criminal adapters with task density pruning (0.3) and sign consensus.
- Preference Optimization (DPO & ORPO): Multi-epoch alignment penalizing legal hallucinations and statutory misattributions.
- WiSE-FT Simplex Blending: Weight-Space Ensemble blending base task vectors with specialized legal reasoning vectors.
- Dual-Channel CoT Alignment: Activation of distinct
<|channel|>analysis<|message|>(IRAC legal reasoning) and<|channel|>final<|message|>(exact statutory holding). - 16-Bit Weight Baking: Dequantized and fused directly into the base weights for zero-overhead inference.
💻 Quickstart Inference (vLLM / Transformers / Ollama)
Using Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "Suvir-Misra/gpt-oss-20b-indian-legal-merged"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.bfloat16,
device_map="auto"
)
prompt = """<|start|>system<|message|>You are a Senior Legal Advocate and expert on Indian Law: GST, Customs, Income Tax, BNS, BNSS, and BSA. In your analysis channel, perform IRAC legal reasoning. In your final channel, give the exact statutory holding.<|end|><|start|>user<|message|>Under the CGST Act, compare Section 73 vs Section 74 timelines and penalties.<|end|><|start|>assistant"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=500, temperature=0.2, repetition_penalty=1.12)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:]))
Using Ollama
Create a Modelfile:
FROM Suvir-Misra/gpt-oss-20b-indian-legal-merged
PARAMETER temperature 0.2
PARAMETER top_p 0.9
PARAMETER stop "<|return|>"
PARAMETER stop "<|end|>"
Then build and run:
ollama create indlaw -f Modelfile
ollama run indlaw