Instructions to use nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal
- SGLang
How to use nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal with Docker Model Runner:
docker model run hf.co/nupursaraswat/NupurSaraswat-LegalBrain-Indic-Legal
โ๏ธ LegalBrain Indic Legal
A specialized Large Language Model for Indian Legal Question Answering, Legal Reasoning, and Legal Assistance.
Overview
LegalBrain Indic Legal is an instruction-tuned Large Language Model designed to assist with Indian legal information and reasoning.
The model has been trained using Adaption AutoScientist on a remastered version of the Indian Legal Supervised Fine-Tuning Dataset, resulting in improved instruction quality and stronger legal-domain performance.
This model is intended for educational, research, and legal AI development purposes.
Highlights
- ๐ฎ๐ณ Indian Legal AI
- โ๏ธ Constitutional Law
- ๐ Bharatiya Nyaya Sanhita (BNS)
- ๐ Bharatiya Nagarik Suraksha Sanhita (BNSS)
- ๐ Bharatiya Sakshya Adhiniyam (BSA)
- ๐๏ธ Indian Contract Act
- ๐ Legal Question Answering
- ๐ค Instruction Tuned
- ๐ Legal Reasoning
- ๐ Retrieval-Augmented Generation (RAG) Ready
Training Details
Training Framework
- Platform: Adaption AutoScientist
- Training Type: Supervised Fine-Tuning (SFT)
- Domain: Indian Legal AI
Dataset
Original Dataset
https://huggingface.co/datasets/nupursaraswat/adaption-legalbrain-indic-legal
Adapted using
- Prompt Rephrase
- Prompt Deduplication
- Prompt Metadata Injection
- Hallucination Mitigation
- House Special Adaptive Recipes
Dataset Statistics
| Property | Value |
|---|---|
| Samples | 18,000+ |
| Language | English |
| Domain | Indian Legal |
| Dataset Type | Instruction Tuning |
Model Capabilities
The model can assist with:
- Constitutional Law
- Criminal Law
- Contract Law
- Corporate Law
- Legal Definitions
- Case Law Discussion
- Legal Question Answering
- Legal Summarization
- Legal Research Assistance
- Legal Education
Example
Prompt
Explain Article 21 of the Constitution of India.
Response
Article 21 guarantees that no person shall be deprived of life or personal liberty except according to procedure established by law. The Supreme Court has interpreted this provision expansively to include rights such as dignity, privacy, livelihood, education, and a clean environment through landmark judgments including Maneka Gandhi v. Union of India and Justice K.S. Puttaswamy v. Union of India.
Evaluation
The adapted training pipeline achieved:
- โ 78% Relative Quality Improvement
- โ Quality Grade Improved from C โ B
- โ Significant increase in Legal Win Rate
- โ Reduced prompt duplication
- โ Improved instruction consistency
Intended Uses
This model is suitable for:
- Legal Chatbots
- Legal Research
- Educational Applications
- Legal Q&A Systems
- Retrieval-Augmented Generation (RAG)
- Academic Research
- AI Prototyping
- Hackathons
Limitations
This model does not replace a qualified legal professional.
Responses should not be treated as formal legal advice.
Always verify legal information against:
- Official legislation
- Government notifications
- Current judicial precedents
Citation
@model{legalbrain_indic_legal_2026,
title={LegalBrain Indic Legal},
author={Nupur Saraswat},
year={2026},
publisher={Hugging Face},
note={Instruction-tuned using Adaption AutoScientist on an adapted version of the Indian Legal Supervised Fine-Tuning Dataset.}
}
Acknowledgements
Special thanks to:
- Adaption AI for the AutoScientist training pipeline.
- The open-source AI and legal research community.
Author
Nupur Saraswat
AI/ML Enthusiast โข Legal AI Research โข Large Language Models
