⚖️ Vidhi AI (विधि AI) — Sovereign Indian Legal Intelligence

Vidhi AI is a specialized domain-adapted reasoning model fine-tuned on structured Indian statutory jurisprudence, modern criminal codes (Bharatiya Nyaya Sanhita 2023, Bharatiya Nagarik Suraksha Sanhita 2023), debt recovery (SARFAESI Act 2002), and constitutional property law.

Developed by Shreyansh Singh as part of an open research initiative exploring sovereign domain-specific SLMs.


🎯 Key Focus Areas

  • Statutory Interpretation: Deep cross-referencing between IPC/CrPC legacy provisions and modern BNS/BNSS statutory articles.
  • Structured Legal Reasoning: Delivers step-by-step reasoning identifying legal elements, jurisdictional scope, procedural mandates, and statutory defenses.
  • Financial & Property Jurisprudence: Covers non-performing asset (NPA) enforcement under SARFAESI and land revenue mutation dispute workflows.

🚀 Quick Start Inference

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

BASE_MODEL = "Qwen/Qwen2.5-7B-Instruct"
ADAPTER = "shreyansh12183/Vidhi-AI-Instruct"

tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
model = AutoModelForCausalLM.from_pretrained(
    BASE_MODEL,
    torch_dtype=torch.float16,
    device_map="auto"
)
model = PeftModel.from_pretrained(model, ADAPTER)

prompt = "Explain the statutory prerequisites for declaring a security interest enforceable under Section 13(2) of the SARFAESI Act 2002."
messages = [{"role": "user", "content": prompt}]
formatted = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

inputs = tokenizer(formatted, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.3)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

🔬 Training Specifications

  • Base Architecture: Qwen/Qwen2.5-7B-Instruct
  • Fine-Tuning Method: Parameter-Efficient Fine-Tuning (LoRA, $r=8, \alpha=16$)
  • Target Projections: Attention Q/K/V/O matrices
  • Curated Dataset: shreyansh12183/vidhi-ai-1k-curated (1,074 verified statutory reasoning pairs)
Downloads last month
2
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for shreyansh12183/Vidhi-AI-Instruct

Base model

Qwen/Qwen2.5-7B
Adapter
(2594)
this model

Space using shreyansh12183/Vidhi-AI-Instruct 1

Collection including shreyansh12183/Vidhi-AI-Instruct