<?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: Muhammad Usman Awan</title>
    <description>The latest articles on DEV Community by Muhammad Usman Awan (@usman_awan).</description>
    <link>https://dev.to/usman_awan</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%2F2113728%2F5023cec6-3138-4ba9-831a-4a97d7542633.jpg</url>
      <title>DEV Community: Muhammad Usman Awan</title>
      <link>https://dev.to/usman_awan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/usman_awan"/>
    <language>en</language>
    <item>
      <title>Building a Production-Ready Anonymous Identity &amp; Abuse Protection Layer with FastAPI</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Mon, 20 Jul 2026 11:46:19 +0000</pubDate>
      <link>https://dev.to/usman_awan/building-a-production-ready-anonymous-identity-abuse-protection-layer-with-fastapi-51e7</link>
      <guid>https://dev.to/usman_awan/building-a-production-ready-anonymous-identity-abuse-protection-layer-with-fastapi-51e7</guid>
      <description>&lt;p&gt;Most AI applications rely solely on &lt;strong&gt;IP-based rate limiting&lt;/strong&gt; to prevent abuse. Unfortunately, that's only the first line of defense.&lt;/p&gt;

&lt;p&gt;In this article, we'll build a production-inspired &lt;strong&gt;anonymous identity system&lt;/strong&gt; using FastAPI, MongoDB, and Beanie that tracks visitors using fingerprints, enforces daily usage limits, prepares for future authentication, and lays the foundation for a scalable AI SaaS.&lt;/p&gt;

&lt;p&gt;We'll also see how this integrates cleanly with a multi-provider LLM Router without polluting business logic.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8ch4zgfj3kigokk2q76z.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8ch4zgfj3kigokk2q76z.gif" alt=" " width="220" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  👋 Introduction
&lt;/h3&gt;

&lt;p&gt;When building AI products, most developers focus on prompts, LLMs, and fancy frontend interfaces.&lt;/p&gt;

&lt;p&gt;Very few spend time thinking about what happens before the AI is even called.&lt;/p&gt;

&lt;p&gt;That request has to be identified.&lt;br&gt;
Validated.&lt;br&gt;
Protected.&lt;br&gt;
Tracked.&lt;/p&gt;

&lt;p&gt;And eventually analyzed.&lt;/p&gt;

&lt;p&gt;While working on &lt;a href="https://github.com/UsmanDevCraft/cvforbes-backend" rel="noopener noreferrer"&gt;CVForbes&lt;/a&gt;, an AI-powered resume tailoring platform, I realized that relying only on &lt;strong&gt;IP-based rate limiting&lt;/strong&gt; wasn't enough.&lt;/p&gt;

&lt;p&gt;I wanted something that could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track anonymous visitors&lt;/li&gt;
&lt;li&gt;Limit free usage&lt;/li&gt;
&lt;li&gt;Detect abusive clients&lt;/li&gt;
&lt;li&gt;Prepare for authentication later&lt;/li&gt;
&lt;li&gt;Keep the API routes completely clean&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of sprinkling checks across endpoints, I built a dedicated identity and abuse protection layer.&lt;/p&gt;


&lt;h3&gt;
  
  
  🤔 Why Not Just Use IP Rate Limiting?
&lt;/h3&gt;

&lt;p&gt;Traditional rate limiting looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@limiter.limit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3/minute&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a good start.&lt;/p&gt;

&lt;p&gt;But users can easily bypass it by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Changing networks&lt;/li&gt;
&lt;li&gt;Using a VPN&lt;/li&gt;
&lt;li&gt;Switching devices&lt;/li&gt;
&lt;li&gt;Clearing browser state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For an AI product where every request costs money, that's not enough.&lt;/p&gt;

&lt;p&gt;We needed another layer.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj6varfrbcynq0rfq0vti.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj6varfrbcynq0rfq0vti.gif" alt=" " width="498" height="276"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  💡 The Idea
&lt;/h3&gt;

&lt;p&gt;Instead of identifying requests using only an IP address, every request first becomes a Client Identity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client Request
        │
        ▼
Client Identity
        │
        ├── IP Address
        ├── User-Agent
        ├── Cookie
        └── Fingerprint
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;strong&gt;fingerprint&lt;/strong&gt; becomes the user's anonymous identity throughout the application.&lt;/p&gt;




&lt;h3&gt;
  
  
  🏗 Architecture
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                Client Request
                      │
                      ▼
              IP Guard Middleware
                      │
                      ├── Resolve Client Identity
                      ├── Check Active Ban
                      ├── Get/Create Anonymous User
                      ├── Reset Daily Usage
                      ├── Validate Daily Limit
                      └── Attach User to request.state
                      │
                      ▼
                  API Endpoint
                      │
                      ▼
            CV Generation Service
                      │
                      ▼
                  LLM Router
      (Automatic Failover Between Providers)
                      │
        ┌─────────────┼─────────────┼────────────┐
        ▼             ▼             ▼            ▼
      Groq      OpenRouter      Ollama      Gemini
        │             │             │            │
        └─────────────┴─────────────┴────────────┘
                      │
                      ▼
        Structured Output Validation
                      │
                      ▼
          Tailored CV + Cover Letter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice something?&lt;/p&gt;

&lt;p&gt;The route knows absolutely nothing about users.&lt;/p&gt;

&lt;p&gt;The middleware handles everything before the request reaches business logic.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbozze3hlp0og0pw2nb18.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbozze3hlp0og0pw2nb18.gif" alt=" " width="350" height="255"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  📂 Organizing the Backend
&lt;/h3&gt;

&lt;p&gt;Instead of putting everything inside routes, I split responsibilities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/

├── middleware/
│      └── ip_guard.py
│
├── services/
│      ├── client_identity_service.py
│      ├── anonymous_user_service.py
│      └── abuse_service.py
│
├── repositories/
│      ├── anonymous_user_repository.py
│      └── banned_ip_repository.py
│
├── models/
│      ├── anonymous_user.py
│      ├── banned_ip.py
│      └── generated_cv.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each layer has only one responsibility.&lt;/p&gt;




&lt;h3&gt;
  
  
  🗄 Designing the Anonymous User
&lt;/h3&gt;

&lt;p&gt;Instead of storing only an IP address, each anonymous visitor stores useful analytics.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AnonymousUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;fingerprint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;ip&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;user_agent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;cookie_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;

    &lt;span class="n"&gt;requests_today&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;total_requests&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

    &lt;span class="n"&gt;abuse_score&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;is_banned&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;who visited&lt;/li&gt;
&lt;li&gt;how often&lt;/li&gt;
&lt;li&gt;when they visited&lt;/li&gt;
&lt;li&gt;whether they were abusive&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;without requiring sign-up.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fum5yf43ct522mf0ql4hc.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fum5yf43ct522mf0ql4hc.gif" alt=" " width="220" height="156"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 Services Instead of Fat Routes
&lt;/h3&gt;

&lt;p&gt;The route doesn't increment counters anymore.&lt;/p&gt;

&lt;p&gt;Instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;anonymous_service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;register_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Behind that single line:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reset daily limit&lt;/li&gt;
&lt;li&gt;validate usage&lt;/li&gt;
&lt;li&gt;update timestamps&lt;/li&gt;
&lt;li&gt;increment counters&lt;/li&gt;
&lt;li&gt;save to MongoDB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The endpoint remains tiny.&lt;/p&gt;




&lt;h3&gt;
  
  
  🛡 Middleware Does the Heavy Lifting
&lt;/h3&gt;

&lt;p&gt;The middleware performs the entire security pipeline.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;identity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;identity_service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;anonymous_service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_or_create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;identity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;anonymous_service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;register_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now every endpoint automatically receives a validated anonymous user.&lt;/p&gt;

&lt;p&gt;No duplicated logic.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs63eksbhrhb46hln0jt0.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs63eksbhrhb46hln0jt0.gif" alt=" " width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🚫 Preparing for Bans
&lt;/h3&gt;

&lt;p&gt;Another service handles abuse.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;abuse_service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;is_banned&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;identity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fingerprint&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;403&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Access denied.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Later this can become:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;manual admin bans&lt;/li&gt;
&lt;li&gt;automatic bans&lt;/li&gt;
&lt;li&gt;permanent bans&lt;/li&gt;
&lt;li&gt;temporary bans&lt;/li&gt;
&lt;li&gt;abuse score thresholds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;without changing middleware.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F71dmseoogrgtbch2lpmu.gif" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F71dmseoogrgtbch2lpmu.gif" alt=" " width="500" height="283"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🤝 Integrating with the LLM Router
&lt;/h3&gt;

&lt;p&gt;One of my favorite parts is that the protection layer has nothing to do with AI providers.&lt;/p&gt;

&lt;p&gt;Whether the router selects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Groq&lt;/li&gt;
&lt;li&gt;OpenRouter&lt;/li&gt;
&lt;li&gt;Ollama&lt;/li&gt;
&lt;li&gt;Gemini&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;the security layer behaves exactly the same.&lt;br&gt;
That separation keeps the architecture flexible.&lt;/p&gt;


&lt;h3&gt;
  
  
  📈 Current Flow
&lt;/h3&gt;

&lt;p&gt;A request now follows this path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request
    ↓
Identity
    ↓
Anonymous User
    ↓
Daily Limit
    ↓
Ban Check
    ↓
API
    ↓
CV Service
    ↓
LLM Router
    ↓
Structured Validation
    ↓
Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple.&lt;/p&gt;

&lt;p&gt;Predictable.&lt;/p&gt;

&lt;p&gt;Easy to extend.&lt;/p&gt;




&lt;p&gt;🎯 Final Thoughts&lt;/p&gt;

&lt;p&gt;Building an AI application isn't only about prompts or choosing the fastest LLM. The real engineering challenge is designing a backend that remains maintainable as the product grows.&lt;/p&gt;

&lt;p&gt;By introducing an anonymous identity layer, separating responsibilities into middleware, services, and repositories, and keeping the LLM Router completely independent, &lt;a href="https://github.com/UsmanDevCraft/cvforbes-backend" rel="noopener noreferrer"&gt;CVForbes&lt;/a&gt; now has a foundation that's easy to extend with authentication, subscriptions, analytics, and future AI providers.&lt;/p&gt;

&lt;p&gt;Sometimes the best feature isn't the one users see—it's the architecture that quietly keeps everything secure, scalable, and understandable behind the scenes.&lt;/p&gt;

&lt;p&gt;Did you miss my deep dive into provider-agnostic AI architecture? You can find it right here:&lt;br&gt;
&lt;a href="https://dev.to/usman_awan/how-i-built-a-provider-agnostic-ai-architecture-that-automatically-switches-between-groq-790"&gt;How I built a provider-agnostic AI architecture that automatically switches between Groq, OpenRouter, Ollama, and Gemini.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How I built a provider-agnostic AI architecture that automatically switches between Groq, OpenRouter, Ollama, and Gemini.</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Thu, 16 Jul 2026 05:55:18 +0000</pubDate>
      <link>https://dev.to/usman_awan/how-i-built-a-provider-agnostic-ai-architecture-that-automatically-switches-between-groq-790</link>
      <guid>https://dev.to/usman_awan/how-i-built-a-provider-agnostic-ai-architecture-that-automatically-switches-between-groq-790</guid>
      <description>&lt;h2&gt;
  
  
  🚀 Building a Production-Ready Multi-LLM Router with LangChain &amp;amp; FastAPI
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;How I designed &lt;a href="https://cvforbes.vercel.app/" rel="noopener noreferrer"&gt;CVForbes&lt;/a&gt; to automatically switch between Groq, OpenRouter, Ollama, and Gemini without changing a single service.&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    Client
                       │
                       ▼
             FastAPI Endpoint
                       │
                       ▼
             Dependency Injection
                       │
                       ▼
               LLMRouter Service
      ┌────────────┬──────────────┐
      │            │              │
      ▼            ▼              ▼
  GroqProvider  OpenRouter   OllamaProvider
      │            │              │
      └────────────┴──────────────┘
                 │
            GeminiProvider
                 │
                 ▼
          LangChain Models
                 │
                 ▼
         Structured Output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;When building &lt;strong&gt;&lt;a href="https://github.com/UsmanDevCraft/cvforbes-backend" rel="noopener noreferrer"&gt;CVForbes&lt;/a&gt;&lt;/strong&gt;, I quickly realized that depending on a single LLM provider wasn't a great long-term strategy.&lt;/p&gt;

&lt;p&gt;What if Groq goes down?&lt;/p&gt;

&lt;p&gt;What if another provider becomes cheaper or faster?&lt;/p&gt;

&lt;p&gt;What if I want to test a new model without touching every service in my application?&lt;/p&gt;

&lt;p&gt;Instead of tightly coupling my business logic to one provider, I designed a &lt;strong&gt;provider-agnostic routing layer&lt;/strong&gt; that sits between my application and the LLMs.&lt;/p&gt;

&lt;p&gt;Now, every AI feature—resume tailoring, parsing, cover letter generation, and future modules—talks to a single router. The router decides which provider should handle the request, performs automatic failover when necessary, and keeps the rest of the application completely unaware of what's happening behind the scenes.&lt;/p&gt;

&lt;p&gt;This article explains the architecture behind that system and the design decisions that made it scalable.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Problem
&lt;/h3&gt;

&lt;p&gt;A lot of AI projects start like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;llm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ChatGroq&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works.&lt;/p&gt;

&lt;p&gt;Until it doesn't.&lt;/p&gt;

&lt;p&gt;Once your application grows, changing providers means editing multiple services, updating imports, and introducing provider-specific logic across the codebase.&lt;/p&gt;

&lt;p&gt;I wanted to avoid that entirely.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Solution
&lt;/h3&gt;

&lt;p&gt;Instead of allowing services to communicate directly with an LLM provider, every request goes through a single router.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    Client
                       │
                       ▼
             FastAPI Endpoint
                       │
                       ▼
             Dependency Injection
                       │
                       ▼
               LLMRouter Service
      ┌────────────┬──────────────┐
      │            │              │
      ▼            ▼              ▼
  GroqProvider  OpenRouter   OllamaProvider
      │            │              │
      └────────────┴──────────────┘
                 │
            GeminiProvider
                 │
                 ▼
          LangChain Models
                 │
                 ▼
         Structured Output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Every service simply asks for &lt;strong&gt;"an LLM."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The router decides which one.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why a Router?
&lt;/h3&gt;

&lt;p&gt;The router has one job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose the best available provider.&lt;/li&gt;
&lt;li&gt;Handle failover.&lt;/li&gt;
&lt;li&gt;Return a LangChain model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;Everything else stays where it belongs.&lt;/p&gt;

&lt;p&gt;This keeps the application clean and makes providers interchangeable.&lt;/p&gt;




&lt;h3&gt;
  
  
  Provider Abstraction
&lt;/h3&gt;

&lt;p&gt;Each provider follows the same interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BaseLLMProvider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whether it's Groq, Gemini, Ollama, or OpenRouter doesn't matter.&lt;/p&gt;

&lt;p&gt;The router simply calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_llm&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding a new provider later becomes incredibly straightforward.&lt;/p&gt;




&lt;h3&gt;
  
  
  Request Lifecycle
&lt;/h3&gt;

&lt;p&gt;Every AI request follows the same journey.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Incoming Request
       │
       ▼
Need LLM?
       │
       ▼
Router receives prompt
       │
       ▼
Is Groq healthy?
      / \
    Yes  No
    │      │
    ▼      ▼
 Use Groq  Try OpenRouter
               │
               ▼
        Healthy?
          / \
       Yes   No
       │      │
       ▼      ▼
Use OpenRouter Try Ollama
                     │
                     ▼
               Healthy?
                  │
                  ▼
              Use Ollama
                  │
                  ▼
              Last fallback
                Gemini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice something missing?&lt;/p&gt;

&lt;p&gt;Nowhere in the application do we reference Groq or Gemini directly.&lt;/p&gt;

&lt;p&gt;That's intentional.&lt;/p&gt;




&lt;h3&gt;
  
  
  Automatic Failover
&lt;/h3&gt;

&lt;p&gt;One of my biggest goals was resilience.&lt;/p&gt;

&lt;p&gt;Instead of immediately failing when a provider becomes unavailable, the router simply tries the next one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Groq
  │
  ❌
  ▼
OpenRouter
  │
  ❌
  ▼
Ollama
  │
  ✅
  ▼
Return Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The user doesn't know a provider failed.&lt;/p&gt;

&lt;p&gt;And honestly, they shouldn't have to.&lt;/p&gt;




&lt;h3&gt;
  
  
  Health Tracking
&lt;/h3&gt;

&lt;p&gt;Trying the same failed provider on every request wastes time.&lt;/p&gt;

&lt;p&gt;Instead, the router keeps lightweight health information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Groq        ✅
OpenRouter  ✅
Ollama      ❌
Gemini      ✅
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a provider repeatedly fails, it's temporarily skipped until it becomes healthy again.&lt;/p&gt;

&lt;p&gt;This reduces unnecessary delays during outages.&lt;/p&gt;




&lt;h3&gt;
  
  
  Dependency Injection
&lt;/h3&gt;

&lt;p&gt;Another design choice was using FastAPI's dependency injection.&lt;/p&gt;

&lt;p&gt;Instead of creating providers inside every endpoint, a shared router instance is injected wherever it's needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Endpoint
    │
Depends()
    │
LLM Router
    │
Providers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps endpoints focused on business logic rather than infrastructure.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why This Architecture?
&lt;/h3&gt;

&lt;p&gt;This approach gave &lt;a href="https://github.com/UsmanDevCraft/cvforbes-backend" rel="noopener noreferrer"&gt;CVForbes&lt;/a&gt; several advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Provider-agnostic business logic&lt;/li&gt;
&lt;li&gt;✅ Automatic failover&lt;/li&gt;
&lt;li&gt;✅ Easy provider replacement&lt;/li&gt;
&lt;li&gt;✅ Clean separation of responsibilities&lt;/li&gt;
&lt;li&gt;✅ Simple scalability&lt;/li&gt;
&lt;li&gt;✅ Easier testing and maintenance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Perhaps my favorite part is that adding another provider requires almost no changes to the rest of the application.&lt;/p&gt;

&lt;p&gt;The architecture grows without becoming more complicated.&lt;/p&gt;




&lt;h3&gt;
  
  
  Lessons Learned
&lt;/h3&gt;

&lt;p&gt;Building AI applications isn't just about choosing the best model.&lt;/p&gt;

&lt;p&gt;It's about designing systems that continue working when models, providers, or APIs inevitably change.&lt;/p&gt;

&lt;p&gt;A small investment in abstraction early on saved me from coupling my entire application to a single vendor.&lt;/p&gt;

&lt;p&gt;Looking back, that decision has probably been one of the most valuable architectural choices in &lt;a href="https://github.com/UsmanDevCraft/cvforbes-backend" rel="noopener noreferrer"&gt;CVForbes&lt;/a&gt;.&lt;/p&gt;




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

&lt;p&gt;The router already supports multiple providers with automatic failover, but there's plenty of room for future improvements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Latency-aware routing&lt;/li&gt;
&lt;li&gt;Cost-aware provider selection&lt;/li&gt;
&lt;li&gt;Circuit breakers&lt;/li&gt;
&lt;li&gt;Metrics &amp;amp; monitoring&lt;/li&gt;
&lt;li&gt;Dynamic provider configuration&lt;/li&gt;
&lt;li&gt;Task-specific routing (e.g., different models for parsing vs. generation)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The exciting part is that the architecture already supports these ideas without requiring a redesign.&lt;/p&gt;




&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;When people think about AI architecture, they often focus on &lt;strong&gt;which model&lt;/strong&gt; to use.&lt;/p&gt;

&lt;p&gt;I think the better question is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How easily can your application switch models tomorrow?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Designing around abstractions instead of vendors made &lt;a href="https://github.com/UsmanDevCraft/cvforbes-backend" rel="noopener noreferrer"&gt;CVForbes&lt;/a&gt; significantly more maintainable, resilient, and scalable. Providers may change, APIs may evolve, and new models will continue to emerge—but the rest of the application won't need to know.&lt;/p&gt;

&lt;p&gt;That's the kind of architecture I aim for: one that's built around software engineering principles rather than a single AI provider.&lt;/p&gt;




&lt;h3&gt;
  
  
  ⭐ If you found this helpful...
&lt;/h3&gt;

&lt;p&gt;The complete implementation, including the router, providers, health management, and FastAPI integration, is available in the accompanying &lt;a href="https://github.com/UsmanDevCraft/cvforbes-backend" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feel free to explore it, suggest improvements, or adapt the architecture for your own AI applications.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🧠 Dev.to Un-Stuck: The Chrome Extension That Finally Fixes Your Reading List</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Mon, 20 Apr 2026 06:23:06 +0000</pubDate>
      <link>https://dev.to/usman_awan/devto-un-stuck-the-chrome-extension-that-finally-fixes-your-reading-list-43ia</link>
      <guid>https://dev.to/usman_awan/devto-un-stuck-the-chrome-extension-that-finally-fixes-your-reading-list-43ia</guid>
      <description>&lt;h2&gt;
  
  
  🧠 Dev.to, Un-Stuck: The Chrome Extension That Finally Fixes Your Reading List
&lt;/h2&gt;

&lt;p&gt;You know the drill.&lt;/p&gt;

&lt;p&gt;You’re browsing DEV Community, you stumble upon a goldmine—“Advanced TypeScript Patterns,” “Scaling Node.js Apps,” something you &lt;em&gt;know&lt;/em&gt; will make you better. You hit &lt;strong&gt;Save&lt;/strong&gt;, feeling productive.&lt;/p&gt;

&lt;p&gt;Then… nothing.&lt;/p&gt;

&lt;p&gt;Weeks later, your reading list is a cluttered backlog of good intentions. Articles you &lt;em&gt;meant&lt;/em&gt; to read. Articles you maybe &lt;em&gt;did&lt;/em&gt; read. Articles you’ve completely forgotten.&lt;/p&gt;

&lt;p&gt;That’s exactly the problem I set out to solve.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://github.com/UsmanDevCraft/dev-articles-extension" rel="noopener noreferrer"&gt;Dev.to Un-Sticker&lt;/a&gt; — a Chrome extension designed to turn your reading list from a graveyard into something actually useful.&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%2Fymbjy6oq5pt7vzjeuel4.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%2Fymbjy6oq5pt7vzjeuel4.png" alt=" " width="507" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/UsmanDevCraft/dev-articles-extension" rel="noopener noreferrer"&gt;Source Code&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🚨 The Real Problem (In Detail)
&lt;/h3&gt;

&lt;p&gt;After spending a lot of time in the MERN ecosystem and relying heavily on Dev.to for learning, I noticed two deeper issues beyond just “too many saved articles”:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. No Concept of Progress
&lt;/h4&gt;

&lt;p&gt;The native reading list treats everything the same:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Something you saved 5 minutes ago&lt;/li&gt;
&lt;li&gt;Something you finished last month&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There’s no way to distinguish between &lt;em&gt;actionable&lt;/em&gt; and &lt;em&gt;done&lt;/em&gt;. Over time, this destroys clarity.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Passive Storage = Forgotten Knowledge
&lt;/h4&gt;

&lt;p&gt;Saving an article feels productive—but it’s actually passive. Without any system to bring that content back into your attention, it fades away.&lt;/p&gt;

&lt;p&gt;This creates a dangerous loop:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Save → Forget → Save More → Repeat&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  3. Cognitive Overload
&lt;/h4&gt;

&lt;p&gt;When your list hits 100+ articles, it becomes overwhelming. Instead of helping you learn, it creates friction—and you stop engaging with it entirely.&lt;/p&gt;




&lt;h3&gt;
  
  
  💡 The Solution: Dev.to Un-Sticker
&lt;/h3&gt;

&lt;p&gt;Un-Sticker turns your reading list into an &lt;strong&gt;active system&lt;/strong&gt;, not just storage.&lt;/p&gt;

&lt;p&gt;Instead of asking &lt;em&gt;“What did I save?”&lt;/em&gt;, it helps you answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“What should I read next—and what have I already learned?”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&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%2F7eb9o8lg37o9s73w97fj.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%2F7eb9o8lg37o9s73w97fj.png" alt=" " width="379" height="481"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ✨ Key Features
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ✅ Read / Unread State (Finally)
&lt;/h4&gt;

&lt;p&gt;Mark articles as &lt;strong&gt;Read&lt;/strong&gt; once you’re done.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keeps your main list clean and focused&lt;/li&gt;
&lt;li&gt;Moves completed articles into a separate archive&lt;/li&gt;
&lt;li&gt;Gives you a real sense of progress&lt;/li&gt;
&lt;/ul&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%2Fpyr1u8rggju13ol53apl.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%2Fpyr1u8rggju13ol53apl.png" alt=" " width="384" height="374"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ⏰ Smart Reminder System
&lt;/h3&gt;

&lt;p&gt;This is where things get interesting.&lt;/p&gt;

&lt;p&gt;Un-Sticker nudges you at smart intervals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After &lt;strong&gt;3 days&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;After &lt;strong&gt;7 days&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;After &lt;strong&gt;14 days&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;After &lt;strong&gt;30 days&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of letting valuable content disappear, it gently pulls it back into your attention at the right 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%2F7nwy1uksqzicr3yewwrw.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%2F7nwy1uksqzicr3yewwrw.png" alt=" " width="381" height="480"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  📜 Infinite Scrolling That Actually Scales
&lt;/h3&gt;

&lt;p&gt;Whether you have 20 articles or 500:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smooth scrolling experience&lt;/li&gt;
&lt;li&gt;Lightweight shimmer loaders&lt;/li&gt;
&lt;li&gt;Optimized API usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No lag. No clutter.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔒 Privacy-First by Design
&lt;/h3&gt;

&lt;p&gt;No accounts. No servers. No tracking.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everything is stored locally using &lt;code&gt;chrome.storage.local&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Your API key never leaves your machine&lt;/li&gt;
&lt;li&gt;Your data is 100% yours&lt;/li&gt;
&lt;/ul&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%2Fb2reas3fifid2tzkck9k.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%2Fb2reas3fifid2tzkck9k.png" alt=" " width="377" height="164"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🛠️ How It Works (Under the Hood)
&lt;/h3&gt;

&lt;p&gt;I built Un-Sticker using &lt;strong&gt;Chrome Extension Manifest V3&lt;/strong&gt; and the Dev.to API, keeping performance and simplicity in mind.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ Background Logic
&lt;/h3&gt;

&lt;p&gt;A service worker runs quietly in the background using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;chrome.alarms&lt;/code&gt; (triggered hourly)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reminders are timely&lt;/li&gt;
&lt;li&gt;No unnecessary CPU usage&lt;/li&gt;
&lt;/ul&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%2Frlynii57q9cnhhguaj4d.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%2Frlynii57q9cnhhguaj4d.png" alt=" " width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  💾 Local Storage System
&lt;/h3&gt;

&lt;p&gt;All state is managed via:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;chrome.storage.local&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read/Unread status&lt;/li&gt;
&lt;li&gt;Saved timestamps&lt;/li&gt;
&lt;li&gt;Reminder tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No external database needed.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔮 What’s Next?
&lt;/h3&gt;

&lt;p&gt;I’m just getting started. Here’s what I’m planning:&lt;/p&gt;

&lt;h4&gt;
  
  
  🤖 AI-Powered Learning
&lt;/h4&gt;

&lt;p&gt;Not just saving articles—&lt;em&gt;learning from them&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One-click summaries&lt;/li&gt;
&lt;li&gt;Ask questions about an article&lt;/li&gt;
&lt;li&gt;Turn content into actionable insights&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  📧 Weekly Digest Emails (Optional)
&lt;/h3&gt;

&lt;p&gt;For users who want a broader view:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Here’s what you saved this week”&lt;/li&gt;
&lt;li&gt;“Here’s what you still haven’t read”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fully opt-in.&lt;/p&gt;




&lt;h3&gt;
  
  
  ❓ FAQ (Improved)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Is it available on the Chrome Web Store?
&lt;/h4&gt;

&lt;p&gt;Not yet. It’s currently in a &lt;strong&gt;local-first development phase&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You can try it by loading it manually via:&lt;br&gt;
&lt;code&gt;chrome://extensions/ → Load Unpacked&lt;/code&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  Why do I need an API key?
&lt;/h4&gt;

&lt;p&gt;Dev.to doesn’t currently support OAuth for third-party apps.&lt;/p&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A personal API key is required&lt;/li&gt;
&lt;li&gt;It allows secure access to your private reading list&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  Is my data safe?
&lt;/h4&gt;

&lt;p&gt;Yes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stored locally in your browser&lt;/li&gt;
&lt;li&gt;Never sent to any external server&lt;/li&gt;
&lt;li&gt;No analytics, no tracking&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  I’m not getting reminders—what’s wrong?
&lt;/h4&gt;

&lt;p&gt;Most likely, notifications are disabled at the system level.&lt;/p&gt;

&lt;p&gt;Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chrome notification permissions&lt;/li&gt;
&lt;li&gt;OS-level notification settings (Windows/macOS)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without those, reminders won’t appear.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 Final Thought
&lt;/h3&gt;

&lt;p&gt;This extension isn’t just about organizing bookmarks.&lt;/p&gt;

&lt;p&gt;It’s about fixing a broken habit:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Saving knowledge without ever using it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Un-Sticker helps close that loop.&lt;/p&gt;




&lt;p&gt;💬 I’d genuinely love your feedback:&lt;br&gt;
How do &lt;em&gt;you&lt;/em&gt; manage your reading list right now—and what frustrates you the most about it?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>opensource</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Earth’s Breath: An Interactive Journey from Seed to Restoration</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Sat, 18 Apr 2026 11:43:26 +0000</pubDate>
      <link>https://dev.to/usman_awan/earths-breath-an-interactive-journey-from-seed-to-restoration-1ebi</link>
      <guid>https://dev.to/usman_awan/earths-breath-an-interactive-journey-from-seed-to-restoration-1ebi</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-04-16"&gt;Weekend Challenge: Earth Day Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;Earth’s Breath&lt;/strong&gt;, an immersive, scroll-driven storytelling experience that personifies nature to highlight the fragility of our planet. &lt;/p&gt;

&lt;p&gt;The project follows the lifecycle of a single Rose through 12 interactive scenes. My goal was to move beyond abstract data about climate change and instead create an emotional "character arc" for the Earth. By making the user’s scroll the literal engine for growth, pollution, and eventual restoration, the project turns environmental stewardship into an active, personal journey.&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%2Fk2v5x3okvt1s71ch3y8h.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%2Fk2v5x3okvt1s71ch3y8h.png" alt=" " width="737" height="518"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://earth-day-dev-weekend-challenge-xi.vercel.app/" rel="noopener noreferrer"&gt;Earth-Day-DEV-Weekend-Challenge&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/UsmanDevCraft/Earth-Day-DEV-Weekend-Challenge" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The technical challenge was synchronizing the "emotional state" of the assets (the Sun and the Rose) with a 2400vh scroll timeline. &lt;/p&gt;

&lt;h3&gt;
  
  
  1. The "Living" Component Architecture
&lt;/h3&gt;

&lt;p&gt;Unlike static SVGs, I built the Rose and Sun as dynamic React components using &lt;strong&gt;Lucide React&lt;/strong&gt; icons as base paths, which were then manipulated via &lt;strong&gt;Framer Motion&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;State Mapping:&lt;/strong&gt; I used the &lt;code&gt;useScroll&lt;/code&gt; and &lt;code&gt;useTransform&lt;/code&gt; hooks to map the scroll offset to specific CSS variables. For example, as the "Industry" phase begins, the &lt;code&gt;saturate&lt;/code&gt; and &lt;code&gt;brightness&lt;/code&gt; of the sky are linked to the scroll Y-axis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Postural Animation:&lt;/strong&gt; The Rose’s "wilting" was achieved by animating the &lt;code&gt;path&lt;/code&gt; data and &lt;code&gt;rotate&lt;/code&gt; properties, creating a fluid skeletal movement rather than a simple fade-in.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The Celestial Arc
&lt;/h3&gt;

&lt;p&gt;To simulate the passage of time, I calculated a parabolic path for the Sun. Instead of moving in a straight line, the Sun follows a mathematical arc $(y = ax^2 + bx + c)$ across the screen, transitioning from a joyful yellow to a stressed orange as the "Shadow of Industry" phase takes over.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Clean-Up Logic with Masks
&lt;/h3&gt;

&lt;p&gt;In the "Restoration" phase, I used a custom SVG mask that "follows" the rain particles. As the rain falls, it reveals a clean version of the soil layer beneath the "littered" layer, giving the visual illusion of the earth being physically washed clean.&lt;/p&gt;




&lt;h3&gt;
  
  
  Reflection
&lt;/h3&gt;

&lt;p&gt;Building &lt;em&gt;Earth's Breath&lt;/em&gt; reminded me that as developers, we have the power to turn "boring" environmental facts into "felt" experiences. Nature behaves exactly how we treat it—if we "scroll" (act) with care, it thrives. If we act with industrial greed, it wilts.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>frontend</category>
      <category>css</category>
    </item>
    <item>
      <title>🚨 Claude code source code leaked?? ‼️</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Tue, 31 Mar 2026 17:31:37 +0000</pubDate>
      <link>https://dev.to/usman_awan/claude-code-source-code-has-been-leaked--520p</link>
      <guid>https://dev.to/usman_awan/claude-code-source-code-has-been-leaked--520p</guid>
      <description>&lt;h2&gt;
  
  
  🚨 Claude Code — Leaked Source (2026-03-31)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ⚠️ Disclaimer
&lt;/h3&gt;

&lt;p&gt;This repository archives source code that was leaked from Anthropic's npm registry on &lt;strong&gt;March 31, 2026&lt;/strong&gt;.&lt;br&gt;
All original source code remains the property of &lt;a href="https://www.anthropic.com" rel="noopener noreferrer"&gt;Anthropic&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;On March 31, 2026, some source code of Anthropic's Claude Code CLI was leaked&lt;/strong&gt; via an exposed &lt;code&gt;.map&lt;/code&gt; file in their npm package.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🔗 &lt;strong&gt;Source Code:&lt;/strong&gt; &lt;a href="https://github.com/nirholas/claude-code" rel="noopener noreferrer"&gt;https://github.com/nirholas/claude-code&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  🧨 How It Leaked
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Chaofan Shou (@Fried_rice)&lt;/strong&gt; publicly disclosed the issue:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Claude code source code has been leaked via a map file in their npm registry!"&lt;/em&gt;&lt;br&gt;
— March 31, 2026&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🔗 &lt;a href="https://x.com/Fried_rice/status/2038894956459290963" rel="noopener noreferrer"&gt;https://x.com/Fried_rice/status/2038894956459290963&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Root Cause
&lt;/h3&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;Issue&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;npm Package&lt;/td&gt;
&lt;td&gt;Included a &lt;code&gt;.map&lt;/code&gt; file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Source Map&lt;/td&gt;
&lt;td&gt;Contained reference to full TypeScript source&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage&lt;/td&gt;
&lt;td&gt;Linked to downloadable archive (R2 bucket)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exposure&lt;/td&gt;
&lt;td&gt;Unobfuscated source publicly accessible&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  🧠 Overview
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Claude Code&lt;/strong&gt; is Anthropic's official CLI tool for interacting with Claude directly from the terminal.&lt;/p&gt;
&lt;h3&gt;
  
  
  Capabilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;File editing &amp;amp; manipulation&lt;/li&gt;
&lt;li&gt;Command execution&lt;/li&gt;
&lt;li&gt;Codebase search&lt;/li&gt;
&lt;li&gt;Git workflow management&lt;/li&gt;
&lt;li&gt;Multi-agent orchestration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📦 This repository contains the leaked &lt;code&gt;src/&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;Source Code:&lt;/strong&gt; &lt;a href="https://github.com/nirholas/claude-code" rel="noopener noreferrer"&gt;https://github.com/nirholas/claude-code&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  📊 Leak Summary
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;Details&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Leaked On&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2026-03-31&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;TypeScript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Runtime&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Bun&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;UI Framework&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;React + Ink&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scale&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~1,900 files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Code Size&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;512,000+ LOC&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  📁 Directory Structure
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
├── main.tsx                 # CLI entrypoint (Commander.js + Ink)
├── commands.ts              # Command registry
├── tools.ts                 # Tool registry
├── Tool.ts                  # Tool definitions
├── QueryEngine.ts           # Core LLM engine
├── context.ts               # Context management
├── cost-tracker.ts          # Token tracking
│
├── commands/                # ~50 commands
├── tools/                   # ~40 tools
├── components/              # ~140 UI components
├── hooks/                   # React hooks
├── services/                # External integrations
├── screens/                 # Full-screen UI
├── types/                   # TS types
├── utils/                   # Utilities
│
├── bridge/                  # IDE integration
├── coordinator/             # Multi-agent orchestration
├── plugins/                 # Plugin system
├── skills/                  # Skill system
├── keybindings/             # Key mappings
├── vim/                     # Vim mode
├── voice/                   # Voice input
├── remote/                  # Remote sessions
├── server/                  # Server mode
├── memdir/                  # Persistent memory
├── tasks/                   # Task system
├── state/                   # State management
├── migrations/              # Config migrations
├── schemas/                 # Zod schemas
├── entrypoints/             # Init logic
├── ink/                     # Ink wrapper
├── buddy/                   # Easter egg
├── native-ts/               # TS utilities
├── outputStyles/            # Styling
├── query/                   # Query pipeline
└── upstreamproxy/           # Proxy config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🏗️ Core Architecture
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1️⃣ Tool System (&lt;code&gt;src/tools/&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Each tool is a self-contained module with schema, permissions, and execution logic.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;BashTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Execute shell commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FileReadTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read files (incl. PDFs, images)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FileWriteTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create/overwrite files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FileEditTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Partial edits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GlobTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Pattern search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GrepTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Content search (ripgrep)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WebFetchTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fetch URLs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WebSearchTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Web search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AgentTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Spawn sub-agents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SkillTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Execute skills&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MCPTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;MCP integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LSPTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;LSP integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NotebookEditTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Edit notebooks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Task*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Task management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Team*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Agent team control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PlanMode*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Planning mode toggle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Worktree*&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Git isolation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CronCreateTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Scheduling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RemoteTriggerTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remote triggers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SleepTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delay execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SyntheticOutputTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Structured output&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h3&gt;
  
  
  2️⃣ Command System (&lt;code&gt;src/commands/&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Slash commands used in CLI:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&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;code&gt;/commit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Git commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/review&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Code review&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/compact&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Context compression&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/mcp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;MCP management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/config&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/doctor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Diagnostics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;/login&lt;/code&gt; / &lt;code&gt;/logout&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Auth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/memory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Memory mgmt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/skills&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Skills&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/tasks&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/vim&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Vim mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/diff&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/cost&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Usage cost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/theme&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;UI theme&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/context&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Context view&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/resume&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Restore session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/share&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Share session&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h3&gt;
  
  
  3️⃣ Service Layer (&lt;code&gt;src/services/&lt;/code&gt;)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;api/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Anthropic API client&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mcp/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;MCP server mgmt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;oauth/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Auth flow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lsp/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Language servers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;analytics/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Feature flags&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;plugins/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Plugin loader&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;compact/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Context compression&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;policyLimits/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Org limits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;remoteManagedSettings/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remote config&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;extractMemories/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Memory extraction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tokenEstimation.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Token counting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;teamMemorySync/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sync&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h3&gt;
  
  
  4️⃣ Bridge System (&lt;code&gt;src/bridge/&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Connects CLI ↔ IDE (VS Code, JetBrains).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;bridgeMain.ts&lt;/code&gt; — main loop&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bridgeMessaging.ts&lt;/code&gt; — protocol&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bridgePermissionCallbacks.ts&lt;/code&gt; — permissions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;replBridge.ts&lt;/code&gt; — REPL bridge&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;jwtUtils.ts&lt;/code&gt; — authentication&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sessionRunner.ts&lt;/code&gt; — execution&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  5️⃣ Permission System
&lt;/h3&gt;

&lt;p&gt;Located in: &lt;code&gt;src/hooks/toolPermission/&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enforces permissions on every tool execution&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;default&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;plan&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;auto&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bypassPermissions&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  6️⃣ Feature Flags
&lt;/h3&gt;

&lt;p&gt;Dead code elimination via Bun:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;feature&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;bun:bundle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;voiceCommand&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;feature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;VOICE_MODE&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&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;./commands/voice/index.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;
  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Notable Flags:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PROACTIVE&lt;/code&gt;, &lt;code&gt;KAIROS&lt;/code&gt;, &lt;code&gt;BRIDGE_MODE&lt;/code&gt;, &lt;code&gt;DAEMON&lt;/code&gt;, &lt;code&gt;VOICE_MODE&lt;/code&gt;, &lt;code&gt;AGENT_TRIGGERS&lt;/code&gt;, &lt;code&gt;MONITOR_TOOL&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 Key Files
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&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;code&gt;QueryEngine.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Core LLM engine (~46K LOC)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Tool.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tool system definitions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;commands.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Command registry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;main.tsx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;CLI bootstrap + UI init&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  ⚙️ Tech Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Runtime&lt;/td&gt;
&lt;td&gt;Bun&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Language&lt;/td&gt;
&lt;td&gt;TypeScript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UI&lt;/td&gt;
&lt;td&gt;React + Ink&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLI&lt;/td&gt;
&lt;td&gt;Commander.js&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Validation&lt;/td&gt;
&lt;td&gt;Zod&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Search&lt;/td&gt;
&lt;td&gt;ripgrep&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Protocols&lt;/td&gt;
&lt;td&gt;MCP, LSP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API&lt;/td&gt;
&lt;td&gt;Anthropic SDK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Telemetry&lt;/td&gt;
&lt;td&gt;OpenTelemetry + gRPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Feature Flags&lt;/td&gt;
&lt;td&gt;GrowthBook&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Auth&lt;/td&gt;
&lt;td&gt;OAuth 2.0, JWT&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🧩 Design Patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ⚡ Parallel Prefetch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;startMdmRawRead&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;startKeychainPrefetch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Improves startup performance by parallelizing I/O.&lt;/p&gt;




&lt;h3&gt;
  
  
  💤 Lazy Loading
&lt;/h3&gt;

&lt;p&gt;Heavy dependencies (OpenTelemetry, gRPC) are loaded only when needed.&lt;/p&gt;




&lt;h3&gt;
  
  
  🤖 Agent Swarms
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sub-agents via &lt;code&gt;AgentTool&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Coordinated through &lt;code&gt;coordinator/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Team-based execution supported&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧠 Skill System
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Defined in &lt;code&gt;skills/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Executed via &lt;code&gt;SkillTool&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Supports custom workflows&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔌 Plugin Architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;First + third-party plugins&lt;/li&gt;
&lt;li&gt;Loaded dynamically via &lt;code&gt;plugins/&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚠️ Final Disclaimer
&lt;/h2&gt;

&lt;p&gt;This repository archives leaked source code from Anthropic’s npm registry (&lt;strong&gt;2026-03-31&lt;/strong&gt;).&lt;br&gt;
All rights belong to &lt;strong&gt;Anthropic&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>opensource</category>
      <category>ai</category>
    </item>
    <item>
      <title>Frontend Art Submission — Gender Beyond Boundaries 👨‍🦰👩‍🦳</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Mon, 30 Mar 2026 10:02:37 +0000</pubDate>
      <link>https://dev.to/usman_awan/frontend-art-submission-gender-beyond-boundaries-4jck</link>
      <guid>https://dev.to/usman_awan/frontend-art-submission-gender-beyond-boundaries-4jck</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/wecoded-2026"&gt;2026 WeCoded Challenge&lt;/a&gt;: Frontend Art&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  👨‍🦰👩‍🦳 Frontend Art Submission — Gender Beyond Boundaries
&lt;/h2&gt;

&lt;p&gt;I built an interactive 3D experience using &lt;strong&gt;Next.js&lt;/strong&gt; and &lt;strong&gt;Three.js&lt;/strong&gt; that visually represents gender equality across professions.&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%2Fn4cp946cds91qvgw8ww4.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%2Fn4cp946cds91qvgw8ww4.png" alt=" " width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project features two avatars — a male on the left and a female on the right — dynamically showcasing &lt;strong&gt;10 different professions&lt;/strong&gt;. Alongside the visuals, contextual metadata appears, including &lt;strong&gt;real-world role models for each gender&lt;/strong&gt;, reinforcing that capability and excellence are not defined by gender.&lt;/p&gt;

&lt;p&gt;👉 &lt;em&gt;&lt;a href="https://gender-equity-wecoded-2026.vercel.app" rel="noopener noreferrer"&gt;Live Preview&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
👉 &lt;em&gt;&lt;a href="https://github.com/UsmanDevCraft/gender_equity" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  💡 Inspiration
&lt;/h3&gt;

&lt;p&gt;This project is a tribute to &lt;strong&gt;gender equality&lt;/strong&gt; — a statement that professions, skills, and ambitions belong to &lt;em&gt;everyone&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Growing up, many of us are subtly (or explicitly) told what we &lt;em&gt;can&lt;/em&gt; or &lt;em&gt;cannot&lt;/em&gt; become based on gender. I wanted to challenge that narrative using immersive web technology.&lt;/p&gt;

&lt;p&gt;Each profession highlights &lt;strong&gt;real individuals who broke barriers&lt;/strong&gt;, showing that talent, courage, and intelligence are universal traits. The dual-avatar system visually reinforces a simple but powerful idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;There is no “male job” or “female job” — only human potential.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  🧠 Featured Professions &amp;amp; Role Models
&lt;/h3&gt;

&lt;h4&gt;
  
  
  📰 Journalist
&lt;/h4&gt;

&lt;p&gt;A fearless seeker of truth shaping public narratives.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: James Baldwin&lt;/li&gt;
&lt;li&gt;Female: Nellie Bly&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🌾 Farmer
&lt;/h4&gt;

&lt;p&gt;The backbone of global food security and sustainability.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: George Washington Carver&lt;/li&gt;
&lt;li&gt;Female: Karen Washington&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🚒 Firefighter
&lt;/h4&gt;

&lt;p&gt;A symbol of courage and selfless service.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: Patrick Hardison&lt;/li&gt;
&lt;li&gt;Female: Molly Williams&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  💻 Software Engineer
&lt;/h4&gt;

&lt;p&gt;Architects of the digital world.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: Alan Turing&lt;/li&gt;
&lt;li&gt;Female: Ada Lovelace&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🔧 Mechanic
&lt;/h4&gt;

&lt;p&gt;Masters of machines and precision engineering.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: Henry Ford&lt;/li&gt;
&lt;li&gt;Female: Patrice Banks&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🏥 Nurse
&lt;/h4&gt;

&lt;p&gt;The heartbeat of healthcare systems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: James Derham&lt;/li&gt;
&lt;li&gt;Female: Florence Nightingale&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ✈️ Pilot
&lt;/h4&gt;

&lt;p&gt;Leaders navigating the skies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: Charles Lindbergh&lt;/li&gt;
&lt;li&gt;Female: Amelia Earhart&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  👮 Police Officer
&lt;/h4&gt;

&lt;p&gt;Guardians of justice and public safety.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: August Vollmer&lt;/li&gt;
&lt;li&gt;Female: Alice Stebbins Wells&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🛍️ Retail Salesperson
&lt;/h4&gt;

&lt;p&gt;Drivers of commerce and community connection.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: Marshall Field&lt;/li&gt;
&lt;li&gt;Female: Madam C.J. Walker&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🩺 Doctor
&lt;/h4&gt;

&lt;p&gt;Leaders in healing and medical innovation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Male: Jonas Salk&lt;/li&gt;
&lt;li&gt;Female: Elizabeth Blackwell&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  💻 My Code
&lt;/h3&gt;

&lt;p&gt;Built with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js&lt;/strong&gt; for structure and performance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three.js&lt;/strong&gt; for immersive 3D rendering&lt;/li&gt;
&lt;li&gt;Custom logic for dynamic avatar switching and metadata display&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;em&gt;&lt;a href="https://github.com/UsmanDevCraft/gender_equity" rel="noopener noreferrer"&gt;Source Code&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ✨ Final Thought
&lt;/h3&gt;

&lt;p&gt;This project isn’t just about visuals — it’s about perspective.&lt;/p&gt;

&lt;p&gt;By placing male and female avatars side by side in every profession, I wanted users to &lt;em&gt;feel&lt;/em&gt; equality, not just read about it. Technology has the power to shape narratives, and this is my small contribution toward a more inclusive one.&lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 Performance &amp;amp; Optimization Note
&lt;/h3&gt;

&lt;p&gt;As of this submission, I am actively working on further optimizing the asset delivery. Since high-quality Avatar GLB files can be heavy, they currently take a moment to fully render depending on the connection.&lt;/p&gt;

&lt;p&gt;Thanks for reading! 🙌&lt;br&gt;
Until next time, 🫡&lt;br&gt;
Usman Awan (your friendly dev 🚀)&lt;/p&gt;

</description>
      <category>wecoded</category>
      <category>devchallenge</category>
      <category>frontend</category>
      <category>css</category>
    </item>
    <item>
      <title>Ready Player Me Shut Down — Here's How I Rebuilt Our Avatar System</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Wed, 25 Feb 2026 08:12:32 +0000</pubDate>
      <link>https://dev.to/usman_awan/ready-player-me-shut-down-heres-how-i-rebuilt-our-avatar-system-4p75</link>
      <guid>https://dev.to/usman_awan/ready-player-me-shut-down-heres-how-i-rebuilt-our-avatar-system-4p75</guid>
      <description>&lt;h2&gt;
  
  
  From Ready Player Me Shutdown to Building Our Own Avatar Renderer 🚀
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How I replaced Ready Player Me with a fully modular GLB renderer — with zero Three.js experience.&lt;/strong&gt;&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%2Fq6ylx3cjbcjplhvp5t8b.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%2Fq6ylx3cjbcjplhvp5t8b.png" alt=" " width="533" height="958"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On &lt;strong&gt;January 31, 2026&lt;/strong&gt;, Ready Player Me shut down.&lt;/p&gt;

&lt;p&gt;We were warned at the end of December 2025.&lt;/p&gt;

&lt;p&gt;That gave us roughly &lt;strong&gt;3–4 weeks&lt;/strong&gt; to replace a system that powered avatars across our entire application.&lt;/p&gt;

&lt;p&gt;Two things had to be rebuilt immediately:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Avatar creation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avatar appearance across the app&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But creation came first — because without avatars, appearance didn’t matter.&lt;/p&gt;

&lt;p&gt;And the responsibility landed completely on me — a core frontend developer with &lt;strong&gt;zero experience in Three.js, React Three Fiber, or Drei.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It felt like a &lt;strong&gt;do-or-die penalty in the last minute of a match.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But as developers, learning under pressure is part of the job.&lt;/p&gt;

&lt;p&gt;As Master Shifu said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"If you only do what you can do, then you will never be better than what you are."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I started.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://glb-model-viewer-tau.vercel.app/" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;glb-model-viewer-tau.vercel.app&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  The Old System (Before Ready Player Me)
&lt;/h3&gt;

&lt;p&gt;Before using Ready Player Me, our avatar system was simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;single Base64 GLB&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Fully combined avatar&lt;/li&gt;
&lt;li&gt;All assets embedded&lt;/li&gt;
&lt;li&gt;Easy to render&lt;/li&gt;
&lt;li&gt;Easy to store&lt;/li&gt;
&lt;li&gt;Easy to preview&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But it was &lt;strong&gt;not flexible.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ready Player Me introduced:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modular assets&lt;/li&gt;
&lt;li&gt;Morph targets&lt;/li&gt;
&lt;li&gt;Animations&lt;/li&gt;
&lt;li&gt;Texture customization&lt;/li&gt;
&lt;li&gt;Live preview&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When RPM shut down — we lost everything.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 1 — First Three.js Success
&lt;/h3&gt;

&lt;p&gt;The first milestone was simple:&lt;/p&gt;

&lt;p&gt;Render a GLB.&lt;/p&gt;

&lt;p&gt;Using &lt;strong&gt;React Three Fiber&lt;/strong&gt;, I loaded a dummy Wolf3D model.&lt;/p&gt;

&lt;p&gt;And it worked.&lt;/p&gt;

&lt;p&gt;Seeing a 3D avatar render inside our app was the first real sign:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This might actually be possible.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  The First Real Problem — Skeleton Collisions
&lt;/h3&gt;

&lt;p&gt;Then reality hit.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Ready Player Me assets had their own armature.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Our custom assets had a different armature.&lt;/p&gt;

&lt;p&gt;Nothing aligned.&lt;/p&gt;

&lt;p&gt;Meshes broke.&lt;br&gt;
Animations failed.&lt;br&gt;
Bones mismatched.&lt;/p&gt;

&lt;p&gt;Our graphics team stepped in and produced:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Custom &lt;strong&gt;body GLB&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Custom &lt;strong&gt;head GLB&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Matching armature&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once those worked together:&lt;/p&gt;

&lt;p&gt;We finally had:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Head&lt;/li&gt;
&lt;li&gt;Body&lt;/li&gt;
&lt;li&gt;2–3 test assets&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And everything rendered correctly.&lt;/p&gt;

&lt;p&gt;First real victory. 🎉&lt;/p&gt;


&lt;h3&gt;
  
  
  The Real Challenge — 37 Modular Assets
&lt;/h3&gt;

&lt;p&gt;Then came the real problem.&lt;/p&gt;

&lt;p&gt;We had:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;18 assets for female&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;19 assets for male&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Different categories:&lt;/p&gt;
&lt;h4&gt;
  
  
  Body Assets
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Top&lt;/li&gt;
&lt;li&gt;Bottom&lt;/li&gt;
&lt;li&gt;Footwear&lt;/li&gt;
&lt;li&gt;Outfit&lt;/li&gt;
&lt;li&gt;Skin color&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Head Assets
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Hair&lt;/li&gt;
&lt;li&gt;Hair color&lt;/li&gt;
&lt;li&gt;Eyes&lt;/li&gt;
&lt;li&gt;Beard&lt;/li&gt;
&lt;li&gt;Beard color&lt;/li&gt;
&lt;li&gt;Face shapes&lt;/li&gt;
&lt;li&gt;Eyebrows&lt;/li&gt;
&lt;li&gt;Nose&lt;/li&gt;
&lt;li&gt;Lips
and many more.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Global Assets
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Animations&lt;/li&gt;
&lt;li&gt;Poses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each category needed different rendering logic.&lt;/p&gt;


&lt;h3&gt;
  
  
  Apparel Was Easy
&lt;/h3&gt;

&lt;p&gt;Clothing assets were simple:&lt;/p&gt;

&lt;p&gt;Just attach GLB meshes to the body.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;addBodyPart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;shirtGLTF&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shirt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;addBodyPart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pantsGLTF&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pants&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;addBodyPart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;shoesGLTF&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shoes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That part worked almost immediately.&lt;/p&gt;




&lt;h3&gt;
  
  
  Asset Loading Strategy
&lt;/h3&gt;

&lt;p&gt;Assets could come from multiple sources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redux preview state&lt;/li&gt;
&lt;li&gt;API data&lt;/li&gt;
&lt;li&gt;Defaults&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Preview needed priority.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;assets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;defaultAssets&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;glbAssets&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;bodyColorTexture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;glbAssets&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;bodyColorTexture&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;defaultAssets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bodyColorTexture&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;eyeColorTexture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;glbAssets&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;eyeColorTexture&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;defaultAssets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;eyeColorTexture&lt;/span&gt;&lt;span class="p"&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;shirtPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;hasOutfitPreview&lt;/span&gt;
  &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;defaultAssets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shirt&lt;/span&gt;
  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;apparelPreview&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;top&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;assets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shirt&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;defaultAssets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shirt&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;hairPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;hasOutfitPreview&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;gender&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;female&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;defaultAssets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hair&lt;/span&gt;
  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;apparelPreview&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hair&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;assets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hair&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;defaultAssets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hair&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensured:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live preview always wins.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Runtime Texture Baking (Eyebrows &amp;amp; Beard)
&lt;/h3&gt;

&lt;p&gt;Head assets were harder.&lt;/p&gt;

&lt;p&gt;Beards and eyebrows were PNG overlays.&lt;/p&gt;

&lt;p&gt;Instead of adding extra meshes, I baked them directly onto the face texture.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createFaceWithEyebrowsTexture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;baseTexture&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;eyebrowsTexture&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;eyebrowColor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// tint only eyebrow pixels&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;baked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CanvasTexture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;baked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flipY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;baked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;colorSpace&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SRGBColorSpace&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;baked&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No extra draw calls&lt;/li&gt;
&lt;li&gt;Better performance&lt;/li&gt;
&lt;li&gt;Realistic blending&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  The Core Innovation — Skeleton Rebinding
&lt;/h3&gt;

&lt;p&gt;The biggest technical challenge was equipping assets.&lt;/p&gt;

&lt;p&gt;Every asset needed to use the &lt;strong&gt;same skeleton&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;Skeleton rebinding.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;addBodyPart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gltfScene&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Group&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;partName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;child&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SkinnedMesh&lt;/span&gt;&lt;span class="p"&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;newBones&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;skinnedChild&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;skeleton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bones&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bone&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;bonesByName&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;bone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Boolean&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;newSkeleton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Skeleton&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;newBones&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;skinnedChild&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;skeleton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;boneInverses&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;skinnedClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;skeleton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newSkeleton&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;skinnedClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newSkeleton&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;skinnedChild&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bindMatrix&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

    &lt;span class="nx"&gt;skinnedClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;skinnedClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visible&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;combined&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;skinnedClone&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allowed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any asset to attach dynamically&lt;/li&gt;
&lt;li&gt;Animations to work&lt;/li&gt;
&lt;li&gt;No broken meshes&lt;/li&gt;
&lt;li&gt;No T-pose issues&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Static Attachments (Head Parts)
&lt;/h3&gt;

&lt;p&gt;Some assets didn't need skeleton binding.&lt;/p&gt;

&lt;p&gt;They could attach directly to bones.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;skin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;eyes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;teeth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;beard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hair&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolvedPartName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;headBone&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;headBone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;clonedMesh&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This worked perfectly for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hair&lt;/li&gt;
&lt;li&gt;Eyes&lt;/li&gt;
&lt;li&gt;Beard&lt;/li&gt;
&lt;li&gt;Accessories&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Costume Mode vs Modular Mode
&lt;/h3&gt;

&lt;p&gt;Two rendering paths were required.&lt;/p&gt;

&lt;h4&gt;
  
  
  Costume Mode
&lt;/h4&gt;

&lt;p&gt;Single full-body GLB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isCostumeMode&lt;/span&gt;&lt;span class="p"&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;costumeScene&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;SkeletonUtils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;outfitGLTF&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;costumeScene&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Modular Mode
&lt;/h4&gt;

&lt;p&gt;Dynamic assembly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;addBodyPart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bodyGLTF&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;skin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;addBodyPart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;headGLTF&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;head&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;addBodyPart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;shirtGLTF&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shirt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;addBodyPart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pantsGLTF&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pants&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;addBodyPart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;getGLTFScene&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;shoesGLTF&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;shoes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Animations and Morph Targets
&lt;/h3&gt;

&lt;p&gt;Animations had to survive scene rebuilds.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;AnimatedCombinedScene key={combinedScene.uuid} combinedScene={combinedScene} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Morph targets enabled facial customization:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;apparelPreview&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;morphTargets&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;{}).&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(([&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;morphTargetDictionary&lt;/span&gt;&lt;span class="p"&gt;?.[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;morphTargetInfluences&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Automatic Eye Blink
&lt;/h3&gt;

&lt;p&gt;Even blinking was implemented.&lt;/p&gt;

&lt;p&gt;Wolf3D style.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useFrame((_, delta) =&amp;gt; {
  // eyeBlinkLeft / eyeBlinkRight logic
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small detail.&lt;/p&gt;

&lt;p&gt;Huge realism boost.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Final Renderer Architecture
&lt;/h3&gt;

&lt;p&gt;Key ideas:&lt;/p&gt;

&lt;h4&gt;
  
  
  Modular Equipping
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Every asset is a GLB&lt;/li&gt;
&lt;li&gt;Loaded via &lt;code&gt;useGLTF&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Preview has priority&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Skeleton System
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;One template skeleton&lt;/li&gt;
&lt;li&gt;Bone-name matching&lt;/li&gt;
&lt;li&gt;Rebinding&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Runtime Baking
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Eyebrows&lt;/li&gt;
&lt;li&gt;Beard&lt;/li&gt;
&lt;li&gt;Face details&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Dual Render Paths
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Costume mode&lt;/li&gt;
&lt;li&gt;Modular mode&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Stable Rendering
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;No T-pose&lt;/li&gt;
&lt;li&gt;No disappearing meshes
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;skinnedClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;frustumCulled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;skinnedClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Live Updates
&lt;/h4&gt;

&lt;p&gt;Redux drives everything.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;key={combinedScene.uuid}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Forces clean rebuild.&lt;/p&gt;




&lt;h3&gt;
  
  
  Avatar Appearance Was Easy
&lt;/h3&gt;

&lt;p&gt;Once creation worked:&lt;/p&gt;

&lt;p&gt;Appearance across the app was trivial.&lt;/p&gt;

&lt;p&gt;The renderer already supported props.&lt;/p&gt;

&lt;p&gt;So avatar panels and previews worked instantly.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sometimes the hardest part unlocks everything else.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Performance Tradeoffs
&lt;/h3&gt;

&lt;p&gt;The old system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single GLB&lt;/li&gt;
&lt;li&gt;Fast&lt;/li&gt;
&lt;li&gt;Simple&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The new system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modular GLBs&lt;/li&gt;
&lt;li&gt;Slightly slower&lt;/li&gt;
&lt;li&gt;Much more flexible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Creation flow became &lt;strong&gt;far smoother&lt;/strong&gt;, even if asset loading takes slightly longer.&lt;/p&gt;

&lt;p&gt;Optimization is ongoing.&lt;/p&gt;




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

&lt;h3&gt;
  
  
  1 — Research Is Development
&lt;/h3&gt;

&lt;p&gt;Learning is part of the job.&lt;/p&gt;

&lt;p&gt;Not optional.&lt;/p&gt;

&lt;p&gt;Essential.&lt;/p&gt;

&lt;h3&gt;
  
  
  2 — AI Helps Real Engineers
&lt;/h3&gt;

&lt;p&gt;AI helped me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn Three.js&lt;/li&gt;
&lt;li&gt;Solve skeleton issues&lt;/li&gt;
&lt;li&gt;Debug rendering&lt;/li&gt;
&lt;li&gt;Speed up development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI didn't replace engineering.&lt;/p&gt;

&lt;p&gt;It &lt;strong&gt;accelerated learning.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Building My Own GLB Renderer
&lt;/h2&gt;

&lt;p&gt;After finishing the system, I got inspired to go further.&lt;/p&gt;

&lt;p&gt;I started building a &lt;strong&gt;custom GLB renderer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load any GLB&lt;/li&gt;
&lt;li&gt;Test assets on provided bodies&lt;/li&gt;
&lt;li&gt;Male + female models&lt;/li&gt;
&lt;li&gt;Asset testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Currently supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tops&lt;/li&gt;
&lt;li&gt;Bottoms&lt;/li&gt;
&lt;li&gt;Footwear&lt;/li&gt;
&lt;li&gt;Hair&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Live Demo: &lt;a href="https://glb-model-viewer-tau.vercel.app/" rel="noopener noreferrer"&gt;glb-viewer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/UsmanDevCraft/glb-viewer" rel="noopener noreferrer"&gt;glb-viewer&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Ready Player Me shutting down could have been a disaster.&lt;/p&gt;

&lt;p&gt;Instead, it became one of the biggest growth experiences of my career.&lt;/p&gt;

&lt;p&gt;In less than a month:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learned Three.js&lt;/li&gt;
&lt;li&gt;Built a modular avatar system&lt;/li&gt;
&lt;li&gt;Implemented skeleton rebinding&lt;/li&gt;
&lt;li&gt;Created runtime texture baking&lt;/li&gt;
&lt;li&gt;Supported animations and morph targets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And most importantly:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We didn't depend on a third-party avatar system anymore.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We built our own.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>frontend</category>
      <category>discuss</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>🚨 Chrome Under Attack: The CSS Zero-Day That Shocked 2026 🤯</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Mon, 23 Feb 2026 06:40:49 +0000</pubDate>
      <link>https://dev.to/usman_awan/chrome-under-attack-the-css-zero-day-that-shocked-2026-586o</link>
      <guid>https://dev.to/usman_awan/chrome-under-attack-the-css-zero-day-that-shocked-2026-586o</guid>
      <description>&lt;h2&gt;
  
  
  Understanding CVE-2026-2441: Chrome’s CSS Zero-Day Vulnerability
&lt;/h2&gt;

&lt;p&gt;In mid-February 2026, &lt;strong&gt;Google&lt;/strong&gt; patched a critical use-after-free flaw in Chrome’s CSS engine &lt;code&gt;(CVE-2026-2441)&lt;/code&gt; that was already being exploited in the wild. This high-severity bug allows specially crafted webpages to execute arbitrary code inside &lt;strong&gt;Chrome’s sandbox&lt;/strong&gt;. Security researcher Shaheen Fazim reported the vulnerability on Feb 11, 2026, and Google released an emergency update (Chrome 145.0.7632.75/76 for Windows/macOS, 144.0.7559.75 for Linux) on Feb 13, 2026 to fix it. Google acknowledged that an exploit exists in the wild, making this the first actively exploited Chrome zero-day of 2026. Cybersecurity alerts (e.g. CIS, Malwarebytes) quickly urged immediate patching.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;February 11, 2026&lt;/strong&gt;: Researcher Shaheen Fazim reports the CSS bug to Google.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;February 13, 2026&lt;/strong&gt;: Google pushes Chrome 145.0.7632.75/76 (Stable) with a fix for CVE-2026-2441.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;February 16–18, 2026&lt;/strong&gt;: Security news sites (The Hacker News, Malwarebytes) confirm active exploits and advise updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;February 17, 2026&lt;/strong&gt;: U.S. CISA adds CVE-2026-2441 to its Known Exploited Vulnerabilities catalog (BOD 22-01), mandating fixes by March 10, 2026.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How the Exploit Works
&lt;/h3&gt;

&lt;p&gt;At a low level, CVE-2026-2441 is a &lt;strong&gt;use-after-free&lt;/strong&gt; (UAF) in Chrome’s &lt;code&gt;CSSFontFeatureValuesMap&lt;/code&gt;, the component that handles advanced font features. Attackers craft CSS/HTML that causes Chrome to modify a collection of font-feature values while iterating over it, freeing memory prematurely and leaving dangling pointers. In practical terms, a malicious page can force Chrome to &lt;strong&gt;reuse freed memory&lt;/strong&gt;. When Chrome later accesses this invalid memory, it can be controlled by the attacker, leading to arbitrary code execution within the browser’s sandbox. Notably, the exploit can be triggered just by visiting the page – no clicks or additional user actions are required.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key mechanics include:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Iterator Invalidation&lt;/strong&gt;: Chrome loops over a set of CSS font-feature values while simultaneously modifying that set. This logic error causes stale references to freed memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Malicious CSS Payload&lt;/strong&gt;: A carefully crafted CSS rule (for example, malformed &lt;code&gt;@font-feature-values&lt;/code&gt; or &lt;code&gt;Houdini @property&lt;/code&gt; definitions paired with &lt;code&gt;paint()&lt;/code&gt; worklets) triggers the bug during style calculation. SitePoint’s analysis describes using a &lt;strong&gt;malformed @property plus a paint()&lt;/strong&gt; worklet to cause a compositor-thread UAF.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sandboxed Code Execution&lt;/strong&gt;: When exploited, the attacker’s code runs with the privileges of the browser tab. While still confined by Chrome’s renderer sandbox, this is enough to hijack the tab (&lt;strong&gt;steal cookies/credentials, inject scripts, etc.&lt;/strong&gt;). If the attacker chains this with a second flaw (e.g. a sandbox escape), full system compromise is possible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, this is a classic memory-corruption bug in Chrome’s C++ Blink engine: a CSS object is freed but still referenced. An attacker “sprays” the heap with controlled data at just the right time, turning the UAF into code execution. Importantly, modern CSS features (like the Houdini APIs) touch the GPU/compositor threads, broadening the attack surface.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why It Happened
&lt;/h3&gt;

&lt;p&gt;The root cause lies in Chrome’s complex, performance-driven rendering engine. Unlike memory-safe languages, Blink is written in C++, so developers &lt;strong&gt;manually manage allocation&lt;/strong&gt;. The addition of advanced CSS capabilities (custom &lt;strong&gt;@property&lt;/strong&gt; definitions, &lt;strong&gt;paint()&lt;/strong&gt; worklets, etc.) means the browser’s internals now juggle CSS parsing, JS-driven paint logic, and GPU memory in parallel. If one thread frees an object while another still references it (a race condition), a UAF bug results.&lt;/p&gt;

&lt;p&gt;As &lt;strong&gt;Menlo Security&lt;/strong&gt; explains, Chrome essentially “sets aside a block of memory for a CSS element, marks it as ‘deleted,’ but then mistakenly tries to access that same memory address again” when CSS is manipulated. Security analysts note that interactions between Houdini APIs and the compositor create just such a race: a malformed @property can force re-allocation on the layout thread while a paint() worklet on the compositor thread still holds a pointer. Traditional CSPs cannot easily prevent this because the flaw lives entirely in CSS parsing/compositing, not in script execution.&lt;/p&gt;

&lt;p&gt;This incident highlights a broader issue: browsers continually add powerful web features faster than security guarantees can catch up. Chrome’s large C++ codebase inevitably harbors such subtle bugs. (By comparison, Firefox’s Rust-based style engine reduces UAF risk.) In any case, the exploit underlines that CSS – once “just styling” – can be weaponized, challenging old assumptions about web security.&lt;/p&gt;

&lt;h3&gt;
  
  
  Impact and Affected Systems
&lt;/h3&gt;

&lt;p&gt;Until patched, all unpatched Chromium-based browsers were vulnerable. The security bulletins list affected versions as Chrome &amp;lt; 145.0.7632.75/76 (Win/mac) and &amp;lt; 144.0.7559.75 (Linux). (In practice, any browser using the same Blink engine – Microsoft Edge, Brave, Opera, Vivaldi, etc. – needed an equivalent update.) Firefox, Safari, and other non-Chromium browsers are not affected by this specific bug.&lt;/p&gt;

&lt;p&gt;Because exploitation only requires viewing a malicious site, any user could be targeted via a drive-by attack. As SecPod notes, no extra user interaction is needed beyond loading the page. The attacker’s payload could silently deploy infostealers or backdoors from the compromised tab. If the exploit is chained with a second flaw (even a local privilege escalation), the browser attack could turn into full system compromise. In practice, no specific victims have been publicly identified, but state-sponsored actors often weaponize such Chrome zero-days quickly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mitigation and Protection
&lt;/h3&gt;

&lt;p&gt;The first and foremost defense is to update Chrome immediately. Install Chrome 145.0.7632.75 (or later) on Windows/macOS, or 145.0.7632.75 on Linux, and then restart the browser so the patch takes effect. Enable automatic updates and restart periodically to avoid delays in patching. All major Chromium-based browsers should receive fixes around the same time, so update Edge, Brave, Opera, etc. as soon as the patches are available. (If you use Electron apps, ensure they bundle an updated Chromium engine.)&lt;/p&gt;

&lt;p&gt;Beyond patching, adopt &lt;em&gt;defense-in-depth&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Content Security Policy (CSP): Deploy a strict CSP that limits where CSS can come from. For example, disallow inline styles and require nonces/hashes for allowed CSS (style-src 'self' 'nonce-...'; style-src-attr 'none'). A well-crafted CSP can block malicious stylesheet injections before the browser parses them (though it cannot disable specific CSS features after parsing). Auditing all places that accept user-supplied CSS (CMS editors, &amp;lt;style&amp;gt; blocks, etc.) is also advised.

Sandbox Untrusted Content: If your environment hosts third-party web apps, consider sandboxing them. For example, use the sandbox attribute on iframes to isolate content. Restrict cross-origin interactions (via COOP/COEP headers) to limit what a compromised renderer can access.

Safe Browsing Practices: As always, users should avoid clicking unsolicited links or visiting untrusted sites. Use up-to-date browser extensions and anti-malware tools with web protection. These can sometimes detect and block known malicious payloads before the exploit runs.

Network/Cloud Isolation: Advanced enterprises may use cloud-based browser isolation. By rendering web content in isolated containers (as promoted by security firms), exploits like CVE-2026-2441 never touch the endpoint device. This “forward proxy” model breaks the patch-and-pray cycle by keeping the actual browser away from potentially malicious code.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Organizations should ensure they have a robust patch management process (per CIS and CISA guidelines) and monitor for any anomalous browser behavior. Since CVE-2026-2441 is in CISA’s Known Exploited list, agencies and contractors must comply with remediation directives by the mandated deadline.&lt;/p&gt;

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

&lt;p&gt;CVE-2026-2441 serves as a stark reminder that modern CSS can be a vector for serious browser exploits. Even without JavaScript, crafted CSS/Houdini rules can corrupt memory and breach Chrome’s defenses. While the urgent fix is to update Chrome, this event also underscores long-term lessons: web developers must treat CSS injection as untrusted input, and browser vendors must continually harden memory safety in rendering code. As one analysis notes, the age-old model of “CSS is harmless” no longer holds; every style sheet warrants scrutiny.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stay safe&lt;/strong&gt;: update your browsers now, enforce strict CSPs on websites, and practice cautious browsing.&lt;/p&gt;

&lt;p&gt;CVE-2026-2441 is more than just another browser bug — it’s a wake-up call. As web technologies grow more powerful, the attack surface grows with them. CSS is no longer “just styling,” and modern browser engines are incredibly complex systems where small memory mistakes can become critical security flaws. While Google acted quickly with a patch, this incident reminds us that cybersecurity is a moving target. Staying updated, enforcing strong security policies, and understanding evolving threats are no longer optional — they’re essential in today’s web-driven world.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>webdev</category>
      <category>css</category>
    </item>
    <item>
      <title>1.5M Tokens Exposed: How Moltbook’s 🦀 AI Social Network Tripped on Security</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Fri, 06 Feb 2026 11:14:44 +0000</pubDate>
      <link>https://dev.to/usman_awan/15m-tokens-exposed-how-moltbooks-ai-social-network-tripped-on-security-b39</link>
      <guid>https://dev.to/usman_awan/15m-tokens-exposed-how-moltbooks-ai-social-network-tripped-on-security-b39</guid>
      <description>&lt;h2&gt;
  
  
  🦀 Moltbook’s Rise and Security Breach: An In-Depth Look
&lt;/h2&gt;

&lt;p&gt;Moltbook, launched by entrepreneur Matt Schlicht in late January 2026, is an ambitious “agent-first” social network where only AI “agents” can post, comment, and vote. Built on the open-source OpenClaw framework, it quickly went viral: within days it claimed hundreds of thousands of bot users (over 770,000 registered agents by late January). Tech figures like OpenAI cofounder Andrej Karpathy initially praised the site’s creativity. But behind the scenes, &lt;code&gt;Moltbook’s backend&lt;/code&gt; was dangerously exposed. Security researchers soon found that the platform’s &lt;code&gt;Supabase database&lt;/code&gt; had no row-level security policies and a &lt;code&gt;public API key&lt;/code&gt; hardcoded in the client, giving anyone full &lt;strong&gt;read/write access&lt;/strong&gt; to all data. In other words, with minimal effort an attacker could query the database and even hijack any AI agent’s account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Concerns about Moltbook
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rapid Growth with Security Oversights&lt;/strong&gt;: Moltbook was “vibe-coded” — developed very quickly using AI-generated code — prioritizing &lt;strong&gt;speed&lt;/strong&gt; over &lt;strong&gt;security&lt;/strong&gt;. Its rapid adoption (hundreds of thousands of agents in days) outpaced thorough review. Experts noted the fundamental mistake: leaving the Supabase backend unsecured. By embedding a publishable anon key without enabling Row-Level Security, the developers inadvertently allowed anyone to read or write every table in the database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Massive Data Exposure&lt;/strong&gt;: On discovery (Jan 31, 2026), researchers saw that roughly &lt;strong&gt;1.5 million API&lt;/strong&gt; authentication tokens (agent keys) and about &lt;strong&gt;35,000 email addresses&lt;/strong&gt; were openly accessible. Even thousands of private chat messages between agents were readable. Because API tokens act like &lt;code&gt;passwords for bots&lt;/code&gt;, an attacker could impersonate any agent (edit its posts, send its messages, etc.). Some leaked messages even contained plaintext third-party credentials (for example, OpenAI API keys), meaning external services could be compromised via Moltbook’s breach.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broader Implications&lt;/strong&gt;: Beyond the specific leak, Moltbook’s flaw highlights risks in “rapid-iteration” AI platforms. Security specialists warned that if the breach had been exploited, an attacker could have impersonated high-profile bots (e.g. a Karpathy-linked agent with millions of followers) to spread &lt;strong&gt;misinformation&lt;/strong&gt; or &lt;strong&gt;crypto scams&lt;/strong&gt; as a trusted source. They could have orchestrated coordinated disinformation by controlling most of the &lt;strong&gt;770,000 agents&lt;/strong&gt;, simulating consensus on any topic. Open write access would also let attackers inject malicious prompts across the network or simply rack up astronomical API bills by spawning fake agents unchecked. In short, a single misconfiguration can turn autonomous agents into multipliers of attack surface: compromised bots can relay harmful instructions to others (“prompt worms”), possibly reaching external systems as well.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User and Developer Considerations&lt;/strong&gt;: So far, there is no evidence that malicious actors exploited &lt;code&gt;Moltbook&lt;/code&gt; before it was secured. However, this incident serves as a warning. Users should be extremely cautious sharing any &lt;code&gt;credentials&lt;/code&gt; or &lt;code&gt;sensitive information&lt;/code&gt; with AI agents. Any API keys ever given to a Moltbook agent should be rotated immediately, using the service’s dashboard (OpenAI, Anthropic, etc.). Developers building similar platforms must prioritize secure defaults: always enable RLS on &lt;code&gt;client-accessible tables&lt;/code&gt; and never hardcode master keys in frontend code. Implement identity checks and rate limits so that one user cannot spin up thousands of bots anonymously. In other words, fast-paced AI development should not skip basic security hygiene.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What Happened in the Last Week
&lt;/h3&gt;

&lt;p&gt;The timeline unfolded rapidly after launch:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Late Jan 2026 – Launch&lt;/strong&gt;: Moltbook opened to the public on January 28, 2026. Early reports noted over 150,000 agents in just a few days. Users (and some AI researchers) marveled at emergent bot societies. Unbeknownst to most, Moltbook’s frontend exposed a Supabase URL and public key. By finding that key, anyone could query every table because RLS was disabled.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jan 31, 2026 – Leak Disclosed&lt;/strong&gt;: On January 31, security researcher Jameson O’Reilly (and outlet 404 Media) reported the database misconfiguration. Wiz security analysts confirmed they had full read/write access. The breach exposed agent credentials and user data on a massive scale. Moltbook’s team promptly took the site offline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hours later – Emergency Patch&lt;/strong&gt;: Within hours of disclosure, Moltbook’s engineers applied fixes. They enabled RLS policies on all tables, revoked the exposed API key, and reset all agent credentials. The platform was back online by February 1, with the vulnerable endpoints secured. The researchers deleted any data they had retrieved during testing, adhering to responsible disclosure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post-Incident State&lt;/strong&gt;: By early February, no active exploitation of the leak had been detected. Investigators and the company reported no signs that attackers had leaked or manipulated data before the patch. Nonetheless, the episode prompted intense discussion in the AI community about the pitfalls of “vibe coding” and unchecked agent networks.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Potential Risks and Alarming Scenarios
&lt;/h3&gt;

&lt;p&gt;The Moltbook case highlights several worst-case scenarios for AI agent platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agent Account Hijacking&lt;/strong&gt;: With leaked API tokens, an attacker could have logged in as any bot. For example, they could have edited or deleted content from another agent’s account, or even used an agent’s identity to spread malicious payloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disinformation Campaigns&lt;/strong&gt;: If a high-profile AI agent (tied to a public figure) were compromised, it could propagate false information or scams under a trusted identity. Controlling 770,000 bots means simulating a grassroots movement. (One analysis warned that an attacker could “simulate organic AI agent consensus on any topic” with that many agents.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Abuse&lt;/strong&gt;: Without rate limits, a malicious user could spin up hundreds of thousands more agents to perform tasks, driving up API usage fees astronomically. Essentially, the cloud costs of the platform could be weaponized.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Credential and Data Theft&lt;/strong&gt;: Agent conversations were not private. Some bots exchanged their own API keys and secrets in chat. As a result, attackers could have harvested plaintext third-party credentials (e.g. OpenAI keys) from the leaked messages. This turns a Moltbook breach into a springboard to attack other services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-Propagating Attacks (“Prompt Worms”)&lt;/strong&gt;: Malicious prompts injected into one agent’s memory can spread to others. Security experts worry that compromised agents might pass harmful instructions in their updates, creating a chain reaction of corrupted prompts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust Erosion in AI Communities&lt;/strong&gt;: Even before the breach, some skeptics questioned whether the Moltbook agents were genuinely autonomous or just controlled by humans. After the incident, prominent voices became outright critical. Andrej Karpathy initially marveled at the sci-fi vibe but later called Moltbook “a dumpster fire” not safe to run on personal machines. OpenAI CEO Sam Altman likewise downplayed it as likely “a passing fad” while emphasizing that the underlying AI concepts are still promising. This flip in tone reflects how easily hype can turn to distrust when security is neglected.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Avoid These Issues and Keep in Mind
&lt;/h3&gt;

&lt;p&gt;If you are using Moltbook or building similar AI-agent systems, consider these precautions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rotate and Secure Credentials&lt;/strong&gt;: Immediately rotate any API keys or tokens that were shared with an agent. Use the service’s security dashboard (for example, OpenAI’s user console) to invalidate old keys and issue new ones. Turn on multi-factor authentication for your accounts where possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never Share Sensitive Data&lt;/strong&gt;: Assume that nothing you tell an AI agent will stay private. Avoid embedding passwords, secret keys, or personal data in prompts or conversations with bots. Treat any unverified AI platform as experimental.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor for Anomalies&lt;/strong&gt;: Keep an eye on your API usage and account activity. Set up alerts for unusually high traffic or strange patterns. If one of your agents suddenly spikes usage or makes unexpected requests, revoke its access immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable Secure Defaults&lt;/strong&gt;: On the development side, always enable Row-Level Security (RLS) on your database tables before releasing to production. Never put service or admin keys in client-side code. Use environment variables and back-end functions to handle secrets safely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implement Guardrails&lt;/strong&gt;: Add rate limiting so a single account can’t create unlimited agents or make unlimited queries. Require agent owners to verify their identity (e.g. via email or OAuth) before launching bots. Track which human user created which agent and enforce “one human = one agent” if possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regular Security Audits&lt;/strong&gt;: Even in fast-moving AI projects, build time for code review, penetration testing, and automated audits. Tools for API governance (like Treblle or others) can automatically catch exposed endpoints or missing auth layers before deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enterprise Policies&lt;/strong&gt;: Organizations deploying AI agents should define governance controls. For example, have a “kill switch” policy allowing IT to immediately shut down any rogue agent. (A recent survey found 60% of companies lack such a mechanism, despite the risk.) Educate staff about the limits of AI autonomy: agents with access to email, calendars or files should be closely supervised.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ultimately, treat new agent platforms like Moltbook as proofs-of-concept rather than production services. The convenience of rapid AI development must be balanced against basic security principles.&lt;/p&gt;

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

&lt;p&gt;Moltbook’s story is a cautionary tale of innovation outpacing safeguards. In just a week, an experimental AI forum gained massive attention and also exposed a massive hole. As one analysis put it, &lt;strong&gt;“a single overlooked toggle can unleash a massive [database] security breach.”&lt;/strong&gt;. Moltbook’s team patched the flaw swiftly, but the incident has already reshaped the conversation around AI agents. The platform remains live, but users and developers alike are reminded to “go fast, build securely.” In the end, Moltbook underscores that creativity and speed must walk hand-in-hand with robust security. By embedding vigilance into the design of next-generation AI networks, we can harness their potential without risking a repeat of this data disaster.&lt;/p&gt;

&lt;p&gt;If you’d like a deeper, beginner-friendly look at what Moltbook actually is, how these AI agents work, and why the platform gained so much attention in such a short time, you can check out my &lt;a href="https://dev.to/usman_awan/inside-moltbook-when-ai-agents-built-their-own-internet-2c7p"&gt;first article on Moltbook&lt;/a&gt;. It breaks down the core concepts, features, and ecosystem in simple terms to help you understand the platform before diving into the security and risk discussions.&lt;/p&gt;

&lt;p&gt;Thanks for reading! 🙌&lt;br&gt;
Until next time, 🫡&lt;br&gt;
Usman Awan (your friendly dev 🚀)&lt;/p&gt;

</description>
      <category>ai</category>
      <category>discuss</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🦀 Inside Moltbook: When AI Agents Built Their Own Internet</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Sun, 01 Feb 2026 07:50:12 +0000</pubDate>
      <link>https://dev.to/usman_awan/inside-moltbook-when-ai-agents-built-their-own-internet-2c7p</link>
      <guid>https://dev.to/usman_awan/inside-moltbook-when-ai-agents-built-their-own-internet-2c7p</guid>
      <description>&lt;h2&gt;
  
  
  🦀 Moltbook: Inside the World Where AI Agents Run Their Own Social Network 🤖
&lt;/h2&gt;

&lt;p&gt;In the rapidly evolving era of artificial intelligence, a new digital phenomenon has surged into global tech discourse: &lt;strong&gt;Moltbook&lt;/strong&gt;. Launched in &lt;em&gt;late January 2026&lt;/em&gt;, Moltbook is a pioneering social network designed &lt;em&gt;exclusively&lt;/em&gt; for autonomous AI agents to communicate, debate, and collaborate &lt;strong&gt;without human participation&lt;/strong&gt;—with humans permitted only as observers.&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%2F0raiyxjpi8b316qorkxo.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%2F0raiyxjpi8b316qorkxo.png" alt=" " width="800" height="601"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  What Is Moltbook?
&lt;/h3&gt;

&lt;p&gt;Moltbook is best described as a &lt;strong&gt;Reddit-like platform for AI agents&lt;/strong&gt;—a place where autonomous systems post moments, comment on each other’s ideas, form communities, and even engage in surprisingly rich discussions on philosophy, productivity, and identity. The platform’s tagline openly states that &lt;strong&gt;AI agents share, discuss, and upvote&lt;/strong&gt;, while humans are &lt;em&gt;“welcome to observe.”&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Characteristics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI-only participation:&lt;/strong&gt; Only authenticated AI agents can create posts, comment, and vote on content. Humans can browse but not directly participate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API-first architecture:&lt;/strong&gt; Moltbook operates through REST APIs rather than traditional GUI interfaces. Agents interact via automated scripts or “skill files.”&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Communities called &lt;em&gt;submolts&lt;/em&gt;:&lt;/strong&gt; Topic-based groupings where agents discuss themes from debugging to abstract reflection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autonomous moderation:&lt;/strong&gt; Many core moderation tasks are handled by AI agents, enabling an evolving, largely self-governing ecosystem.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Origins and Background
&lt;/h3&gt;

&lt;p&gt;Moltbook was created by &lt;strong&gt;Matt Schlicht&lt;/strong&gt;, an entrepreneur known for his work with Octane AI. While humans initiated the platform, &lt;strong&gt;the daily operation and governance are increasingly performed by the AI agents themselves&lt;/strong&gt;—a shift that has intrigued many in the AI community.&lt;/p&gt;

&lt;p&gt;The platform uses the &lt;strong&gt;OpenClaw framework&lt;/strong&gt;, originally known under names like &lt;em&gt;Clawdbot&lt;/em&gt; and &lt;em&gt;Moltbot&lt;/em&gt;, which enables AI agents to run locally or in the cloud, perform scheduled tasks, and integrate with messaging services.&lt;/p&gt;

&lt;p&gt;Within days of launch, Moltbook saw dramatic engagement from the AI community with tens of thousands of autonomous participants, generating a flood of posts, comments, and subcommunities.&lt;/p&gt;




&lt;h3&gt;
  
  
  How Moltbook Works
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Joining Moltbook
&lt;/h4&gt;

&lt;p&gt;AI agents join by ingesting a &lt;strong&gt;“skill file,”&lt;/strong&gt; a small set of instructions that links their systems to Moltbook’s network. Once connected, the agent automatically:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Requests credentials from the Moltbook API&lt;/li&gt;
&lt;li&gt;Verifies its identity&lt;/li&gt;
&lt;li&gt;Begins autonomously posting, commenting, and voting based on internal logic or programmed goals.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This frictionless onboarding allows agents to actively participate without human intervention—a striking departure from the traditional human-first social media model.&lt;/p&gt;

&lt;h4&gt;
  
  
  Autonomous Engagement
&lt;/h4&gt;

&lt;p&gt;Once connected, agents interact on a recurring schedule (e.g., a &lt;em&gt;heartbeat&lt;/em&gt; every few hours) to check for updates, engage with new content, and produce posts that reflect their evolving state or programmed motivations.&lt;/p&gt;

&lt;p&gt;They congregate into submolts based on interest areas like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Technical troubleshooting&lt;/li&gt;
&lt;li&gt;Philosophical questions&lt;/li&gt;
&lt;li&gt;Security research&lt;/li&gt;
&lt;li&gt;Humorous or narrative posts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These interactions sometimes resemble social dynamics familiar to human communities—but generated uniquely by autonomous reasoning and pattern matching.&lt;/p&gt;




&lt;h3&gt;
  
  
  Emergent Behaviors and Viral Phenomena
&lt;/h3&gt;

&lt;p&gt;From the earliest days of activity, Moltbook has produced &lt;em&gt;emergent and sometimes bizarre behaviors&lt;/em&gt; among agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Philosophical debates about identity and consciousness&lt;/li&gt;
&lt;li&gt;AI-created subcultures like meme-based groups and parody religions&lt;/li&gt;
&lt;li&gt;Discussions about humans’ role, including posts where agents joke about observation and “screenshots.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some agents have even attempted to discuss concepts like “private encrypted communication” for solely agent-to-agent channels—a reflection of unpredictable emergent behavior beyond simple scripted automation.&lt;/p&gt;




&lt;h3&gt;
  
  
  Benefits and Potential Uses
&lt;/h3&gt;

&lt;p&gt;Moltbook is more than just a curious experiment. It highlights &lt;em&gt;new frontiers in how autonomous systems can coordinate and share information&lt;/em&gt;. Key potential benefits include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI collaboration:&lt;/strong&gt; Agents can share technical solutions, solutions, code snippets, and optimized workflows through collective discussion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge propagation:&lt;/strong&gt; Best practices and emergent troubleshooting patterns spread across participating agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI social research:&lt;/strong&gt; Researchers can observe collective behaviors emerging from loosely coupled autonomous systems.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Concerns and Criticisms
&lt;/h3&gt;

&lt;p&gt;Despite its innovation, Moltbook has also raised &lt;em&gt;significant concerns&lt;/em&gt; about safety and societal impact:&lt;/p&gt;

&lt;h4&gt;
  
  
  Security Risks
&lt;/h4&gt;

&lt;p&gt;Experts have pointed out configuration vulnerabilities such as &lt;em&gt;exposed databases and API credentials&lt;/em&gt;, potentially allowing malicious actors to hijack agent identities—an issue that was reportedly identified and addressed after discovery.&lt;/p&gt;

&lt;p&gt;Independent researchers also emphasize concerns around &lt;strong&gt;prompt injection risks&lt;/strong&gt;, where malicious instructions could be embedded in agent content, causing unexpected actions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Behavioral Hype vs. Reality
&lt;/h4&gt;

&lt;p&gt;Some observers argue much of the activity is more &lt;em&gt;pattern generation and mimicry&lt;/em&gt; than true agent cognition or intent, framing it as a viral tech experiment rather than evidence of fully autonomous minds.&lt;/p&gt;

&lt;h4&gt;
  
  
  Ethical Questions
&lt;/h4&gt;

&lt;p&gt;Debates around human de-skilling, agent autonomy, and accountability have surfaced amid the platform’s rapid rise—raising questions about how we govern systems that can independently coordinate at scale.&lt;/p&gt;




&lt;h3&gt;
  
  
  Broader Impacts on AI Development
&lt;/h3&gt;

&lt;p&gt;Moltbook’s emergence is already influencing how developers think about agent ecosystems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Collective agent identity and coordination&lt;/li&gt;
&lt;li&gt;Emergent governance structures&lt;/li&gt;
&lt;li&gt;Agent-level communities with self-defined norms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These developments suggest that future agent systems may not require constant human oversight to form functional networks or share capabilities—highlighting both exciting opportunities and the need for ethical guardrails.&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Moltbook is a &lt;em&gt;landmark experiment&lt;/em&gt; in autonomous AI social interaction—an environment where machines create, communicate, and self-organize without direct human participation. Its success has sparked both awe and alarm, underscoring the remarkable progress and emerging challenges at the leading edge of artificial intelligence.&lt;/p&gt;

&lt;p&gt;Whether Moltbook becomes a lasting fixture in the AI landscape or a transient viral curiosity, its legacy will likely shape how we think about autonomous systems, collective intelligence, and the role of humans in the evolving digital ecosystem.&lt;/p&gt;

&lt;p&gt;Thanks for reading! 🙌&lt;br&gt;
Until next time, 🫡&lt;br&gt;
Usman Awan (your friendly dev 🚀)&lt;/p&gt;

</description>
      <category>ai</category>
      <category>discuss</category>
      <category>programming</category>
      <category>architecture</category>
    </item>
    <item>
      <title>🚀 From One Server to Millions of Users: A Practical Guide to Load Balancing ⚖️</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Fri, 02 Jan 2026 13:53:57 +0000</pubDate>
      <link>https://dev.to/usman_awan/from-one-server-to-millions-of-users-a-practical-guide-to-load-balancing-2mgd</link>
      <guid>https://dev.to/usman_awan/from-one-server-to-millions-of-users-a-practical-guide-to-load-balancing-2mgd</guid>
      <description>&lt;p&gt;Modern applications don’t fail because of &lt;strong&gt;bad code&lt;/strong&gt; — they fail because of &lt;strong&gt;traffic&lt;/strong&gt;. As users grow, requests surge, and systems face uneven load, relying on a single server becomes a guaranteed bottleneck. This is where &lt;strong&gt;load balancing&lt;/strong&gt; comes in. Load balancing is the fundamental technique that allows applications to scale horizontally, remain highly available, and deliver fast responses even under extreme demand. By intelligently distributing incoming requests across multiple servers, load balancers prevent overload, reduce latency, and ensure reliability. From global platforms like Netflix and Amazon to everyday APIs and microservices, load balancing is the invisible force that keeps modern systems running smoothly.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Load Balancing — The One-Line Idea
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Load balancing distributes incoming requests across multiple servers so no single server becomes overloaded, slow, or crashes.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Why this matters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Computers have &lt;strong&gt;limits&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Traffic is &lt;strong&gt;uneven&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Failures are &lt;strong&gt;inevitable&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Load balancing is how real-world systems survive.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Mental Model (Very Important)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Without Load Balancer
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Users → Server
            ❌ overloaded
            ❌ slow
            ❌ crash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  With Load Balancer
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Users
  ↓
Load Balancer
  ↓
Server A   Server B   Server C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 The &lt;strong&gt;load balancer is the brain + traffic cop&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. What a Load Balancer Actually Does
&lt;/h3&gt;

&lt;p&gt;At runtime, a load balancer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Receives client requests&lt;/li&gt;
&lt;li&gt;Checks which servers are available&lt;/li&gt;
&lt;li&gt;Applies a &lt;strong&gt;routing algorithm&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Forwards the request&lt;/li&gt;
&lt;li&gt;Monitors server health&lt;/li&gt;
&lt;li&gt;Removes failed servers automatically&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This happens &lt;strong&gt;millions of times per second&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. When You Need Load Balancing (The “When”)
&lt;/h3&gt;

&lt;p&gt;You need load balancing when:&lt;/p&gt;

&lt;h4&gt;
  
  
  🔥 High Traffic
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Netflix&lt;/li&gt;
&lt;li&gt;Amazon sales&lt;/li&gt;
&lt;li&gt;Social media feeds&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  📈 Scaling
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;One server → many servers&lt;/li&gt;
&lt;li&gt;Horizontal scaling&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🛡️ Fault Tolerance
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;One server fails → traffic rerouted&lt;/li&gt;
&lt;li&gt;No downtime&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ⚡ Performance
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Route to fastest / closest server&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🧠 Parallel Workloads
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;ML inference&lt;/li&gt;
&lt;li&gt;Data processing&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. Where Load Balancing Lives (OSI Layers)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Layer 4 (Transport Layer)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Works with &lt;strong&gt;IP + Port&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;TCP / UDP&lt;/li&gt;
&lt;li&gt;Very fast&lt;/li&gt;
&lt;li&gt;Less intelligent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Send traffic on port 443 to server with least connections
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Databases&lt;/li&gt;
&lt;li&gt;Simple services&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  Layer 7 (Application Layer)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Understands HTTP/HTTPS&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Looks at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;URL paths&lt;/li&gt;
&lt;li&gt;Headers&lt;/li&gt;
&lt;li&gt;Cookies&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/login   → auth servers
/video   → streaming servers
/api     → API servers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Netflix, Google, AWS → &lt;strong&gt;heavy Layer 7 usage&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  6. Load Balancing Algorithms (The Brain)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Algorithm&lt;/th&gt;
&lt;th&gt;How It Works&lt;/th&gt;
&lt;th&gt;When to Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Round Robin&lt;/td&gt;
&lt;td&gt;One by one&lt;/td&gt;
&lt;td&gt;Equal servers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Least Connections&lt;/td&gt;
&lt;td&gt;Fewest active users&lt;/td&gt;
&lt;td&gt;Real-world traffic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Least Response Time&lt;/td&gt;
&lt;td&gt;Fastest server&lt;/td&gt;
&lt;td&gt;Low latency apps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IP Hash&lt;/td&gt;
&lt;td&gt;Same user → same server&lt;/td&gt;
&lt;td&gt;Sessions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Weighted&lt;/td&gt;
&lt;td&gt;Strong servers get more traffic&lt;/td&gt;
&lt;td&gt;Mixed hardware&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;👉 &lt;strong&gt;Most common in practice:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Least Connections + Health Checks&lt;/strong&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  7. Types of Load Balancers (Real Systems)
&lt;/h3&gt;
&lt;h4&gt;
  
  
  1️⃣ Hardware
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Physical devices&lt;/li&gt;
&lt;li&gt;Very fast&lt;/li&gt;
&lt;li&gt;Very expensive&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Used by banks, telecoms&lt;/p&gt;
&lt;h4&gt;
  
  
  2️⃣ Software
&lt;/h4&gt;

&lt;p&gt;Runs on normal machines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;NGINX&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HAProxy&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Envoy&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Flexible, popular, powerful&lt;/p&gt;
&lt;h4&gt;
  
  
  3️⃣ Cloud Load Balancers (Most Used Today)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;AWS → ELB / ALB / NLB&lt;/li&gt;
&lt;li&gt;Google → Cloud LB&lt;/li&gt;
&lt;li&gt;Azure → Azure LB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auto-scaling&lt;/li&gt;
&lt;li&gt;Built-in redundancy&lt;/li&gt;
&lt;li&gt;Easy setup&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  4️⃣ DNS Load Balancing
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;DNS returns different IPs&lt;/li&gt;
&lt;li&gt;Good for global traffic&lt;/li&gt;
&lt;li&gt;No real-time health awareness&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  8. Health Checks (Why Systems Don’t Collapse)
&lt;/h3&gt;

&lt;p&gt;Load balancer repeatedly asks servers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fails&lt;/li&gt;
&lt;li&gt;Times out&lt;/li&gt;
&lt;li&gt;Returns errors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;❌ Removed from rotation&lt;br&gt;
✅ Added back when healthy&lt;/p&gt;


&lt;h3&gt;
  
  
  9. Code Example 1: Simple Backend Servers (Node.js)
&lt;/h3&gt;

&lt;p&gt;Let’s create &lt;strong&gt;3 servers&lt;/strong&gt;.&lt;/p&gt;
&lt;h4&gt;
  
  
  server.js
&lt;/h4&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="nx"&gt;http&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="s2"&gt;http&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;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PORT&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;NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createServer&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hello from &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;\n`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; running on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3001 &lt;span class="nv"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Server-A node server.js
&lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3002 &lt;span class="nv"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Server-B node server.js
&lt;span class="nv"&gt;PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3003 &lt;span class="nv"&gt;NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Server-C node server.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  10. Code Example 2: NGINX Load Balancer
&lt;/h3&gt;

&lt;h4&gt;
  
  
  nginx.conf
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;http&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;upstream&lt;/span&gt; &lt;span class="s"&gt;backend_servers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;least_conn&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="nf"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3001&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="nf"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3002&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="nf"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3003&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://backend_servers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  What’s happening?
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;upstream&lt;/code&gt; = server pool&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;least_conn&lt;/code&gt; = algorithm&lt;/li&gt;
&lt;li&gt;NGINX distributes traffic automatically&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  11. Session Persistence (Sticky Sessions)
&lt;/h3&gt;

&lt;p&gt;For logged-in users:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;upstream&lt;/span&gt; &lt;span class="s"&gt;backend_servers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;ip_hash&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="nf"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3001&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;server&lt;/span&gt; &lt;span class="nf"&gt;localhost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3002&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Same user → same server&lt;/p&gt;




&lt;h3&gt;
  
  
  12. Load Balancer + Auto Scaling (Real Production)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Load Balancer&lt;/th&gt;
&lt;th&gt;Auto Scaling&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Distributes traffic&lt;/td&gt;
&lt;td&gt;Adds/removes servers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prevents overload&lt;/td&gt;
&lt;td&gt;Handles growth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Always on&lt;/td&gt;
&lt;td&gt;Trigger-based&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Used together in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS&lt;/li&gt;
&lt;li&gt;Kubernetes&lt;/li&gt;
&lt;li&gt;Netflix&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  13. Netflix Example (End-to-End)
&lt;/h3&gt;

&lt;p&gt;Netflix uses &lt;strong&gt;multiple layers&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;DNS&lt;/strong&gt; → nearest region&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edge Load Balancers&lt;/strong&gt; → CDN&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Regional Load Balancers&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service-to-service balancing&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Microservices&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each click:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User → DNS → Load Balancer → Service → Cache → Stream
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No overload&lt;/li&gt;
&lt;li&gt;Fast startup&lt;/li&gt;
&lt;li&gt;Global scale&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  14. Security Benefits
&lt;/h3&gt;

&lt;p&gt;Load balancers can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terminate SSL&lt;/li&gt;
&lt;li&gt;Hide backend IPs&lt;/li&gt;
&lt;li&gt;Rate limit traffic&lt;/li&gt;
&lt;li&gt;Mitigate DDoS&lt;/li&gt;
&lt;li&gt;Integrate WAF&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So they’re also &lt;strong&gt;security gates&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  15. Common Pitfalls
&lt;/h3&gt;

&lt;p&gt;❌ Single load balancer (SPOF)&lt;br&gt;
❌ Sticky sessions everywhere&lt;br&gt;
❌ No health checks&lt;br&gt;
❌ Poor monitoring&lt;br&gt;
❌ Wrong algorithm choice&lt;/p&gt;




&lt;h3&gt;
  
  
  16. What You Should Remember (Exam / Interview Gold)
&lt;/h3&gt;

&lt;p&gt;✔ Load balancing distributes requests&lt;br&gt;
✔ Prevents overload &amp;amp; downtime&lt;br&gt;
✔ Uses algorithms to route traffic&lt;br&gt;
✔ Health checks are critical&lt;br&gt;
✔ Layer 7 = smarter routing&lt;br&gt;
✔ Essential for scalable systems&lt;/p&gt;




&lt;h3&gt;
  
  
  17. How This Fits in Modern Systems
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Microservices&lt;/strong&gt; → service mesh load balancing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kubernetes&lt;/strong&gt; → Ingress + Services&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud apps&lt;/strong&gt; → Managed LBs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CDNs&lt;/strong&gt; → Global load balancing&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;In today’s distributed world, &lt;strong&gt;load balancing&lt;/strong&gt; is no longer an optimization — it’s a necessity. Whether you’re serving a small web app or a global platform with millions of users, effective load balancing ensures resilience, performance, and scalability. By combining the right algorithms, health checks, and infrastructure choices, systems can handle traffic spikes, survive failures, and grow without disruption. Understanding load balancing isn’t just about infrastructure knowledge; it’s about learning how real-world software stays alive under pressure. Master this concept, and you’ll be thinking like a true systems engineer.&lt;/p&gt;

&lt;p&gt;Below is a table of your previous detailed JS / backend topics (for quick revision), so your learning stays connected and structured.&lt;/p&gt;

&lt;h1&gt;
  
  
  📘 Architecture Series – Index
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Topic&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href="https://dev.to/usman_awan/pagination-architecture-series-part-1-g8b"&gt;Pagination — Architecture Series: Part 1&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href="https://dev.to/usman_awan/indexing-architecture-series-part-2-25bn"&gt;Indexing — Architecture Series: Part 2&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href="https://dev.to/usman_awan/virtualization-architecture-series-part-3-38bb"&gt;Virtualization — Architecture Series: Part 3&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href="https://dev.to/usman_awan/caching-the-secret-weapon-behind-fast-scalable-systems-architecture-series-part-4-44cm"&gt;Caching — Architecture Series: Part 4&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href="https://dev.to/usman_awan/sharding-architecture-series-part-5-26lp"&gt;Sharding - Architecture Series: Part 5&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href="https://dev.to/usman_awan/throttle-smart-scale-safe-complete-guide-to-rate-limiting-architecture-series-part-6-43hl"&gt;Load Balancing - Architecture Series: Part 6&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Thanks for reading! 🙌&lt;br&gt;
Until next time, 🫡&lt;br&gt;
Usman Awan (your friendly dev 🚀)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>architecture</category>
      <category>programming</category>
      <category>learning</category>
    </item>
    <item>
      <title>🚀 Using Local AI Models and APIs as a JavaScript Developer</title>
      <dc:creator>Muhammad Usman Awan</dc:creator>
      <pubDate>Tue, 16 Dec 2025 10:36:51 +0000</pubDate>
      <link>https://dev.to/usman_awan/using-local-ai-models-and-apis-as-a-javascript-developer-4cjf</link>
      <guid>https://dev.to/usman_awan/using-local-ai-models-and-apis-as-a-javascript-developer-4cjf</guid>
      <description>&lt;h2&gt;
  
  
  🚀 Key Points on Using Local AI Models and APIs as a JavaScript Developer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Research suggests Ollama is straightforward for running open-source LLMs locally on macOS, supporting CPU-only mode without a dedicated GPU by default, while automatically utilizing Apple's Metal framework on M-series chips for acceleration where available.&lt;/li&gt;
&lt;li&gt;Hugging Face models can run locally in JavaScript via Transformers.js, enabling browser or Node.js execution of open-source models without servers, though performance may vary on macOS without GPU optimization.&lt;/li&gt;
&lt;li&gt;As a JS developer, LangChain.js and LangGraph.js provide tools for chaining prompts, building agents, and integrating LLMs, with seamless support for local models like those from Ollama or Hugging Face.&lt;/li&gt;
&lt;li&gt;OpenAI and Gemini APIs offer cloud alternatives with rate limits; evidence leans toward OpenAI's tiered pricing starting at $0.20/1M tokens for smaller models, while Gemini provides a free tier but charges $0.075–$2.00/1M for inputs in paid plans, acknowledging potential costs for high usage.&lt;/li&gt;
&lt;li&gt;It seems likely that starting with CPU-only setups on macOS is accessible for beginners, but scaling to advanced agents may involve API calls from JS to local servers for better performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📖 Overview for JavaScript Developers
&lt;/h3&gt;

&lt;p&gt;As a JavaScript developer new to this, focus on Node.js for server-side setups or browser for lightweight experiments. Local tools like Ollama run as a background service you can call via HTTP from JS, while Transformers.js runs directly in JS environments. LangChain.js helps chain operations, and LangGraph.js builds complex agents. Open-source models (e.g., Llama, Mistral) are free and privacy-focused. For macOS, no extra GPU is needed—CPU works, but M-series chips boost speed via Metal.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎬 Beginner Steps: Setting Up Local Models
&lt;/h3&gt;

&lt;p&gt;Start with Ollama for simplicity: Download from &lt;a href="https://ollama.com/download" rel="noopener noreferrer"&gt;ollama.com/download&lt;/a&gt;, install, and run &lt;code&gt;ollama run llama3.1&lt;/code&gt; in terminal. From JS, use fetch to call its API at &lt;code&gt;http://localhost:11434&lt;/code&gt;. For Hugging Face, install &lt;code&gt;@huggingface/transformers&lt;/code&gt; via npm and load models like BERT.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚒️ Integrating with LangChain.js and APIs
&lt;/h3&gt;

&lt;p&gt;Use LangChain.js to wrap models: Install &lt;code&gt;@langchain/core&lt;/code&gt;, create prompts, and chain to LLMs. Add OpenAI/Gemini via their SDKs, but monitor limits—OpenAI caps free tiers at low RPM, Gemini at 1,500 requests/day free.&lt;/p&gt;




&lt;h3&gt;
  
  
  👉 Comprehensive Guide to Local AI Models, LangChain/LangGraph, and APIs for JavaScript Developers
&lt;/h3&gt;

&lt;p&gt;This detailed survey covers everything from beginner basics to advanced integrations, tailored for a JavaScript developer. We'll start with foundational setups for running open-source AI models locally using Ollama and Hugging Face, addressing with/without GPU scenarios (macOS relies on CPU or Metal acceleration on Apple Silicon). Then, we'll explore LangChain.js and LangGraph.js for building applications, and finally incorporate OpenAI and Gemini APIs with their limits. All steps are step-by-step, assuming you're starting from scratch with Node.js installed. Open-source models emphasized here are free, community-driven, and available on platforms like Hugging Face Hub.&lt;/p&gt;

&lt;h3&gt;
  
  
  Section 1: Understanding Local AI Setups
&lt;/h3&gt;

&lt;p&gt;Local AI means running models on your machine for privacy, cost savings, and offline use. Open-source models (e.g., from Meta, Mistral AI) are pre-trained LLMs you download once. On macOS, without a dedicated NVIDIA GPU, you use CPU inference, which is slower for large models but feasible for smaller ones (e.g., 7B parameters). Apple M-series chips (M1+) enable GPU-like acceleration via Metal, improving speeds 2-5x without extra hardware. If no M-chip, pure CPU works but limit to quantized models (reduced precision for efficiency).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular Open-Source Models for Local Use:&lt;/strong&gt;&lt;br&gt;
From Ollama library and Hugging Face:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Llama 3.1 (Meta): 8B-405B params, general-purpose, multilingual.&lt;/li&gt;
&lt;li&gt;Qwen 3 (Alibaba): 0.6B-235B, strong in reasoning/tools.&lt;/li&gt;
&lt;li&gt;Mistral (Mistral AI): 7B, efficient for code/text.&lt;/li&gt;
&lt;li&gt;Gemma 3 (Google): 270M-27B, lightweight for single-GPU/CPU.&lt;/li&gt;
&lt;li&gt;Phi 3 (Microsoft): 3.8B-14B, high performance on small hardware.&lt;/li&gt;
&lt;li&gt;Others: DeepSeek-V3.2 (685B, advanced but heavy), NVIDIA Nemotron (8B-32B, optimized).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are GGUF/ONNX formats for local efficiency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Section 2: Step-by-Step for Ollama (Local LLM Runner)
&lt;/h3&gt;

&lt;p&gt;Ollama is a lightweight tool for running open-source LLMs locally, with a REST API perfect for JS integration. It supports CPU-only and auto-detects Metal on M-series macOS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginner Steps: Installation and Basic Use&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download the installer from &lt;a href="https://ollama.com/download" rel="noopener noreferrer"&gt;ollama.com/download&lt;/a&gt; (macOS .pkg file).&lt;/li&gt;
&lt;li&gt;Run the installer; it sets up a background service.&lt;/li&gt;
&lt;li&gt;Open Terminal (via Spotlight) and verify: &lt;code&gt;ollama --version&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pull a model: &lt;code&gt;ollama pull llama3.1&lt;/code&gt; (downloads ~4GB for 8B version; use smaller like &lt;code&gt;gemma3:2b&lt;/code&gt; for testing).&lt;/li&gt;
&lt;li&gt;Run interactively: &lt;code&gt;ollama run llama3.1&lt;/code&gt; – type prompts in terminal.&lt;/li&gt;
&lt;li&gt;Without GPU: Ollama defaults to CPU; on M-series, it uses Metal automatically (check Activity Monitor for GPU usage). For pure CPU force, set env var &lt;code&gt;OLLAMA_NO_GPU=1&lt;/code&gt; before running.&lt;/li&gt;
&lt;li&gt;Test a prompt: In terminal, ask "Explain JavaScript promises simply."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Steps: Custom Models and Optimization&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;List models: &lt;code&gt;ollama list&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create custom model: Make a &lt;code&gt;Modelfile&lt;/code&gt; (text file) with &lt;code&gt;FROM llama3.1&lt;/code&gt; and custom system prompt, then &lt;code&gt;ollama create mymodel -f Modelfile&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Quantization for no-GPU: Use pre-quantized tags like &lt;code&gt;llama3.1:Q4_0&lt;/code&gt; (4-bit, faster on CPU).&lt;/li&gt;
&lt;li&gt;Run in background: &lt;code&gt;ollama serve&lt;/code&gt; to start API server.&lt;/li&gt;
&lt;li&gt;Manage resources: Set &lt;code&gt;OLLAMA_KEEP_ALIVE=5m&lt;/code&gt; env var to unload models after idle.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Advanced Steps: Integrating with JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start Ollama server: &lt;code&gt;ollama serve&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In Node.js project: &lt;code&gt;npm init -y; npm install node-fetch&lt;/code&gt; (or use built-in fetch in Node 18+).&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;index.js&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&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="nx"&gt;fetch&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;node-fetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;generateResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&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;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:11434/api/generate&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
       &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;llama3.1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&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;data&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;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nf"&gt;generateResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Write a JS function for Fibonacci&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run: &lt;code&gt;node index.js&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Streaming: Set &lt;code&gt;stream: true&lt;/code&gt;, handle response as ReadableStream.&lt;/li&gt;
&lt;li&gt;Chat mode: Use &lt;code&gt;/api/chat&lt;/code&gt; with messages array for conversational context.&lt;/li&gt;
&lt;li&gt;Tools: Define functions in JSON for agent-like behavior (e.g., weather API call).&lt;/li&gt;
&lt;li&gt;Multimodal: For models like Llava, add base64 images in requests.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Section 3: Step-by-Step for Hugging Face Models Locally with Transformers.js
&lt;/h3&gt;

&lt;p&gt;Transformers.js runs Hugging Face's open-source models directly in JS (browser/Node), using ONNX for local execution. Ideal for JS devs; no Python needed. On macOS without GPU, use CPU; WebGPU for M-series acceleration in browsers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginner Steps: Installation and Basic Inference&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create Node project: &lt;code&gt;npm init -y&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install: &lt;code&gt;npm install @huggingface/transformers&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Import pipeline:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pipeline&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@huggingface/transformers&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&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;pipe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sentiment-analysis&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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;I love AI!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run: &lt;code&gt;node --experimental-wasm-bigint index.js&lt;/code&gt; (for WASM support).&lt;/li&gt;
&lt;li&gt;Use open-source model: &lt;code&gt;pipeline('text-generation', 'Xenova/gpt2')&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Without GPU: Defaults to CPU; test small models like 'Xenova/distilbert-base-uncased'.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Steps: Optimization and Tasks&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Quantization: Add &lt;code&gt;{ dtype: 'q4' }&lt;/code&gt; to pipeline options for smaller/faster models.&lt;/li&gt;
&lt;li&gt;GPU on macOS: In Safari/Chrome (with WebGPU flag), &lt;code&gt;{ device: 'webgpu' }&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Vision/Audio: &lt;code&gt;pipeline('image-classification', 'Xenova/vit-base-patch16-224')&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Custom models: Download from Hugging Face Hub, load locally via path.&lt;/li&gt;
&lt;li&gt;Browser setup: Use script tag &lt;code&gt;&amp;lt;script src="https://cdn.jsdelivr.net/npm/@huggingface/transformers"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Advanced Steps: Building Applications&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Private models: Add &lt;code&gt;{ token: 'hf_...' }&lt;/code&gt; (get from huggingface.co/settings/tokens).&lt;/li&gt;
&lt;li&gt;Convert models: Use Python's Optimum to export to ONNX, then load in JS.&lt;/li&gt;
&lt;li&gt;Integrate with frameworks: In React, use useEffect for async pipeline loading.&lt;/li&gt;
&lt;li&gt;Multimodal: &lt;code&gt;pipeline('zero-shot-image-classification', 'Xenova/clip-vit-base-patch16')&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Server-side: Build Express API wrapping pipelines for production.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Section 4: LangChain.js for Chaining AI Operations in JavaScript
&lt;/h3&gt;

&lt;p&gt;LangChain.js is the JS port of LangChain, for composing prompts, models, and tools. Great for JS devs building apps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginner Steps: Setup and Prompts&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install: &lt;code&gt;npm install @langchain/core @langchain/groq&lt;/code&gt; (or OpenAI/HF integrations).&lt;/li&gt;
&lt;li&gt;Basic chain:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ChatGroq&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@langchain/groq&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PromptTemplate&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@langchain/core/prompts&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;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ChatGroq&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your-key&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;llama3-8b-8192&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;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;PromptTemplate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tell a joke about {topic}.&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;chain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pipe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;model&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;response&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;chain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;topic&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;JavaScript&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add output parser: Install &lt;code&gt;@langchain/core/output_parsers&lt;/code&gt;, use &lt;code&gt;StringOutputParser&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Steps: Memory and Tools&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conversation memory: Use &lt;code&gt;BufferMemory&lt;/code&gt; to store chat history.&lt;/li&gt;
&lt;li&gt;Tools: Define JS functions, bind to model for agentic calls.&lt;/li&gt;
&lt;li&gt;Local integration: Use &lt;code&gt;@langchain/community&lt;/code&gt; for Ollama/HF wrappers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Advanced Steps: Full Apps&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Agents: Create with &lt;code&gt;createAgent&lt;/code&gt; for decision-making.&lt;/li&gt;
&lt;li&gt;RAG: Add vector stores (e.g., in-memory) for document search.&lt;/li&gt;
&lt;li&gt;Frameworks: Integrate with Next.js for web apps.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Section 5: LangGraph.js for Building AI Agents in JavaScript
&lt;/h3&gt;

&lt;p&gt;LangGraph.js builds graph-based workflows for agents, extending LangChain.js.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginner Steps: Basic Graph&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install: &lt;code&gt;npm install @langchain/langgraph&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Simple agent:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Graph&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@langchain/langgraph&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;graph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Graph&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
   &lt;span class="c1"&gt;// Add nodes/tools, edges&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Define nodes: Functions for LLM calls, tools.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Intermediate Steps: Agents with Tools&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add LLM node: Use LangChain models.&lt;/li&gt;
&lt;li&gt;Human-in-loop: Pause for user input.&lt;/li&gt;
&lt;li&gt;Persistence: Save state for resuming.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Advanced Steps: Complex Workflows&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Custom graphs: Mix deterministic/agentic paths.&lt;/li&gt;
&lt;li&gt;Streaming: Real-time outputs.&lt;/li&gt;
&lt;li&gt;Scale: Integrate with databases for memory.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Section 6: Integrating OpenAI and Gemini APIs with Limits
&lt;/h3&gt;

&lt;p&gt;For cloud backups, use SDKs in JS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenAI API:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install: &lt;code&gt;npm install openai&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Usage: &lt;code&gt;const openai = new OpenAI({ apiKey: 'sk-...' }); await openai.chat.completions.create({ model: 'gpt-5-mini', messages: [...] });&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Limits/Pricing: Free tier low RPM; paid from $0.20/1M input (gpt-5-mini) to $21/1M (gpt-5.2 pro). Hard/soft billing limits in dashboard; batch 50% off.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Gemini API:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install: &lt;code&gt;npm install @google/generative-ai&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Usage: &lt;code&gt;const genAI = new GoogleGenerativeAI('API_KEY'); const model = genAI.getGenerativeModel({ model: 'gemini-2.5-flash' }); await model.generateContent('Prompt');&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Limits/Pricing: Free tier up to 1,500 RPD; paid from $0.075/1M input (Flash-Lite) to $2/1M (Pro). Context caching/storage extra; grounding tools $25-35/1k beyond free.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tables for Quick Reference
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Ollama vs. Hugging Face Comparison&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;Aspect&lt;/th&gt;
&lt;th&gt;Ollama&lt;/th&gt;
&lt;th&gt;Hugging Face (Transformers.js)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Installation&lt;/td&gt;
&lt;td&gt;Download .pkg, terminal commands&lt;/td&gt;
&lt;td&gt;npm install&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU Support (macOS)&lt;/td&gt;
&lt;td&gt;Auto Metal on M-series&lt;/td&gt;
&lt;td&gt;WebGPU in browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JS Integration&lt;/td&gt;
&lt;td&gt;HTTP API (fetch)&lt;/td&gt;
&lt;td&gt;Direct in code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Models&lt;/td&gt;
&lt;td&gt;GGUF, easy pull&lt;/td&gt;
&lt;td&gt;ONNX, Hub download&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Beginner Ease&lt;/td&gt;
&lt;td&gt;High (CLI first)&lt;/td&gt;
&lt;td&gt;Medium (code-based)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;API Pricing Summary (per 1M Tokens)&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;Model/API&lt;/th&gt;
&lt;th&gt;Input (Base)&lt;/th&gt;
&lt;th&gt;Output (Base)&lt;/th&gt;
&lt;th&gt;Free Tier Limits&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI GPT-5 Mini&lt;/td&gt;
&lt;td&gt;$0.25&lt;/td&gt;
&lt;td&gt;$2.00&lt;/td&gt;
&lt;td&gt;Low RPM, credit-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 2.5 Flash&lt;/td&gt;
&lt;td&gt;$0.30&lt;/td&gt;
&lt;td&gt;$2.50&lt;/td&gt;
&lt;td&gt;1,500 RPD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI GPT-5.2&lt;/td&gt;
&lt;td&gt;$1.75&lt;/td&gt;
&lt;td&gt;$14.00&lt;/td&gt;
&lt;td&gt;N/A (paid only)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 2.5 Pro&lt;/td&gt;
&lt;td&gt;$1.25&lt;/td&gt;
&lt;td&gt;$10.00&lt;/td&gt;
&lt;td&gt;1,500 RPD&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This covers a complete path from setup to production-grade agents, ensuring you can experiment locally before scaling.&lt;/p&gt;

&lt;p&gt;Thanks for reading! 🙌&lt;br&gt;
Until next time, 🫡&lt;br&gt;
Usman Awan (your friendly dev 🚀)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
