Legal Buddy 🚀 — AI-Powered Legal Chat, Document Review & Drafting with Gemma 4 Legal Buddy**, an AI-powered legal assistant built for the Gemma 4 Challenge that operates entirely locally via Ollama to ensure user privacy. It helps users understand, review, and draft legal documents (such as contracts and rental agreements) specifically within the Indian legal ecosystem, using Gemma 4 E2B to analyze documents and generate structured drafts without sending sensitive data to external servers. The tool is designed for students, freelancers, and startups who need accessible legal support while retaining full ownership of their data. This is a submission for the Gemma 4 Challenge: Build with Gemma 4 Most people blindly accept privacy policies, contracts, rental agreements, and legal terms without truly understanding what they are agreeing to. Legal language is often complex, inaccessible, and intimidating. I built Legal Buddy to make legal understanding more accessible while keeping user privacy fully intact. Legal Buddy is a local-first AI legal assistant designed specifically for the Indian legal ecosystem. It helps users: And the most important part: Everything runs locally through Ollama. No sensitive legal data leaves the user's machine. Legal Buddy combines: The application is designed for students, freelancers, employees, tenants, startups, and anyone who regularly encounters legal documents but may not have immediate access to legal expertise. Users can ask questions related to Indian laws in natural language. The system uses: This allows responses to stay grounded in actual Indian legal references instead of generic AI-generated answers. Examples: Users can upload: The system performs: Legal Buddy uses a map-reduce style document review pipeline, where sections are analyzed independently before generating a consolidated legal review report. This is especially useful for: Users can instantly generate: The user simply provides: Gemma then generates structured draft documents tailored for Indian legal context. 🔗 GitHub Repository: https://github.com/SaiPavankumar22/Legal Buddy The project follows a decoupled architecture: I used Gemma 4 E2B for this project. I specifically chose Gemma 4 E2B because it offers the right balance between: For a legal assistant, privacy is critical. Users should not have to upload: to external servers just to get AI assistance. Running Gemma locally through Ollama made this possible. Gemma answers legal questions using: This grounds responses in actual legal material instead of relying purely on pretrained knowledge. Gemma analyzes uploaded: It identifies: The multimodal capabilities were especially useful for layout-heavy legal documents. Gemma generates structured legal drafts using user-provided information. This allows users to quickly create: while still keeping the workflow local and private. One of the biggest goals of Legal Buddy was ensuring that users retain ownership of their sensitive legal data. With Ollama + Gemma: No cloud APIs are required. Some of the biggest technical challenges were: Balancing accuracy, privacy, and performance was one of the most interesting parts of building this project. Planned improvements include: Building Legal Buddy was an exciting experience because it showed how powerful local AI systems can become when combined with strong open models like Gemma 4. Huge thanks to Google and the Gemma team for organizing this challenge 🙌