A specialized language model fine-tuned for generating comprehensive and legally-sound Indian contracts.
This model is built on the Llama-3.2-1B-Instruct architecture and specifically fine-tuned to generate various types of Indian legal contracts. It combines legal domain knowledge with natural language generation capabilities to produce well-structured, contextually appropriate legal documents.
1# Create virtual environment
2python -m venv venv
3
4# Activate virtual environment
5source venv/bin/activate # Unix/MacOS
6venv\Scripts\activate # Windows
7
8# Install requirements
9pip install -r requirements.txt
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load model and tokenizer
5tokenizer = AutoTokenizer.from_pretrained("axondendriteplus/contract_drafter-Llama-3.2-1B-Instruct")
6model = AutoModelForCausalLM.from_pretrained(
7 "axondendriteplus/contract_drafter-Llama-3.2-1B-Instruct",
8 torch_dtype=torch.float16,
9 device_map="auto"
10)
11
12# Generate contract
13prompt = "Generate an Indian legal contract for: Employment Agreement"
14inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
15outputs = model.generate(
16 **inputs,
17 max_new_tokens=2048,
18 temperature=0.7,
19 top_p=0.95,
20 repetition_penalty=1.15
21)
22response = tokenizer.decode(outputs[0], skip_special_tokens=True)
23print(response)
We welcome contributions to improve the model's capabilities.
1@Wasserstoff innovation & learning Labs{indian_legal_contract_model,
2 title = {Indian Legal Contract Generation Model},
3 year = {2025},
4 description = {A specialized language model for generating Indian legal contracts}
5}
This model follows the licensing terms of the base Llama 3.3 model. Please refer to the Llama 3.3 license for usage terms and conditions.