<?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: Ganugapati Sai Sowmya</title>
    <description>The latest articles on DEV Community by Ganugapati Sai Sowmya (@ganugapatisaisowmya).</description>
    <link>https://dev.to/ganugapatisaisowmya</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%2F3829088%2F522ab2e1-35a1-4031-a7a5-41e126a320d2.jpeg</url>
      <title>DEV Community: Ganugapati Sai Sowmya</title>
      <link>https://dev.to/ganugapatisaisowmya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ganugapatisaisowmya"/>
    <language>en</language>
    <item>
      <title>A 3rd year CS student's attempt to reduce AI's water footprint — EcoCache (A Python Library)</title>
      <dc:creator>Ganugapati Sai Sowmya</dc:creator>
      <pubDate>Tue, 17 Mar 2026 12:37:55 +0000</pubDate>
      <link>https://dev.to/ganugapatisaisowmya/a-3rd-year-cs-students-attempt-to-reduce-ais-water-footprint-ecocache-a-python-library-36gk</link>
      <guid>https://dev.to/ganugapatisaisowmya/a-3rd-year-cs-students-attempt-to-reduce-ais-water-footprint-ecocache-a-python-library-36gk</guid>
      <description>&lt;p&gt;Did you know that every ~20 questions you ask an AI chatbot consumes &lt;br&gt;
roughly a 500ml bottle of water for data centre cooling?&lt;/p&gt;

&lt;p&gt;As AI scales, so does its thirst. A huge chunk of this is pure &lt;br&gt;
waste — because we ask LLMs the same things over and over. Every &lt;br&gt;
redundant query is a real, physical cost.&lt;/p&gt;

&lt;p&gt;I'm a 3rd year CS engineering student and I built EcoCache to &lt;br&gt;
reduce and measure that waste.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;EcoCache sits in front of your LLM API calls. Before hitting the &lt;br&gt;
model, it checks whether a semantically similar question was already &lt;br&gt;
answered. If yes — it returns the cached answer instantly. If no — &lt;br&gt;
it calls the API and stores the result for next time.&lt;/p&gt;

&lt;p&gt;It's not exact string matching. "What is TCP?" and "Can you explain &lt;br&gt;
TCP protocols?" are recognised as the same question using vector &lt;br&gt;
embeddings and cosine similarity.&lt;/p&gt;

&lt;h2&gt;
  
  
  See it in action
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;ecocache.client&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EcoCacheClient&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;EcoCacheClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# add your Gemini API key to .env
&lt;/span&gt;
&lt;span class="c1"&gt;# First call — hits the API
&lt;/span&gt;&lt;span class="n"&gt;r1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What is the difference between TCP and UDP?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;source&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;   &lt;span class="c1"&gt;# → "api"
&lt;/span&gt;
&lt;span class="c1"&gt;# Similar question — served from cache, no API call made
&lt;/span&gt;&lt;span class="n"&gt;r2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Can you explain TCP vs UDP protocols?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;source&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;      &lt;span class="c1"&gt;# → "cache"
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r2&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;savings&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;     &lt;span class="c1"&gt;# → water and carbon saved so far
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The dashboard
&lt;/h2&gt;

&lt;p&gt;It comes with a live dashboard that tracks savings in real time:&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fyrv67ntd1q1ua24anwjc.png" class="article-body-image-wrapper"&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%2Farticles%2Fyrv67ntd1q1ua24anwjc.png" alt="EcoCache dashboard showing cache hit rate, water saved, and recent queries" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;50% cache hit rate on my tests. Every cache hit = one fewer LLM &lt;br&gt;
inference = ~5mL water and ~4g CO2 saved. Small numbers individually. &lt;br&gt;
Meaningful at scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works under the hood
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Query comes in&lt;/li&gt;
&lt;li&gt;Sentence-transformers converts it to a 384-dimensional vector&lt;/li&gt;
&lt;li&gt;FAISS searches for the nearest vector in the cache&lt;/li&gt;
&lt;li&gt;If similarity &amp;gt; 0.85 — return cached response&lt;/li&gt;
&lt;li&gt;If not — call the LLM, store the result&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/GanugapatiSaiSowmya/ecocache
&lt;span class="nb"&gt;cd &lt;/span&gt;ecocache
python3.11 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/GanugapatiSaiSowmya/ecocache" rel="noopener noreferrer"&gt;https://github.com/GanugapatiSaiSowmya/ecocache&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is v0.1; rough edges exist. I'm actively working on it and &lt;br&gt;
I appreciate your feedback, issues, or contributions.&lt;/p&gt;

&lt;p&gt;If you think responsible AI development matters, a star would mean &lt;br&gt;
a lot to a broke college student trying to make a dent ⭐&lt;/p&gt;

&lt;h1&gt;
  
  
  python #ai #sustainability #opensource #climatetech
&lt;/h1&gt;

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