<?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: Ram Chandra Giri</title>
    <description>The latest articles on DEV Community by Ram Chandra Giri (@ram_chandragiri).</description>
    <link>https://dev.to/ram_chandragiri</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4133359%2F5932574e-34cd-4849-91a6-50cb6b6273ae.png</url>
      <title>DEV Community: Ram Chandra Giri</title>
      <link>https://dev.to/ram_chandragiri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ram_chandragiri"/>
    <language>en</language>
    <item>
      <title>I open-sourced 3 small Node utilities I pulled out of building an edtech platform</title>
      <dc:creator>Ram Chandra Giri</dc:creator>
      <pubDate>Sat, 19 Sep 2026 20:08:57 +0000</pubDate>
      <link>https://dev.to/ram_chandragiri/i-open-sourced-3-small-node-utilities-i-pulled-out-of-building-an-edtech-platform-28jd</link>
      <guid>https://dev.to/ram_chandragiri/i-open-sourced-3-small-node-utilities-i-pulled-out-of-building-an-edtech-platform-28jd</guid>
      <description>&lt;p&gt;I've spent the last while building &lt;a href="https://mcqplex.com" rel="noopener noreferrer"&gt;MCQplex&lt;/a&gt;, an exam-prep&lt;br&gt;
platform for Nepal's NEB curriculum. Along the way I built a few pieces of&lt;br&gt;
infrastructure that had nothing to do with exams specifically, so I pulled&lt;br&gt;
them out into their own packages:&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;a href="https://github.com/rcgiri-physics/llm-free-cascade" rel="noopener noreferrer"&gt;llm-free-cascade&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Free-tier LLM APIs (Gemini, Groq, Cerebras, and others) are individually&lt;br&gt;
rate-limited, but between them they add up to a lot of free inference if you&lt;br&gt;
just fail over from one to the next. This cascades a chat completion across&lt;br&gt;
however many you've got keys for, with automatic multi-key rotation (if&lt;br&gt;
you've made more than one free account on a provider) and cooldown for a&lt;br&gt;
provider that's structurally broken. Zero dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LLMCascade&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;llm-free-cascade&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cascade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;LLMCascade&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromEnv&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;cascade&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;a href="https://github.com/rcgiri-physics/pdf-render-pool" rel="noopener noreferrer"&gt;pdf-render-pool&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Launching a fresh headless Chromium per PDF (the naive way to use Puppeteer)&lt;br&gt;
costs 1-2 seconds and ~200MB of RAM every time. This keeps one browser warm&lt;br&gt;
and gives each render its own page, with a concurrency cap so a burst of PDF&lt;br&gt;
requests queues instead of taking the server down.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://github.com/rcgiri-physics/mongo-job-lock" rel="noopener noreferrer"&gt;mongo-job-lock&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;If you run &lt;code&gt;node-cron&lt;/code&gt; jobs on more than one instance (PM2 cluster, several&lt;br&gt;
servers), every instance fires the job unless you do something about it.&lt;br&gt;
This is a tiny MongoDB-backed advisory lock — steal-on-expiry, so a crashed&lt;br&gt;
holder can't deadlock the job forever — for whatever Mongo connection you&lt;br&gt;
already have.&lt;/p&gt;

&lt;p&gt;All three: zero or optional-peer dependencies, MIT licensed, tested, on npm.&lt;br&gt;
Feedback / PRs welcome, especially on &lt;code&gt;llm-free-cascade&lt;/code&gt; since free-tier&lt;br&gt;
model names drift constantly and &lt;code&gt;providers.json&lt;/code&gt; is set up so a one-file PR&lt;br&gt;
fixes a stale one.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>node</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
