This is the GGUF quantized version of tejasgowda05/Kanoonu-AI-Phi3-Finetuned — a Phi-3-mini model fine-tuned on 23,370 Indian law Q&A pairs covering the Indian Penal Code (IPC), Code of Criminal Procedure (CrPC), Constitution of India, and other statutes.
The GGUF format allows this model to run locally on CPU or GPU without requiring a high-end machine, making Indian legal information accessible to everyone.
📦 Available Files
File
Quantization
Size
Use Case
phi-3-mini-4k-instruct.Q4_K_M.gguf
Q4_K_M
~2.2 GB
✅ Recommended — best balance of size and quality
What is Q4_K_M?
Q4_K_M is a 4-bit quantization method that compresses the model to ~2.2GB with negligible quality loss compared to the full precision version. It runs comfortably on most modern laptops.
🚀 Quick Start
Option 1 — Ollama (Easiest)
bash
1# Step 1 — Install Ollama from https://ollama.com/download23# Step 2 — Pull and run directly4ollama run hf.co/tejasgowda05/Kanoonu-AI-Phi3-GGUF:Q4_K_M
1from llama_cpp import Llama
23llm = Llama(4 model_path ="./kanoonu_model/phi-3-mini-4k-instruct.Q4_K_M.gguf",5 n_ctx =2048,6 n_threads =4,7)89response = llm(10"<|system|>\nYou are Kanoonu AI, an expert Indian legal assistant.\n<|end|>\n"11"<|user|>\nWhat is an FIR and how is it filed in India?<|end|>\n"12"<|assistant|>\n",13 max_tokens =200,14 stop =["<|end|>","<|endoftext|>"],15)1617print(response["choices"][0]["text"])
Option 4 — Python with ctransformers
python
1from ctransformers import AutoModelForCausalLM
23llm = AutoModelForCausalLM.from_pretrained(4"tejasgowda05/Kanoonu-AI-Phi3-GGUF",5 model_file ="phi-3-mini-4k-instruct.Q4_K_M.gguf",6 model_type ="mistral",7)89print(llm("What are the fundamental rights in the Indian Constitution?"))
💻 Hardware Requirements
Setup
Minimum RAM
Performance
CPU only
8 GB RAM
Slow (~1-2 tokens/sec)
CPU + 8GB RAM
8 GB RAM
Moderate (~3-5 tokens/sec)
GPU (4GB VRAM)
4 GB VRAM
Fast (~15-20 tokens/sec)
GPU (8GB VRAM)
8 GB VRAM
Very Fast (~30+ tokens/sec)
🏗️ How This Was Created
microsoft/Phi-3-mini-4k-instruct (3.8B base model)
↓
QLoRA Fine-tuning
(24,607 Indian law Q&A pairs)
↓
tejasgowda05/Kanoonu-AI-Phi3-Finetuned (LoRA adapters)
↓
Merge LoRA → Convert to GGUF → Quantize Q4_K_M
(via Unsloth)
↓
tejasgowda05/Kanoonu-AI-Phi3-GGUF ← you are here