<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gangadhar </title>
    <description>The latest articles on DEV Community by Gangadhar  (@gangadharv444).</description>
    <link>https://dev.to/gangadharv444</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3898389%2F91558b97-11d9-4646-b521-6e8ca2170cf6.png</url>
      <title>DEV Community: Gangadhar </title>
      <link>https://dev.to/gangadharv444</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gangadharv444"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Gangadhar </dc:creator>
      <pubDate>Sun, 26 Apr 2026 10:10:08 +0000</pubDate>
      <link>https://dev.to/gangadharv444/built-an-offline-legal-ai-for-indian-courts-100-local-zero-cloud-apis-firs-are-2l87</link>
      <guid>https://dev.to/gangadharv444/built-an-offline-legal-ai-for-indian-courts-100-local-zero-cloud-apis-firs-are-2l87</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l" class="crayons-story__hidden-navigation-link"&gt;I Built an Offline AI for Indian Courts — Here's Why (And How)&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/gangadharv444" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3898389%2F91558b97-11d9-4646-b521-6e8ca2170cf6.png" alt="gangadharv444 profile" class="crayons-avatar__image" width="420" height="420"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/gangadharv444" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Gangadhar 
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Gangadhar 
                
              
              &lt;div id="story-author-preview-content-3552162" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/gangadharv444" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3898389%2F91558b97-11d9-4646-b521-6e8ca2170cf6.png" class="crayons-avatar__image" alt="" width="420" height="420"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Gangadhar &lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 26&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l" id="article-link-3552162"&gt;
          I Built an Offline AI for Indian Courts — Here's Why (And How)
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/python"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;python&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/legal"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;legal&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            6 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>ai</category>
      <category>llm</category>
      <category>privacy</category>
      <category>showdev</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Gangadhar </dc:creator>
      <pubDate>Sun, 26 Apr 2026 10:07:20 +0000</pubDate>
      <link>https://dev.to/gangadharv444/-1ed8</link>
      <guid>https://dev.to/gangadharv444/-1ed8</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l" class="crayons-story__hidden-navigation-link"&gt;I Built an Offline AI for Indian Courts — Here's Why (And How)&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/gangadharv444" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3898389%2F91558b97-11d9-4646-b521-6e8ca2170cf6.png" alt="gangadharv444 profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/gangadharv444" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Gangadhar 
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Gangadhar 
                
              
              &lt;div id="story-author-preview-content-3552162" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/gangadharv444" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3898389%2F91558b97-11d9-4646-b521-6e8ca2170cf6.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Gangadhar &lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 26&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l" id="article-link-3552162"&gt;
          I Built an Offline AI for Indian Courts — Here's Why (And How)
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/python"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;python&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/legal"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;legal&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            6 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>I Built an Offline AI for Indian Courts — Here's Why (And How)</title>
      <dc:creator>Gangadhar </dc:creator>
      <pubDate>Sun, 26 Apr 2026 07:07:47 +0000</pubDate>
      <link>https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l</link>
      <guid>https://dev.to/gangadharv444/i-built-an-offline-ai-for-indian-courts-heres-why-and-how-f9l</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; FIRs contain sensitive witness data. Sending them to OpenAI violates judicial confidentiality. I built a &lt;strong&gt;100% offline legal assistant&lt;/strong&gt; that runs on a judge's laptop with zero internet. Open source, MIT license, fully functional.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/gangadharv444/smart-court-assistant-" rel="noopener noreferrer"&gt;github.com/gangadharv444/smart-court-assistant-&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Demo Video:&lt;/strong&gt; &lt;a href="https://youtu.be/OYREoWOqj_U" rel="noopener noreferrer"&gt;Watch on YouTube (3 min)&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Why Judges Can't Use ChatGPT
&lt;/h2&gt;

&lt;p&gt;Last year, I was volunteering with a legal aid organization. A judge asked a simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Can I use AI to analyze FIRs faster?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My answer should have been "yes." Instead, I said "not safely."&lt;/p&gt;

&lt;p&gt;Here's why:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FIRs are confidential.&lt;/strong&gt; They contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Witness names, addresses, phone numbers&lt;/li&gt;
&lt;li&gt;Minor victim details (sexual assault cases)&lt;/li&gt;
&lt;li&gt;Undercover officer identities&lt;/li&gt;
&lt;li&gt;Confidential informant data&lt;/li&gt;
&lt;li&gt;Case strategy from prosecutors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;If you send an FIR to OpenAI or Google:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data goes to US servers&lt;/li&gt;
&lt;li&gt;Violates Indian judicial confidentiality laws&lt;/li&gt;
&lt;li&gt;Risks witness safety&lt;/li&gt;
&lt;li&gt;Could invalidate proceedings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The judge had a real problem. Standard AI solutions couldn't solve it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Opportunity: 2024 Judicial Reform
&lt;/h2&gt;

&lt;p&gt;India's judiciary underwent a historic overhaul on &lt;strong&gt;July 1, 2024&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Three new codes replaced colonial-era legislation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IPC (1860)&lt;/strong&gt; → &lt;strong&gt;BNS (Bharatiya Nyaya Sanhita 2023)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CrPC (1973)&lt;/strong&gt; → &lt;strong&gt;BNSS (2023)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Indian Evidence Act (1872)&lt;/strong&gt; → &lt;strong&gt;BSA (2023)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overnight, every legal professional in India needed to cross-reference old sections to new ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"IPC 302?" → "Now it's BNS 103"&lt;/li&gt;
&lt;li&gt;"IPC 420?" → "Now it's BNS 318"&lt;/li&gt;
&lt;li&gt;"IPC 498A?" → "Now it's BNS 85"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Judges were manually searching through gazette notifications. Lawyers were printing reference sheets. Court staff were overwhelmed.&lt;/p&gt;

&lt;p&gt;This was an urgent, real problem affecting millions of judicial proceedings.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Solution: A Smart Court Assistant
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An offline, air-gapped legal assistant for Indian courts. No internet, no APIs, no cloud dependency. Everything runs locally on a judge's laptop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does it do?&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Case Analysis&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Upload FIR → Ask questions → AI answers using only that document (RAG pipeline)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Timeline Extraction&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Automatically extract chronological timeline of events from evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Conflict Detection&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cross-examine 2+ FIRs to find contradictions in facts, timelines, witness accounts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IPC to BNS Mapping&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Instant conversion of old law sections to new ones (300+ deterministic mappings)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Regional OCR&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Extract text from Kannada/Hindi/Marathi PDFs with English translation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bulk Analysis&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Auto-scan documents for all IPC sections, generate BNS transition reports&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;How is it 100% offline?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses &lt;strong&gt;Llama-3 8B&lt;/strong&gt; (quantized to 4.7 GB) running locally via Ollama&lt;/li&gt;
&lt;li&gt;All embeddings stored in &lt;strong&gt;ChromaDB&lt;/strong&gt; (local vector database)&lt;/li&gt;
&lt;li&gt;No APIs called after setup&lt;/li&gt;
&lt;li&gt;Works on consumer laptops (16 GB RAM, CPU-only)&lt;/li&gt;
&lt;li&gt;Tested on AMD Ryzen 5 5500U (6 cores, 12 threads)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This Matters More Than You Think
&lt;/h2&gt;

&lt;h3&gt;
  
  
  For Judges and Lawyers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Analyze FIRs in seconds, not hours&lt;/li&gt;
&lt;li&gt;No confidentiality concerns (zero data leaves the machine)&lt;/li&gt;
&lt;li&gt;Works in air-gapped court networks&lt;/li&gt;
&lt;li&gt;No subscription fees or API keys&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  For India's Judiciary
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Judicial efficiency without sacrificing privacy&lt;/li&gt;
&lt;li&gt;Easier IPC to BNS transition (urgent need in 2024)&lt;/li&gt;
&lt;li&gt;Regional language support (Kannada, Hindi, Marathi)&lt;/li&gt;
&lt;li&gt;No vendor lock-in or dependency on cloud providers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  For Technologists
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Shows how to build production AI under extreme constraints&lt;/li&gt;
&lt;li&gt;Quantized LLMs on CPU (not everyone has GPUs)&lt;/li&gt;
&lt;li&gt;RAG pipeline for domain-specific legal tasks&lt;/li&gt;
&lt;li&gt;Modular, testable, offline-first architecture&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Technical Approach
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why Llama-3 8B?
&lt;/h3&gt;

&lt;p&gt;Most people think "AI = big, expensive, cloud-based."&lt;/p&gt;

&lt;p&gt;I proved you can build sophisticated AI offline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Model:          Llama-3 8B (Meta, open license)
Size:           4.7 GB (Q4 quantization)
Inference:      CPU-only (no GPU needed)
Latency:        15-25 seconds per query
Context Window: 8K tokens
Accuracy:       Better than GPT-3.5 on reasoning
License:        Commercial use allowed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why not larger models?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;13B+ models don't fit in 16 GB RAM (with OS + embeddings + vector DB)&lt;/li&gt;
&lt;li&gt;GPU acceleration ruled out (target = consumer laptop)&lt;/li&gt;
&lt;li&gt;8B is the optimal size for offline judicial work&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Architecture: RAG Pipeline
&lt;/h3&gt;

&lt;p&gt;Instead of relying on the LLM's training data (which can hallucinate), I use:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Document Loading&lt;/strong&gt; — Upload FIR PDFs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chunking&lt;/strong&gt; — Break into 500-char segments with overlap&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embedding&lt;/strong&gt; — Convert to vectors using all-MiniLM-L6-v2 (384-dim)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage&lt;/strong&gt; — Index in ChromaDB (local vector DB)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieval&lt;/strong&gt; — Find top-3 relevant chunks for query&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generation&lt;/strong&gt; — Feed to Llama-3 with context&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; LLM answers grounded in actual document content, not hallucinations.&lt;/p&gt;

&lt;h3&gt;
  
  
  IPC to BNS Mapping: Deterministic, Not AI
&lt;/h3&gt;

&lt;p&gt;Here's the key insight: &lt;strong&gt;Don't use AI for things that need to be 100% accurate.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of asking Llama-3 to map "IPC 302 → BNS ?":&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LLM might say "BNS 302" (wrong)&lt;/li&gt;
&lt;li&gt;Or hallucinate a completely different section&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I use a hardcoded dictionary of ~300 verified mappings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IPC 302 → BNS 103 (always correct)&lt;/li&gt;
&lt;li&gt;IPC 420 → BNS 318 (always correct)&lt;/li&gt;
&lt;li&gt;Zero hallucination risk&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AI is only used for &lt;em&gt;interpretation&lt;/em&gt; after the mapping is confirmed.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned Building This
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Constraints Enable Innovation
&lt;/h3&gt;

&lt;p&gt;Building for a 16 GB RAM laptop forced me to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use quantized models instead of bloated ones&lt;/li&gt;
&lt;li&gt;Cache aggressively (&lt;code&gt;@st.cache_resource&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Choose CPU-friendly algorithms&lt;/li&gt;
&lt;li&gt;Think about deterministic vs AI-based decisions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Most cloud-first AI projects never think about these things.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Domain-Specific AI Beats General AI
&lt;/h3&gt;

&lt;p&gt;GPT-4 is amazing at general tasks. But for IPC to BNS mapping?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A deterministic dictionary beats any LLM&lt;/li&gt;
&lt;li&gt;Cost: Free vs $30/month API&lt;/li&gt;
&lt;li&gt;Speed: less than 1ms vs 10-30 seconds&lt;/li&gt;
&lt;li&gt;Reliability: 100% vs 95%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Know when to use AI, when to use databases.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Offline-First is a Feature, Not a Limitation
&lt;/h3&gt;

&lt;p&gt;The constraint of "no cloud" forced better design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Privacy by default&lt;/li&gt;
&lt;li&gt;No API key management&lt;/li&gt;
&lt;li&gt;Works in any environment&lt;/li&gt;
&lt;li&gt;No data exfiltration risks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The best products often solve hard constraints.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Technical Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Choice&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;LLM&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Llama-3 8B via Ollama&lt;/td&gt;
&lt;td&gt;Fits in RAM, good reasoning, open license&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;RAG&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LangChain + ChromaDB&lt;/td&gt;
&lt;td&gt;No server setup, persists to disk, simple&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Embeddings&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;all-MiniLM-L6-v2&lt;/td&gt;
&lt;td&gt;80MB, fast on CPU, trained on legal domains&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Frontend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Streamlit&lt;/td&gt;
&lt;td&gt;No frontend code needed, hot reload, built-in UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OCR&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tesseract + Poppler&lt;/td&gt;
&lt;td&gt;Free, supports Indian scripts, offline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Language&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Python 3.10+&lt;/td&gt;
&lt;td&gt;Rich ML ecosystem, fast iteration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  The Numbers
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Codebase:             18 modular Python files (~3,000 lines)
Test Coverage:        43 unit tests covering core logic
BNS Sections:         358 complete legal database
IPC-to-BNS Mappings:  ~300 verified entries
Dashboard Tabs:       6 functional modules
Setup Time:           10 minutes (clone, install, run)
Cloud API Calls:      Zero
GPU Required:         No
Internet Required:    No (after setup)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  How to Try It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Quick Start (10 minutes)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Clone the repo&lt;/span&gt;
git clone https://github.com/gangadharv444/smart-court-assistant-
&lt;span class="nb"&gt;cd &lt;/span&gt;smart-court-assistant-

&lt;span class="c"&gt;# 2. Install dependencies&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
venv&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\a&lt;/span&gt;ctivate  &lt;span class="c"&gt;# Windows&lt;/span&gt;
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt

&lt;span class="c"&gt;# 3. Download model&lt;/span&gt;
ollama run llama3

&lt;span class="c"&gt;# 4. Run the app&lt;/span&gt;
streamlit run app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dashboard opens at &lt;code&gt;http://localhost:8501&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try With Sample Documents
&lt;/h3&gt;

&lt;p&gt;The repo includes sample PDFs to test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dummy_fir.pdf&lt;/code&gt; — Sample FIR&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;witness_statement.pdf&lt;/code&gt; — Witness statement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;In the Case Analysis tab:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload &lt;code&gt;dummy_fir.pdf&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Ask: "Based on the FIR, detail the timeline of events"&lt;/li&gt;
&lt;li&gt;AI extracts the timeline from the document&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;In the Conflict Detection tab:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload both &lt;code&gt;dummy_fir.pdf&lt;/code&gt; and &lt;code&gt;witness_statement.pdf&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Click "Analyze"&lt;/li&gt;
&lt;li&gt;AI finds contradictions between the documents&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Why Open Source?
&lt;/h2&gt;

&lt;p&gt;Two reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Trust:&lt;/strong&gt; Judges need to verify the code themselves. No black boxes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contribution:&lt;/strong&gt; Legal professionals can improve the mappings, add BNSS sections, support more languages.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;MIT License. Commercial use allowed. Use it. Modify it. Deploy it in courts.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Vision
&lt;/h2&gt;

&lt;p&gt;This isn't about "AI for AI's sake."&lt;/p&gt;

&lt;p&gt;The vision is simple: &lt;strong&gt;Judges should have access to cutting-edge AI without sacrificing confidentiality.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No vendor lock-in. No monthly subscriptions. No data leaving the courtroom.&lt;/p&gt;

&lt;p&gt;Just a tool that works offline, for the work judges actually do.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;BNSS mapping (Criminal Procedure Code)&lt;/li&gt;
&lt;li&gt;BSA mapping (Evidence Act)&lt;/li&gt;
&lt;li&gt;Multi-language support (Tamil, Telugu, Bengali)&lt;/li&gt;
&lt;li&gt;Deploy in actual courts (pilot program)&lt;/li&gt;
&lt;li&gt;Train judges on using the tool&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Join the Effort
&lt;/h2&gt;

&lt;p&gt;If you work in legal tech, judicial systems, or Indian law:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/gangadharv444/smart-court-assistant-" rel="noopener noreferrer"&gt;github.com/gangadharv444/smart-court-assistant-&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What we need:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lawyers to validate IPC to BNS mappings&lt;/li&gt;
&lt;li&gt;Judges to test with real FIRs&lt;/li&gt;
&lt;li&gt;Developers to add BNSS/BSA mappings&lt;/li&gt;
&lt;li&gt;Regional language experts for OCR improvement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Contact:&lt;/strong&gt; &lt;a href="mailto:gangadharv.444@gmail.com"&gt;gangadharv.444@gmail.com&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building this taught me that the best AI projects often solve &lt;strong&gt;real constraints&lt;/strong&gt;, not imaginary problems.&lt;/p&gt;

&lt;p&gt;A judge can't use OpenAI's API. That's not a limitation of the judge. That's a design problem in the AI ecosystem.&lt;/p&gt;

&lt;p&gt;Smart Court Assistant solves it.&lt;/p&gt;

&lt;p&gt;If you're building AI for India's institutions — courts, hospitals, government offices — you don't need cutting-edge GPUs or expensive cloud APIs. You need &lt;em&gt;offline-first thinking&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Sometimes the most powerful AI runs on your laptop.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Have questions? Found a bug? Want to contribute?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Star the repo on GitHub. Drop an issue. Or reach out directly.&lt;/p&gt;

&lt;p&gt;The code is open. The data is yours. The vision is yours to improve.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for security. Built for India. Built offline.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>python</category>
      <category>legal</category>
    </item>
  </channel>
</rss>
