Instructions to use abhinavsunil/lexai-gemma2b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use abhinavsunil/lexai-gemma2b-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="abhinavsunil/lexai-gemma2b-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("abhinavsunil/lexai-gemma2b-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use abhinavsunil/lexai-gemma2b-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "abhinavsunil/lexai-gemma2b-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "abhinavsunil/lexai-gemma2b-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/abhinavsunil/lexai-gemma2b-lora
- SGLang
How to use abhinavsunil/lexai-gemma2b-lora 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 "abhinavsunil/lexai-gemma2b-lora" \ --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": "abhinavsunil/lexai-gemma2b-lora", "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 "abhinavsunil/lexai-gemma2b-lora" \ --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": "abhinavsunil/lexai-gemma2b-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use abhinavsunil/lexai-gemma2b-lora with Docker Model Runner:
docker model run hf.co/abhinavsunil/lexai-gemma2b-lora
LexAI - Gemma-2B (LoRA Fine-Tuned for Indian Legal Instruction)
This is a LoRA fine-tuned version of Google's Gemma-2B model on a custom dataset of Indian legal instructions, writ petitions, bail applications, and more.
The model is part of the LexAI initiative β a lightweight legal language model assistant that can be integrated with voice systems like Whisper ASR and Coqui TTS.
π§ Model Details
- Base Model:
google/gemma-2b - LoRA Config:
r=8alpha=16dropout=0.05- Target Modules:
["q_proj", "v_proj"]
- Quantization: 8-bit (via
bitsandbytes) - Fine-Tuned Using: Hugging Face PEFT + Transformers
- Training Epochs: 3
- Batch Size: 2 (accumulated over 4 steps)
- Device: Google Colab T4 (12GB VRAM)
π Training Data
Custom JSONL dataset with 1,000+ legal examples formatted like:
### Instruction:
What is a bail application?
### Input:
### Response:
A bail application is a request made by a defendant seeking release from custody while the case is pending...