<?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: Prahlad Yeri</title>
    <description>The latest articles on DEV Community by Prahlad Yeri (@prahladyeri).</description>
    <link>https://dev.to/prahladyeri</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%2F173900%2F12fb0a8c-2621-49d4-b93b-6c0cd850c570.jpg</url>
      <title>DEV Community: Prahlad Yeri</title>
      <link>https://dev.to/prahladyeri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prahladyeri"/>
    <language>en</language>
    <item>
      <title>The Capacity Conundrum: Navigating the 80/15/5 Rule of AI Engineering</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Fri, 03 Jul 2026 07:42:33 +0000</pubDate>
      <link>https://dev.to/prahladyeri/the-capacity-conundrum-navigating-the-80155-rule-of-ai-engineering-i40</link>
      <guid>https://dev.to/prahladyeri/the-capacity-conundrum-navigating-the-80155-rule-of-ai-engineering-i40</guid>
      <description>&lt;p&gt;In the gold rush of modern software development, a new kind of engineering has taken center stage: &lt;strong&gt;AI Engineering&lt;/strong&gt;. But as developers and enterprises rush to integrate Large Language Models (LLMs) into their workflows, they quickly run into a jarring reality check. It’s what we call the &lt;strong&gt;Capacity Conundrum&lt;/strong&gt;—a structural bottleneck that mirrors the classic Pareto Principle (the 80/20 rule), completely shifting how we think about computing budgets and model selection.&lt;/p&gt;

&lt;p&gt;If you try to throw the biggest, smartest model at every single problem, your bank account will bleed out long before your product hits production. Conversely, if you rely entirely on lightweight models, your system will crumble the moment it faces true enterprise complexity.&lt;/p&gt;

&lt;p&gt;To build sustainable, scalable AI systems, you have to understand the three distinct tiers of the AI Engineering pyramid.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The 80% Tier: The Blue-Collar Workhorses (Highly Efficient &amp;amp; Scalable)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Rule:&lt;/strong&gt; 80% of everyday engineering problems can be handled by budget models like GPT-Mini.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you look at the day-to-day operations of an AI-powered application, the vast majority of tasks don't require cosmic intelligence. They require speed, low latency, and rock-bottom costs.&lt;/p&gt;

&lt;p&gt;This is where lightweight, highly efficient budget models shine. They act like the trusty robot toolkit, effortlessly managing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simple Bug Fixes:&lt;/strong&gt; Patching routine syntax or predictable errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Integrations:&lt;/strong&gt; Passing data cleanly between systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Cleaning:&lt;/strong&gt; Formatting JSONs, stripping unwanted strings, and standardizing inputs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Takeaway:&lt;/strong&gt; Don't use a spaceship to cross the street. Offloading this 80% of grunt work to budget models keeps your architecture highly scalable and keeps the financial lights on.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The 15% Tier: The Creative Coders (Advanced Capabilities, Balanced Cost)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Rule:&lt;/strong&gt; 15% of tasks like vibe coding require complex reasoning — this is the domain of sustainable frontier models like Opus.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As we move up the ladder, we hit tasks that require a bit of "soul" or, more accurately, deep contextual awareness and multi-step logic. This is the sweet spot for intermediate frontier models. They possess the cognitive heavy-lifting required to understand nuances without completely destroying your bottom line.&lt;/p&gt;

&lt;p&gt;This tier is all about collaboration and advanced synthesis:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vibe Coding &amp;amp; Creative Design:&lt;/strong&gt; Turning loose, abstract human descriptions into cohesive, working code frameworks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context-Aware Coding:&lt;/strong&gt; Understanding how a change in module A will ripple across module B.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Step Logic:&lt;/strong&gt; Executing sequential workflows that require the model to "think" a few steps ahead.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Takeaway:&lt;/strong&gt; This 15% represents the bridge between raw code execution and human intent. It requires a balanced model that gives you high intelligence while remaining financially viable for regular deployment.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The 5% Tier: The Enterprise Titans (High Cost, Deep Pockets Required)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Rule:&lt;/strong&gt; Only 5% of problems constitute "really complex enterprise-grade reasoning." They demand massive tokens and are incredibly difficult to scale unless your pockets are extraordinarily deep.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At the very top of the pyramid sits the elite, terrifyingly complex 5%. This is the deep end of the pool, where models are asked to perform massive, multi-turn reasoning over vast, interconnected corporate architectures.&lt;/p&gt;

&lt;p&gt;We are talking about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Whole-System Optimization:&lt;/strong&gt; Auditing an entire legacy enterprise infrastructure for inefficiencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deep Reasoning &amp;amp; Strategy:&lt;/strong&gt; Processing thousands of tokens to forecast, strategize, and solve architectural conundrums that would take human teams weeks to map out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enterprise-Scale Solutions:&lt;/strong&gt; High-stakes environments where errors cost millions, security must be locked down, and token usage skyrockets exponentially.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Takeaway:&lt;/strong&gt; This tier is a financial black hole if mismanaged. It requires massive compute, massive token counts, and significant financial investment. It should only be triggered when nothing else can solve the problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion: Mastering the Conundrum
&lt;/h2&gt;

&lt;p&gt;The secret to winning the AI engineering game isn't finding the "one model to rule them all." It’s building an &lt;strong&gt;intelligent routing system&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;By automatically triaging your engineering problems—sending the 80% to budget models, routing the 15% to balanced frontier models, and strictly rationing the final 5% for deep-pocketed enterprise reasoning—you unlock the ultimate cheat code: elite-tier AI capabilities at a fraction of the cost.&lt;/p&gt;

&lt;p&gt;Build smart, route wisely, and don't let the 5% bankrupt your 100%.&lt;/p&gt;

</description>
      <category>llm</category>
    </item>
    <item>
      <title>We are living in highly subsidized, interesting times</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Sun, 21 Jun 2026 20:33:02 +0000</pubDate>
      <link>https://dev.to/prahladyeri/the-ai-conundrum-we-are-living-in-highly-subsidized-interesting-times-ldl</link>
      <guid>https://dev.to/prahladyeri/the-ai-conundrum-we-are-living-in-highly-subsidized-interesting-times-ldl</guid>
      <description>&lt;p&gt;If you trace the timeline of how LLMs went from a technologist's dream to early text-generation toys, to the world-shifting launch of ChatGPT, and finally to the daily drivers of modern programming (Sonnet, Opus), it has taken less than a decade. It’s a thrilling, almost unbelievable tale.&lt;/p&gt;

&lt;p&gt;Let's look at how we got here, and the wall the industry is currently hitting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Dream Phase (2010-2016).&lt;/strong&gt; By the dawn of the last decade (2011), an interesting thing was happening. The two platforms, Wikipedia and Stack Overflow, had started gaining tremendous traction, folks were collaborating on these platforms to openly exchange knowledge. Looking back, this feels like a more ideal, community-driven path for humanity — one we abandoned for the centralized architecture we have today.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The Disruption Phase (2016-2021).&lt;/strong&gt; A perfect storm of unrelated events paved the way for AI. By 2017, new programmers were growing deeply frustrated by Stack Overflow's rigid policies, subjective question rejections, and senior coder pedantry. In retrospect, those strict moderators carved the first stones of what would later become Copilot and ChatGPT. If the community won't answer a beginner's question without downvoting it, a private LLM gladly will.&lt;/p&gt;

&lt;p&gt;Add to this Google's landmark 2017 paper "Attention Is All You Need" which unlocked the Transformer architecture, and the forced isolation of COVID-19 in 2020. The ground was suddenly fertile for virtual assistants that could act as isolated developers' programming partners.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Hook Phase (2023-2025).&lt;/strong&gt; The launch of ChatGPT left no doubt about how easy the "hook" would be. For non-technical folks, it was pure magic. It didn't take long for specialized LLMs like Copilot, Claude and Deepseek to become an indispensable part of the programmer's toolbox. Meanwhile, OpenAI was still advertising its "non-profit" roots, and the consensus was that this was purely about empowering humanity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Endgame Phase (2025-present/future).&lt;/strong&gt; AI companies had miscalculated a lot of things by this time. They were optimizing for the "long-term" but as John Maynard Keynes rightly said many years ago, &lt;em&gt;"In the long-term, we are all dead"&lt;/em&gt;. The VCs are losing patience today because while the technology itself has gained massive ubiquity and appreciation, the revenues aren't coming as fast. The hook had sort of worked but failed to fully work.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most frontier models like Sonnet, Opus and GPT 5.5 are still running on 'subsidized mode'. The amount of monthly subscription they charge users (USD 10/20/30 per month) is a pittance compared to all the compute and RAM needed to run those "thinking..." and "pondering..." tokens. In order to truly show profits in the books and come out of subsidized mode, they must charge on the scaling of input/output tokens and that appears to be difficult. Very few companies might be able to sustain such unlimited budget for unpredictable hardware scaling, the recent Uber story shows exactly what happens when they try doing it.&lt;/p&gt;

&lt;p&gt;The frontier models are trying to replace something which could never be successfully delegated or automated in entire human history - the highest cognitive skills of human brain like reasoning, deduction and logic. Yet, the efforts are on and the goals are long term. The conundrum is that if they stop subsidizing, the hook phase may be undone - there is a strong possibility of folks reverting back to older ways of Wikipedia/Stack Overflow or pivot entirely to open source &lt;em&gt;dry/academic&lt;/em&gt; models like Llama and Qwen which can run locally on their own hardware. And yet, they also can't keep subsidizing and draining the funds indefinitely.&lt;/p&gt;

&lt;p&gt;What happens when the subsidy mirror cracks?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>programming</category>
    </item>
    <item>
      <title>The Budget Guide to Prompt Engineering: Save Money with Every Token</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Mon, 15 Jun 2026 17:54:12 +0000</pubDate>
      <link>https://dev.to/prahladyeri/the-budget-guide-to-prompt-engineering-save-money-with-every-token-3k6h</link>
      <guid>https://dev.to/prahladyeri/the-budget-guide-to-prompt-engineering-save-money-with-every-token-3k6h</guid>
      <description>&lt;h2&gt;
  
  
  A Comprehensive Guide for Budget-Conscious Users
&lt;/h2&gt;

&lt;p&gt;Brevity in prompt engineering means &lt;strong&gt;maximizing information density while minimizing token count&lt;/strong&gt;—getting premium-tier productivity from budget models like GPT-4.1-mini, DeepSeek-V3, Phi-4, Meta-Llama-3.*, and Mistral Small/Medium by using concise, high-impact prompts that reduce accuracy loss by 5% per 500 extra tokens. Short prompts at ~250 tokens keep models in peak form, while 800+ token prompts cause measurable degradation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;General Guidelines: Translating Intentions to Prompts&lt;/li&gt;
&lt;li&gt;Using LLMs Efficiently: Prompt Framing Techniques&lt;/li&gt;
&lt;li&gt;Model Classification: Which Model for Which Use Case&lt;/li&gt;
&lt;li&gt;Technical Documentation, Book Writing &amp;amp; Product Comparisons&lt;/li&gt;
&lt;li&gt;Grammar &amp;amp; Usage Efficiency Techniques&lt;/li&gt;
&lt;li&gt;Catalog of Example Prompts &amp;amp; Conversations&lt;/li&gt;
&lt;li&gt;API Providers Catalog &amp;amp; Desktop Tooling Guide&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  1. General Guidelines: Translating Intentions to Prompts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Core Principle: Information Density
&lt;/h3&gt;

&lt;p&gt;Every word in your prompt must &lt;strong&gt;pull its weight&lt;/strong&gt;. AI models don't read "terms and conditions"—they process tokens efficiently.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Before (Bloated)&lt;/th&gt;
&lt;th&gt;After (Concise)&lt;/th&gt;
&lt;th&gt;Word Reduction&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;"Can you please give me a really detailed, comprehensive, and extensive explanation of why some prompts might not work as well as others in AI models, and maybe share examples?"&lt;/td&gt;
&lt;td&gt;"Why do long prompts lower model accuracy? Explain with examples."&lt;/td&gt;
&lt;td&gt;70%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"You are a world-class chef specializing in Italian cuisine. Please imagine that you are teaching a class on easy pasta recipes. Provide a detailed explanation for each step..."&lt;/td&gt;
&lt;td&gt;"You are a chef teaching beginners about pasta. Share an easy recipe with ingredients, cooking times, and dietary alternatives. Use a fun tone."&lt;/td&gt;
&lt;td&gt;~85%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  The "Burger Prompt" Framework
&lt;/h3&gt;

&lt;p&gt;Think of a prompt like a burger—skip the lettuce (unnecessary fluff):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TOP BUN: Context
"You are a [role] working on [task context]"

MEAT: The Task
"[Specific action] with [constraints]"

BOTTOM BUN: Desired Output
"Output in [format: JSON/bullets/table]"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a Python expert debugging legacy code.
Find the bug in this WinForms loop and fix it.
Output: corrected code + 3-line explanation in bullets.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Golden Rules for Intent Translation
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Speak with Purpose&lt;/strong&gt;: Don't waffle. Be direct&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Condense Rules&lt;/strong&gt;: Instead of "Make sure the tone is casual but not too casual. Also, ensure there aren't any assumptions. By the way, output should be JSON," use "Respond in casual tone, no assumptions, JSON format"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Delimiters&lt;/strong&gt;: Separate sections with &lt;code&gt;###&lt;/code&gt;, &lt;code&gt;"""&lt;/code&gt;, or &lt;code&gt;---&lt;/code&gt; to clarify instruction vs. input data &lt;a href="https://www.linkedin.com/pulse/unlocking-ai-productivity-prompt-engineering-playbook-luke-mclaughlin-viotf" rel="noopener noreferrer"&gt;linkedin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Indicate Output Format Explicitly&lt;/strong&gt;: Say "in one paragraph" or "no more than 100 words" for length control &lt;a href="https://www.linkedin.com/pulse/unlocking-ai-productivity-prompt-engineering-playbook-luke-mclaughlin-viotf" rel="noopener noreferrer"&gt;linkedin&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  2. Using LLMs Efficiently: Prompt Framing Techniques
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Core Techniques
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Technique&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Zero-shot&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Direct instruction without examples&lt;/td&gt;
&lt;td&gt;Simple tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Few-shot&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Supply 2-5 examples to guide output&lt;/td&gt;
&lt;td&gt;Complex tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Chain-of-Thought (CoT)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Break reasoning into intermediate steps&lt;/td&gt;
&lt;td&gt;Complex reasoning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Prompt Chaining&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Split complex task into subtasks&lt;/td&gt;
&lt;td&gt;Multi-step workflows&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Prompt Framing by Use Case
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Coding Help (Glorified Stack Overflow)&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bug: React onClick not firing on nested div
Code: [paste minimal snippet]
Expected: click propagates
Actual: no event
Fix: provide corrected code + 2-line explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Trivia Lookup (Glorified Wikipedia)&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Q: When did India launch its first satellite?
A: [year only, no explanation]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Code Generation: React/Tailwind (Modern Stack)&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Generate React component with Tailwind:
- Feature: product card with image, title, price, "Add" button
- Style: rounded corners, shadow, hover lift
- Output: single .jsx file, no extras
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Code Generation: Legacy (WinForms/VB6/FoxPro)&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Legacy: VB6 user controls
Task: Convert this Click event to proper error handling
Code: [paste 5-10 lines]
Output: corrected VB6 + 3 risks to watch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Difference&lt;/strong&gt;: Legacy stacks require &lt;strong&gt;explicit context&lt;/strong&gt; about environment/version since models have less training data on older technologies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Iterative Refinement Workflow
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Prompt → Observe output → Tweak prompt&lt;/li&gt;
&lt;li&gt;Break overloaded prompts into simpler series &lt;/li&gt;
&lt;li&gt;Use leading keywords to nudge code output (start with partial line of code)&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. Model Classification: Which Model for Which Use Case
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Budget Tier Model Comparison (2026)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Price (per 1M tokens)&lt;/th&gt;
&lt;th&gt;Strengths&lt;/th&gt;
&lt;th&gt;Best Use Cases&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GPT-4.1 Mini&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$0.40 input / $1.60 output&lt;/td&gt;
&lt;td&gt;Speed, general tasks&lt;/td&gt;
&lt;td&gt;Customer support, simple CRUD code  &lt;a href="https://aisecuritygateway.ai/blog/llm-cost-comparison-2026" rel="noopener noreferrer"&gt;aisecuritygateway&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DeepSeek-V3.2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$0.14 input / $0.28 output&lt;/td&gt;
&lt;td&gt;GPT-4o-class at 95% less cost&lt;/td&gt;
&lt;td&gt;Complex code, reasoning  &lt;a href="https://www.buildfastwithai.com/blogs/best-ai-model-per-task-2026" rel="noopener noreferrer"&gt;buildfastwithai&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Phi-4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Budget tier&lt;/td&gt;
&lt;td&gt;Small-footprint tasks&lt;/td&gt;
&lt;td&gt;Classification, extraction  &lt;a href="https://zapier.com/blog/best-llm/" rel="noopener noreferrer"&gt;zapier&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Meta-Llama-3.3 70B&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Free via Groq&lt;/td&gt;
&lt;td&gt;Speed (300+ tok/sec)&lt;/td&gt;
&lt;td&gt;Real-time chat, voice agents  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mistral Small/Medium&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~$0.10-0.50/MTok&lt;/td&gt;
&lt;td&gt;Multilingual, code&lt;/td&gt;
&lt;td&gt;European projects, multilingual  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Claude Haiku 4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$0.80 / $4.00&lt;/td&gt;
&lt;td&gt;Cost-effective reasoning&lt;/td&gt;
&lt;td&gt;Moderate reasoning tasks  &lt;a href="https://aisecuritygateway.ai/blog/llm-cost-comparison-2026" rel="noopener noreferrer"&gt;aisecuritygateway&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Use Case → Model Mapping
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Recommended Budget Model&lt;/th&gt;
&lt;th&gt;When to Escalate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Customer Support Ticket Classification&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;GPT-4.1 Mini&lt;/td&gt;
&lt;td&gt;Ambiguous/complex technical context → DeepSeek-V3  &lt;a href="https://ofox.ai/blog/llm-api-selection-decision-matrix-mid-2026-english/" rel="noopener noreferrer"&gt;ofox&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Simple CRUD Code Generation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;GPT-4.1 Mini&lt;/td&gt;
&lt;td&gt;Complex business logic, &amp;gt;3 files → DeepSeek-V3  &lt;a href="https://ofox.ai/blog/llm-api-selection-decision-matrix-mid-2026-english/" rel="noopener noreferrer"&gt;ofox&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Complex Refactoring&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;DeepSeek-V3 or Claude Sonnet&lt;/td&gt;
&lt;td&gt;Safety-critical → Reserved premium models  &lt;a href="https://ofox.ai/blog/llm-api-selection-decision-matrix-mid-2026-english/" rel="noopener noreferrer"&gt;ofox&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Long-context Q&amp;amp;A (1M token)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Gemini 2.5 Flash (Free tier)&lt;/td&gt;
&lt;td&gt;N/A—only model with 1M context free  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Real-time Voice/Chat&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Llama-3.3 70B (Groq)&lt;/td&gt;
&lt;td&gt;N/A—fastest free inference  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Batch Processing (1M tokens/day)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Llama via Cerebras&lt;/td&gt;
&lt;td&gt;Need Claude/GPT quality → Paid tier  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Multilingual Production&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mistral Small/Medium&lt;/td&gt;
&lt;td&gt;N/A—best multilingual free tier  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Decision Framework
&lt;/h3&gt;

&lt;p&gt;Categorize tasks into three buckets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simple&lt;/strong&gt; (60%): classification, extraction, short summaries → GPT-4.1 Mini&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Moderate&lt;/strong&gt; (30%): code generation, content writing → DeepSeek-V3&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complex&lt;/strong&gt; (10%): refactoring, safety-critical → DeepSeek-V3 or escalate &lt;a href="https://ofox.ai/blog/llm-api-selection-decision-matrix-mid-2026-english/" rel="noopener noreferrer"&gt;ofox&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Routing rule&lt;/strong&gt;: If prompt contains "refactor", "optimize", "fix bug in", or references &amp;gt;3 files, route to mid-tier; otherwise use budget tier. &lt;a href="https://ofox.ai/blog/llm-api-selection-decision-matrix-mid-2026-english/" rel="noopener noreferrer"&gt;ofox&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Technical Documentation, Book Writing &amp;amp; Product Comparisons
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Technical Documentation
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Strength&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gemini&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Leads in technical docs&lt;/td&gt;
&lt;td&gt;API docs, developer guides&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;ChatGPT&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Follows templates precisely&lt;/td&gt;
&lt;td&gt;Technical audience&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Claude&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Explains complex concepts clearly&lt;/td&gt;
&lt;td&gt;Non-technical readers&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Hybrid approach&lt;/strong&gt;: Use Gemini/Claude to draft core content, ChatGPT to structure/standardize.&lt;/p&gt;

&lt;h3&gt;
  
  
  Book Writing
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Length&lt;/th&gt;
&lt;th&gt;Best Model&lt;/th&gt;
&lt;th&gt;Reason&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;1,500 words&lt;/td&gt;
&lt;td&gt;ChatGPT or Claude&lt;/td&gt;
&lt;td&gt;Close match  &lt;a href="https://llmguides.ai/comparisons/best-llm-for-writing/" rel="noopener noreferrer"&gt;llmguides&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt;2,000 words&lt;/td&gt;
&lt;td&gt;Claude&lt;/td&gt;
&lt;td&gt;Sustains logical argument; ChatGPT becomes repetitive after 1,500 words  &lt;a href="https://llmguides.ai/comparisons/best-llm-for-writing/" rel="noopener noreferrer"&gt;llmguides&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Whitepapers/in-depth guides&lt;/td&gt;
&lt;td&gt;Claude&lt;/td&gt;
&lt;td&gt;Measurable advantage in sustained argument  &lt;a href="https://llmguides.ai/comparisons/best-llm-for-writing/" rel="noopener noreferrer"&gt;llmguides&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Product Comparisons (India Market)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Prompt template for India-specific comparisons:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compare [Product A] vs [Product B] for India market:
- Price in ₹ (INR)
- Availability in Bengaluru/Metros
- After-sales service quality in India
- Localization (language support)
- Warranty terms in India
Output: comparison table + 3-line recommendation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Model choice&lt;/strong&gt;: DeepSeek-V3 for reasoning about market nuances; Mistral for multilingual India context. &lt;a href="https://www.buildfastwithai.com/blogs/best-ai-model-per-task-2026" rel="noopener noreferrer"&gt;buildfastwithai&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Grammar and Usage Efficiency Techniques
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Linguistic Techniques for Token Optimization
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Technique&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;Token Savings&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Active voice&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;"Fix the bug" vs "The bug should be fixed"&lt;/td&gt;
&lt;td&gt;~15%  &lt;a href="https://www.pluralsight.com/resources/blog/software-development/prompt-engineering-for-developers" rel="noopener noreferrer"&gt;pluralsight&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Rhetorical questions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;"Why does this fail?" vs "Explain why this fails"&lt;/td&gt;
&lt;td&gt;~20%  &lt;a href="https://www.pluralsight.com/resources/blog/software-development/prompt-engineering-for-developers" rel="noopener noreferrer"&gt;pluralsight&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;No filler words&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;"Remove 'please', 'really', 'very'"&lt;/td&gt;
&lt;td&gt;~30%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Comma stacking&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;"Fast, cheap, good" vs "Fast, and cheap, and good"&lt;/td&gt;
&lt;td&gt;~10%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Before/After Examples
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Before (waffling):&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Can you please give me a really detailed explanation and maybe share some scenarios to illustrate your points?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;After (70% fewer words):&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Explain with examples."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Make sure the tone is casual but not too casual. Also, ensure there aren't any assumptions. By the way, the output should be in JSON format."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Respond in casual tone, no assumptions, JSON format."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Key Principles
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start with Essentials&lt;/strong&gt;: Convey only critical information&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clear &amp;amp; Concise Language&lt;/strong&gt;: Avoid ambiguity with simple language&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provide Contextual Information&lt;/strong&gt;: Include relevant background for accuracy&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test and Refine&lt;/strong&gt;: Iterate based on results&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  6. Catalog of Example Prompts and LLM Conversations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Category 1: Coding Help (Stack Overflow Style)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Prompt 1: React Bug Fix&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;Bug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt; &lt;span class="nx"&gt;not&lt;/span&gt; &lt;span class="nx"&gt;firing&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;nested&lt;/span&gt; &lt;span class="nx"&gt;div&lt;/span&gt;
&lt;span class="nx"&gt;Code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&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;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Click me&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="na"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
Expected: click propagates
Actual: no event
Fix: corrected code + 2-line explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;pointerEvents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;auto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;pointerEvents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;none&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Click me&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Explanation: Nested span blocks event; fix pointerEvents.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Prompt 2: Legacy VB6 Conversion&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vb"&gt;&lt;code&gt;&lt;span class="n"&gt;Legacy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;VB6&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="n"&gt;control&lt;/span&gt;
&lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Add&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt; &lt;span class="n"&gt;handling&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;Click&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;
&lt;span class="n"&gt;Code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;Private&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt; &lt;span class="nf"&gt;CMD_SAVE_Click&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;SaveToDisk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;txtData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt;
&lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;corrected&lt;/span&gt; &lt;span class="n"&gt;VB6&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="n"&gt;risks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vb"&gt;&lt;code&gt;&lt;span class="k"&gt;Private&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt; &lt;span class="nf"&gt;CMD_SAVE_Click&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;On&lt;/span&gt; &lt;span class="k"&gt;Error&lt;/span&gt; &lt;span class="k"&gt;GoTo&lt;/span&gt; &lt;span class="n"&gt;ErrorHandler&lt;/span&gt;
    &lt;span class="n"&gt;SaveToDisk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;txtData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;Exit&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt;
&lt;span class="nf"&gt;ErrorHandler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;MsgBox&lt;/span&gt; &lt;span class="s"&gt;"Error: "&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Description&lt;/span&gt;
&lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Risks: 1) No log, 2) MsgBox blocks, 3) No cleanup&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Category 2: Trivia Lookup (Wikipedia Style)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Prompt 3: Quick Fact&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Q: When did India launch its first satellite?
A: [year only, no explanation]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt; &lt;code&gt;1975&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Prompt 4: Multi-Fact Table&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List India's satellite launches 1975-1990:
- Name, Year, Payload
Output: table, 3 columns, no extras
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Category 3: Code Generation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Prompt 5: React/Tailwind Component&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Generate React component with Tailwind:
- Feature: product card with image, title, price, "Add" button
- Style: rounded corners, shadow, hover lift
- Output: single .jsx file, no extras
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ProductCard&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"rounded-lg shadow-md hover:-translate-y-1 transition"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"w-full h-48 rounded-t-lg"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"p-4"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h3&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"font-bold"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h3&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text-gray-600"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"mt-2 bg-blue-500 px-4 py-2 rounded"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Add&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;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;&lt;strong&gt;Prompt 6: WinForms Legacy Loop Fix&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Bug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;WinForms&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="n"&gt;skips&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;
&lt;span class="n"&gt;Code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Count&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;Process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Fix&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;corrected&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="n"&gt;explanation&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;Process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&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;&lt;em&gt;Explanation: &lt;code&gt;-1&lt;/code&gt; excludes last item; remove it.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Category 4: Technical Documentation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Prompt 7: API Doc Section&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;You are a technical writer. Document this endpoint:
POST /api/users
Body: {name, email}
Response: {id, name, email, created_at}
Output: Markdown with curl example, 200/400 codes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Prompt 8: Book Chapter Outline&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write chapter outline for "Python for Beginners":
- Topic: functions
- Level: absolute beginner
- Output: 5 sections, 3 bullet points each
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Category 5: Product Comparisons (India Market)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Prompt 9: Smartphone Comparison&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compare iPhone 15 vs Samsung S24 for India:
- Price in ₹
- Availability in Bengaluru
- After-sales in India
- Warranty in India
Output: table + 3-line recommendation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Category 6: Batch Processing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Prompt 10: Content Summarization Pipeline&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Summarize these 5 articles:
[paste article 1]
[paste article 2]
...
Output: 5 bullet points, 1 sentence each, no intro
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  7. API Providers Catalog &amp;amp; Desktop Tooling Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Free/Budget Tier API Providers (2026)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Free Tier&lt;/th&gt;
&lt;th&gt;Models&lt;/th&gt;
&lt;th&gt;Rate Limits&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Google AI Studio&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,500 req/day, no CC&lt;/td&gt;
&lt;td&gt;Gemini 2.5 Flash&lt;/td&gt;
&lt;td&gt;1M context, multimodal&lt;/td&gt;
&lt;td&gt;Prototyping, long-context  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Groq&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;300 tok/sec free&lt;/td&gt;
&lt;td&gt;Llama-3.3 70B&lt;/td&gt;
&lt;td&gt;6K tokens/min strict&lt;/td&gt;
&lt;td&gt;Real-time chat, voice agents  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OpenRouter&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~20 req/min, 50 req/day&lt;/td&gt;
&lt;td&gt;30+ models (DeepSeek, Llama, Qwen)&lt;/td&gt;
&lt;td&gt;Per-model, OpenAI-compatible&lt;/td&gt;
&lt;td&gt;Multi-model testing  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cerebras&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;~1M tokens/day&lt;/td&gt;
&lt;td&gt;Llama variants&lt;/td&gt;
&lt;td&gt;Very fast (WSE chips)&lt;/td&gt;
&lt;td&gt;Batch processing  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mistral&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1B tokens/month&lt;/td&gt;
&lt;td&gt;All Mistral models&lt;/td&gt;
&lt;td&gt;2 RPM cap&lt;/td&gt;
&lt;td&gt;Multilingual, code  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GitHub Models&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Restrictive tokens&lt;/td&gt;
&lt;td&gt;GPT-4o, Llama, Mistral, Phi&lt;/td&gt;
&lt;td&gt;Tied to Copilot&lt;/td&gt;
&lt;td&gt;Enterprise, internal  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;NVIDIA NIM&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;40 req/min&lt;/td&gt;
&lt;td&gt;Open models&lt;/td&gt;
&lt;td&gt;Phone verification&lt;/td&gt;
&lt;td&gt;Performance testing  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hugging Face&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$0.10/month credits&lt;/td&gt;
&lt;td&gt;Smaller open models&lt;/td&gt;
&lt;td&gt;Strict rate limits&lt;/td&gt;
&lt;td&gt;Lightweight testing  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Trial Credit Providers (Billing Required)
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Trial Credit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Baseten&lt;/td&gt;
&lt;td&gt;$30  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI21&lt;/td&gt;
&lt;td&gt;$10  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Upstage&lt;/td&gt;
&lt;td&gt;$10  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NLP Cloud&lt;/td&gt;
&lt;td&gt;$15  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alibaba Cloud Model Studio&lt;/td&gt;
&lt;td&gt;1M tokens per model  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scaleway&lt;/td&gt;
&lt;td&gt;1M free tokens  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Provider Selection by User Type
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;User Type&lt;/th&gt;
&lt;th&gt;Recommended Stack&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Solo Developers&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;OpenRouter + Groq + Google AI Studio (low friction, clear limits)  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AI SaaS MVP Builders&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Groq (concurrency) + Cerebras (token throughput) + OpenRouter (diversity)  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Enterprise Evaluation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vertex AI + Cohere + Mistral (stable, compliant)  &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MSME, Budget Folks&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Google AI Studio (no CC) + OpenRouter free models + Groq (speed)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Building Desktop Tooling as a Power User
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Architecture: Multi-Provider Router&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# router.py - Route tasks to optimal provider
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="c1"&gt;# Initialize providers
&lt;/span&gt;&lt;span class="n"&gt;providers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://aistudio.google.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;groq&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;groq-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.groq.com/openai/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openrouter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openrouter-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.openrouter.ai/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cerebras&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cerebras-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.cerebras.com/v1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&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;select_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Route based on task requirements&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task_type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;interactive_chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;groq&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# low latency (300+ tok/sec)
&lt;/span&gt;    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;task_type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;long_context&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# 1M context window
&lt;/span&gt;    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;task_type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;batch_processing&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cerebras&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# 1M tokens/day
&lt;/span&gt;    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;task_type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;model_testing&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openrouter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# 30+ models
&lt;/span&gt;    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# default, generous free tier
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;query_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task_type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;select_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;provider&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;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;get_model_for_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;

&lt;span class="c1"&gt;# Usage
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;query_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Fix this React bug&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;interactive_chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Desktop Tool: CLI Wrapper (Python)&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;openai click

&lt;span class="c"&gt;# Usage&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;llm CLI &lt;span class="nt"&gt;--task&lt;/span&gt; &lt;span class="s2"&gt;"What's the capital of India?"&lt;/span&gt; &lt;span class="nt"&gt;--type&lt;/span&gt; trivia
2976
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;cli.py:&lt;/strong&gt;&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="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;click&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;router&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;query_llm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;select_provider&lt;/span&gt;

&lt;span class="nd"&gt;@click.command&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nd"&gt;@click.option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--task&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@click.option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--type&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;general&lt;/span&gt;&lt;span class="sh"&gt;'&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;cli&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;select_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;query_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;click&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;echo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;] &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;cli&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Desktop Tool: GUI (Streamlit)&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# app.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;streamlit&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;router&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;query_llm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;select_provider&lt;/span&gt;

&lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Budget LLM Router&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text_input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Your task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;task_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;selectbox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;interactive_chat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;long_context&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;batch_processing&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;model_testing&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;button&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Query&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;provider&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;select_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task_type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;query_llm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task_type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;success&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;] &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="si"&gt;}&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;Run: &lt;code&gt;streamlit run app.py&lt;/code&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Rate Limit Management Strategy
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Combining Free Tiers for Maximum Capacity:&lt;/strong&gt;&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="c1"&gt;# quota_manager.py
&lt;/span&gt;&lt;span class="n"&gt;DAILY_QUOTAS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# requests/day
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;groq&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="c1"&gt;# tokens/min
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cerebras&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# tokens/day
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openrouter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# requests/day
&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;check_quota&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;DAILY_QUOTAS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;provider&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;fallback_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Rotate to next provider when quota hit&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;fallbacks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;groq&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;groq&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cerebras&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cerebras&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openrouter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openrouter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fallbacks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Compliance &amp;amp; Responsible Usage Checklist
&lt;/h3&gt;

&lt;p&gt;Before integrating any free API:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;✅ Review data retention and training policies &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;✅ Avoid automated quota abuse &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;✅ Do not share API keys &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;✅ Monitor regional compliance (GDPR, India data laws) &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;xugj520&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Caveat&lt;/strong&gt;: Free tiers throttle, lack SLA—not suitable for customer-facing SLA-critical apps. Data may be used for training unless you opt out. &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  When to Transition from Free to Paid
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Signal&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;"Hit rate limits" regularly&lt;/td&gt;
&lt;td&gt;Invest in paid tier ($5-20/month)  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"Service busy" frequently&lt;/td&gt;
&lt;td&gt;Upgrade to aggregator with signup credits  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data sensitivity required&lt;/td&gt;
&lt;td&gt;Use paid tiers (no training on your data)  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;High concurrent users&lt;/td&gt;
&lt;td&gt;Paid tier with SLA  &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Best transition path&lt;/strong&gt;: Aggregators (TokenMix.ai, OpenRouter) with pay-per-token, no subscription minimum. &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Takeaway
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Shortening prompts is like cutting crust off PB&amp;amp;J—it makes the experience smoother&lt;/strong&gt;. By maximizing information density, using the Burger Prompt framework, routing tasks to optimal budget models, and stacking free tiers strategically, you can achieve &lt;strong&gt;premium-tier productivity at near-zero cost&lt;/strong&gt;. A 10% accuracy swing (from 250 vs 800 tokens) is massive—turning a B- student into an A+ nerd overnight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your toolkit&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prompts: ~250 tokens, high density&lt;/li&gt;
&lt;li&gt;Models: GPT-4.1 Mini for simple, DeepSeek-V3 for moderate, route complex &lt;a href="https://aisecuritygateway.ai/blog/llm-cost-comparison-2026" rel="noopener noreferrer"&gt;aisecuritygateway&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Providers: Google AI Studio + Groq + OpenRouter + Cerebras &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;tokenmix&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Tooling: Multi-provider router with quota fallback [code_file]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start small, test prompts, iterate, and scale intelligently.&lt;/p&gt;




&lt;h2&gt;
  
  
  Sources &amp;amp; References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prompt Optimization &amp;amp; Conciseness Guidelines&lt;/strong&gt;: &lt;a href="https://prompton.wordpress.com/2025/03/10/the-art-of-prompt-engineering-shorten-up-level-up/" rel="noopener noreferrer"&gt;Prompton WordPress Handbook&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow Strategies &amp;amp; Delimiters&lt;/strong&gt;: &lt;a href="https://www.linkedin.com/pulse/unlocking-ai-productivity-prompt-engineering-playbook-luke-mclaughlin-viotf" rel="noopener noreferrer"&gt;Luke McLaughlin's Prompt Engineering Playbook on LinkedIn&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt Engineering Core Frameworks&lt;/strong&gt;: &lt;a href="https://www.coursera.org/articles/what-is-prompt-engineering" rel="noopener noreferrer"&gt;Coursera Technical Guides&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model Routing Matrices &amp;amp; Token Optimization&lt;/strong&gt;: &lt;a href="https://ofox.ai/blog/llm-api-selection-decision-matrix-mid-2026-english/" rel="noopener noreferrer"&gt;OFox Tech Blog&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2026 Cost Architectures &amp;amp; Comparative Pricing&lt;/strong&gt;: &lt;a href="https://aisecuritygateway.ai/blog/llm-cost-comparison-2026" rel="noopener noreferrer"&gt;AI Security Gateway Estimates&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Task-Specific Performance Rankings&lt;/strong&gt;: &lt;a href="https://www.buildfastwithai.com/blogs/best-ai-model-per-task-2026" rel="noopener noreferrer"&gt;BuildFastWithAI Model Analytics&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM Core Benchmarks &amp;amp; Feature Reviews&lt;/strong&gt;: &lt;a href="https://zapier.com/blog/best-llm/" rel="noopener noreferrer"&gt;Zapier LLM Hub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Provider Ecosystems &amp;amp; Infrastructure Tests&lt;/strong&gt;: &lt;a href="https://tokenmix.ai/blog/free-llm-apis-2026-every-provider-free-tier-tested" rel="noopener noreferrer"&gt;TokenMix Free API Comprehensive Testing Report&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inference Tiers &amp;amp; Integration Blueprints&lt;/strong&gt;: &lt;a href="https://www.xugj520.cn/en/archives/free-llm-api-guide-2026-2.html" rel="noopener noreferrer"&gt;Xugj520 Developer Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technical Copywriting Benchmarks&lt;/strong&gt;: &lt;a href="https://www.zhenweiliu.com/blog/comparing-llm-models-for-writing" rel="noopener noreferrer"&gt;Zhenwei Liu's Comparative Writing Ledger&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sustained Narrative &amp;amp; Evaluation Vectors&lt;/strong&gt;: &lt;a href="https://llmguides.ai/comparisons/best-llm-for-writing/" rel="noopener noreferrer"&gt;LLM Guides Content Comparison Matrix&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linguistic Efficiencies &amp;amp; Code Context Refinement&lt;/strong&gt;: &lt;a href="https://www.pluralsight.com/resources/blog/software-development/prompt-engineering-for-developers" rel="noopener noreferrer"&gt;Pluralsight Software Development Resources&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brevity and Detail Balancing Protocols&lt;/strong&gt;: &lt;a href="https://handsonpromptengineering.vercel.app/day-3/balancing-brevity-and-detail/" rel="noopener noreferrer"&gt;Hands-On Prompt Engineering Vercel Sandbox&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>promptengineering</category>
    </item>
    <item>
      <title>The joy of coding a command line english dictionary program in dotnet</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Wed, 10 Jun 2026 10:21:25 +0000</pubDate>
      <link>https://dev.to/prahladyeri/the-joy-of-coding-a-command-line-english-dictionary-program-in-dotnet-2pb1</link>
      <guid>https://dev.to/prahladyeri/the-joy-of-coding-a-command-line-english-dictionary-program-in-dotnet-2pb1</guid>
      <description>&lt;p&gt;In today's globally connected digital village, we often come across words and syllables which are quite new to us. Most folks hardly take the trouble to look up a dictionary, though; there is no immediate or short-term incentive to increase your word power, especially in a world where LLMs can do most of the intellectual bidding for you.&lt;/p&gt;

&lt;p&gt;For those of us who do care about the ever degrading human intellect and ways of preserving what little is left of it, a dictionary app or program becomes quite an essential and indispensable tool on the desktop computer. There are quite a few GUI Apps in the Windows desktop world for this, perhaps the most popular is the &lt;a href="https://wordweb.info/free/" rel="noopener noreferrer"&gt;WordWeb dictionary and thesaurus tool&lt;/a&gt; which is a freeware.&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%2Fe0f94oar3h7zicwcz79u.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%2Fe0f94oar3h7zicwcz79u.png" alt="WordWeb Dictionary App" width="800" height="745"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WordWeb isn't exactly open source but does come with a specific condition for usage: &lt;em&gt;The user must purchase a paid license if they ever took more than two flights in a single year.&lt;/em&gt; By the way, it's coded in Free Pascal which happens to be one of my favorite languages. In an alternative universe, I'd probably be using FP as a daily driver today if I hadn't fallen for C# first.&lt;/p&gt;

&lt;p&gt;The second popular dictionary app is the &lt;a href="https://artha.sourceforge.net/" rel="noopener noreferrer"&gt;open source Artha&lt;/a&gt; which is also a widely used dictionary and thesaurus app. This is GPL licensed and proper open source.&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%2Fyor2f46x2jvzvmuqrytw.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%2Fyor2f46x2jvzvmuqrytw.png" alt="Artha Dictionary App" width="300" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Being a minimalist and utilitarian power user, I had two basic issues with these desktop GUI tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They're memory resident programs and keep eating a chunk of your RAM.&lt;/li&gt;
&lt;li&gt;I have no need of the GUI bloat, just a quick lookup for an unknown word is needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I really wanted was the native, zero-bloat equivalent of the Linux command line &lt;code&gt;dict&lt;/code&gt; utility. Since a lightweight, native equivalent didn't quite fit my workflow in the Windows world, I decided to &lt;a href="https://github.com/prahladyeri/dict" rel="noopener noreferrer"&gt;write one myself in C#&lt;/a&gt;. A simple, efficient command that just outputs the meaning and synonyms of a word.&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%2Fimocs8pilqerpkbn1p68.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%2Fimocs8pilqerpkbn1p68.png" alt="dict program" width="667" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The program uses the open source &lt;a href="https://wordnet.princeton.edu/documentation/wndb5wn" rel="noopener noreferrer"&gt;WordNet&lt;/a&gt; as the data source, the same one used by some of these other dictionary apps. Needless to say, dict is still a work in progress, additional features like looking up antonyms and related words are yet to come. I'm also planning to add a &lt;code&gt;--random-word&lt;/code&gt; option which could be useful for building word power.&lt;/p&gt;

&lt;p&gt;Coding programs like these which you enjoy using yourself can be a source of tremendous joy in a world full of fast paced delivery deadlines and overwhelming pressure for AI assistance. In order to keep the art of human coding alive in the future, we need to find a purpose - the old school way. There is no other way to do it.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>windows</category>
    </item>
    <item>
      <title>The slow death of epiphanies and utilitarian programming</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Tue, 14 Oct 2025 18:03:46 +0000</pubDate>
      <link>https://dev.to/prahladyeri/the-slow-death-of-epiphanies-and-utilitarian-programming-45pn</link>
      <guid>https://dev.to/prahladyeri/the-slow-death-of-epiphanies-and-utilitarian-programming-45pn</guid>
      <description>&lt;p&gt;Utilitarian coding is defined as follows: The code you write should be &lt;em&gt;directly&lt;/em&gt; useful or serve the interest of at least one actual human being. It might appear somewhat abstract or vague, so examples might help. For example, I don't consider frameworks as utilitarian code. What you create are like the "frames" of a picture box, someone else (the user) will take it and draw the actual picture. Though you did help with part of the process, it's indirect at best. You're part of the supply chain here, not part of the team.&lt;br&gt;
A clever and witty bash script running on a unix server somewhere is also not utilitarian coding, no human ever directly benefited from it.&lt;/p&gt;

&lt;p&gt;Libraries can be somewhat utilitarian, at least more than frameworks. At least they provide some reusable functionality to the user out of the box like logging, scanning a barcode, fetching data from a URL, etc. But again, a lot of indirection and little lasting time, what did &lt;em&gt;you&lt;/em&gt; learn about implementation and life in that process my friend?&lt;/p&gt;

&lt;p&gt;It's my strong belief that our life's purpose isn't just about learning technology but also other non-technical things in life (such as life itself). By compartmentalizing themselves into libraries, frameworks, specifications, package managers, build and tooling, etc, many coders over the last decade have sort of divorced themselves from the intricacies and interaction with life itself.&lt;/p&gt;

&lt;p&gt;A decade ago from now (i.e. circa 2014-15) is where I'd say utilitarian coding came to an end. The kind of programming that prevailed until then (mostly desktop programming) was highly utilitarian in nature. You used to develop a Winforms App for the client, with actual textboxes, dropdowns and buttons, tailored to their specific requirements and domain knowledge, what could be more utilitarian than that! You used to gain domain expertise and not just technology expertise.&lt;/p&gt;

&lt;p&gt;As things started moving to the cloud, the interaction between the end-user and programmer became less and less, that's when utilitarian coding started dying too. As a new breed of specialists called "Agile Experts", "Scrum Masters", "Tech Advocates", "Thought Leaders", etc. started inserting themselves between the coder and end user, the former's role started morphing as the ostrich policy of dealing only with technology and nothing else. We started losing touch with domain expertise, and became branded as "python coder", "PHP scripter", "web developer", "AI developer", etc. That's how folks started churning out more frameworks, libraries, packages, stencils, helper scripts, etc. instead of worrying about actual problem solving with the stakeholders.&lt;/p&gt;

&lt;p&gt;This is how things stand right now for the most part, desktop development and other forms of utilitarian coding have still maintained their small niche somewhere, but they're just a niche. But it's not a healthy development, nor is it sustainable long term. I strongly feel that this bubble is waiting to burst one day soon, and there will be a reversion towards utilitarian coding again. Even the cloud itself needs to be more utilitarian, a lot of needless clutter out there which can be simplified.&lt;/p&gt;

&lt;p&gt;What do you think? Let me know in comments.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>software</category>
      <category>ux</category>
      <category>uxdesign</category>
    </item>
    <item>
      <title>Create a C# Windows Desktop App in 9 Lines — No Visual Studio Needed</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Sat, 20 Sep 2025 16:17:05 +0000</pubDate>
      <link>https://dev.to/prahladyeri/create-a-c-windows-desktop-app-in-9-lines-no-visual-studio-needed-58f0</link>
      <guid>https://dev.to/prahladyeri/create-a-c-windows-desktop-app-in-9-lines-no-visual-studio-needed-58f0</guid>
      <description>&lt;p&gt;If you're new to C# and especially desktop development, here's how easy it is to get started on a modern Windows 10/11 PC. This way of creating a Hello World C# program doesn't involve installation of any heavy IDE like Visual Studio or the .NET 8/9 SDK.&lt;/p&gt;

&lt;p&gt;In fact, most recent Windows versions already come with .NET Framework 4.x preinstalled, including the classic C# compiler at a location like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\Windows\Microsoft.NET\Framework\v4.0.30319
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The exact folder may differ depending on your system but it usually contains &lt;code&gt;csc.exe&lt;/code&gt;, the built-in compiler that can compile simple console or desktop apps. You can add this folder to your &lt;code&gt;PATH&lt;/code&gt; environment variable (temporarily or permanently) so that &lt;code&gt;csc&lt;/code&gt; is available from the command line:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set PATH=C:\Windows\Microsoft.NET\Framework\v4.0.30319;%PATH%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We will be using this classic, old-school style of programming (similar to writing C programs with &lt;code&gt;gcc&lt;/code&gt; or &lt;code&gt;turboc&lt;/code&gt;) — a great way to get acquainted with a new language.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create the source file
&lt;/h3&gt;

&lt;p&gt;Make a new folder anywhere on your drive. Inside it, create a file named Program.cs using Notepad, VS Code, or any editor you like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Windows.Forms&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&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="n"&gt;Form&lt;/span&gt; &lt;span class="n"&gt;frm&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;frm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;frm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ShowDialog&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;In just nine lines of C# code, without using any IDE, you now have a working “Hello World” desktop app with no additional dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Compile and run
&lt;/h3&gt;

&lt;p&gt;Open Command Prompt in your project folder and run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;csc Program.cs
Program
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The first line tells the C# compiler (csc.exe) to build the app into Program.exe. The second one runs it. You can also double-click Program.exe in File Explorer.&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%2F7drfcsy8ydhenc1i97s3.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%2F7drfcsy8ydhenc1i97s3.png" alt="Screenshot of Hello World WinForms app" width="286" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, a console window appears behind the form. To build a GUI-only app without the console, recompile with the &lt;code&gt;/target:winexe&lt;/code&gt; parameter:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;csc /target:winexe Program.cs&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  What’s next?&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;In upcoming posts, we’ll add more features such as menus, buttons, event handlers, and even database access with ADO.NET. But for now, enjoy this milestone: you’ve built your very first Windows desktop app in C#!&lt;/p&gt;

&lt;p&gt;By default, a console window appears behind the form. To build a GUI-only app without the console, recompile with the &lt;code&gt;/target:winexe&lt;/code&gt; parameter:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;csc /target:winexe Program.cs&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  What’s next?&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;In upcoming posts, we’ll add more features such as menus, buttons, event handlers, and even database access with ADO.NET. But for now, enjoy this milestone: you’ve built your very first Windows desktop app in C#!&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>opensource</category>
      <category>xamarinforms</category>
    </item>
    <item>
      <title>Very few people are truly 'cut out' for programming in the way it's traditionally taught or practiced</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Sat, 05 Apr 2025 03:16:13 +0000</pubDate>
      <link>https://dev.to/prahladyeri/very-few-people-are-truly-cut-out-for-programming-in-the-way-its-traditionally-taught-or-1ac5</link>
      <guid>https://dev.to/prahladyeri/very-few-people-are-truly-cut-out-for-programming-in-the-way-its-traditionally-taught-or-1ac5</guid>
      <description>&lt;p&gt;Nobody is truly that "cut out" for programming. We might be emotional and biological machines, but we aren't logical circuit boards. As humans, we are wired to appreciate patterns in life and relationships, not binary 1s and 0s. However, coding patterns like decision trees, loops, recursions, etc. also do feel interesting as long as they produce interesting and utilitarian software which feels like magic.&lt;/p&gt;

&lt;p&gt;But when the drudgery of programming sets in and all you're seeing is just heaps and mounds of instructions that need hours to fathom their working, even the best of programmers feel like leaving the field and running away! And that's exactly why things like no-code, low-code, AI assisted development, frameworks and packages, etc. are becoming so popular increasingly. Humans aren't "natural" programmers in that sense, they're primarily story tellers and meaning seekers in life.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Unlocking Text from Embedded-Font PDFs: A pytesseract OCR Tutorial</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Sun, 01 Dec 2024 06:59:06 +0000</pubDate>
      <link>https://dev.to/prahladyeri/unlocking-text-from-embedded-font-pdfs-a-pytesseract-ocr-tutorial-2jcg</link>
      <guid>https://dev.to/prahladyeri/unlocking-text-from-embedded-font-pdfs-a-pytesseract-ocr-tutorial-2jcg</guid>
      <description>&lt;p&gt;Extracting text from a PDF is usually straightforward when it's in English and doesn't have embedded fonts. However, once those assumptions are removed, it becomes challenging to use basic python libraries like &lt;code&gt;pdfminer&lt;/code&gt; or &lt;code&gt;pdfplumber&lt;/code&gt;. Last month, I was tasked with extracting text from a Gujarati-language PDF and importing data fields such as name, address, city, etc., into JSON format.&lt;/p&gt;

&lt;p&gt;If the font is embedded in the PDF itself, simple copy-pasting won't work, and using &lt;code&gt;pdfplumber&lt;/code&gt; will return unreadable junk text. Therefore, I had to convert each PDF page to an image and then apply OCR using the &lt;code&gt;pytesseract&lt;/code&gt; library to "scan" the page instead of just reading it. This tutorial will show you how to do just that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things you will need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pdfplumber&lt;/code&gt; (Python library)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pdf2image&lt;/code&gt; (Python library)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pytesseract&lt;/code&gt; (Python library)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tesseract-ocr.github.io/tessdoc/Downloads.html" rel="noopener noreferrer"&gt;tesseract-ocr&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can install the Python libraries using &lt;code&gt;pip&lt;/code&gt; commands as shown below. For Tesseract-OCR, download and install the software from the official site. &lt;code&gt;pytesseract&lt;/code&gt; is just a wrapper around the tesseract software.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;pdfplumber
pip &lt;span class="nb"&gt;install &lt;/span&gt;pdf2image
pip &lt;span class="nb"&gt;install &lt;/span&gt;pytesseract
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Converting the PDF page to an image
&lt;/h2&gt;

&lt;p&gt;The first step is to convert your PDF page to an image. This &lt;code&gt;extract_text_from_pdf()&lt;/code&gt; function does exactly that-you pass the PDF path and the &lt;code&gt;page_num&lt;/code&gt; (zero indexed) as parameters. Note that I'm converting the page to black and white first for clarity, this is optional.&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="c1"&gt;# Extract text from a specific page of a PDF
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;extract_text_from_pdf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pdf_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Use pdfplumber to open the PDF
&lt;/span&gt;    &lt;span class="n"&gt;pdf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pdfplumber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pdf_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;extracting page &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;..&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;images&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;convert_from_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pdf_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;first_page&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;last_page&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;images&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="c1"&gt;# Convert to black and white
&lt;/span&gt;    &lt;span class="n"&gt;bw_image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;convert_to_bw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# Save the B&amp;amp;W image for debugging (optional)
&lt;/span&gt;    &lt;span class="c1"&gt;#bw_image.save("bw_page.png")
&lt;/span&gt;    &lt;span class="c1"&gt;# Perform OCR on the B&amp;amp;W image
&lt;/span&gt;    &lt;span class="n"&gt;e_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ocr_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bw_image&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;out.txt&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;w&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e_text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;#print("output written to file.")
&lt;/span&gt;    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;process_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e_text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error occurred:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;done..&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Convert image to black and white
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;convert_to_bw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Convert to grayscale
&lt;/span&gt;    &lt;span class="n"&gt;gray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;L&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# Apply threshold to convert to pure black and white
&lt;/span&gt;    &lt;span class="n"&gt;bw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;point&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;128&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;bw&lt;/span&gt;

&lt;span class="c1"&gt;# Perform OCR using Tesseract on a given image
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ocr_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Perform OCR
&lt;/span&gt;        &lt;span class="n"&gt;custom_config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;--oem 3 --psm 6 -l guj+eng&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
        &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pytesseract&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;image_to_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;custom_config&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# --psm 6 treats the image as a block of text
&lt;/span&gt;        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error during OCR: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;ocr_image()&lt;/code&gt; function uses &lt;code&gt;pytesseract&lt;/code&gt; to extract text from the image through OCR. The technical parameters like &lt;code&gt;--oem&lt;/code&gt; and &lt;code&gt;--psm&lt;/code&gt; control how the image is processed, and the &lt;code&gt;-l guj+eng&lt;/code&gt; parameter sets the languages to be read. Since this PDF contained occasional English text, I used &lt;code&gt;guj+eng&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Processing the text
&lt;/h2&gt;

&lt;p&gt;Once you've imported the text using OCR, you can parse it in the format you want. This works similarly to other PDF libraries like &lt;code&gt;pdfplumber&lt;/code&gt; or &lt;code&gt;pypdf2&lt;/code&gt;.&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;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૧&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૨&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૩&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૪&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૫&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૬&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૭&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૮&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;૯&lt;/span&gt;&lt;span class="sh"&gt;'&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;process_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e_text&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;last_surname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;last_kramank&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;processing page &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;..&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;e_text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splitlines&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
        &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;|&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;]&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;parts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="n"&gt;new_rec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;new_rec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
                &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;new_rec&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# numbered line
&lt;/span&gt;            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
            &lt;span class="n"&gt;last_surname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;kramank&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;last_kramank&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;full_name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;surname&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pdf_page_num&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page_num&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;registered_by&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;village_vatan&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;village_mosal&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;વર્ષ&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
                &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;dob&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; વર્ષ&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
                &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
                &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;dob&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;warning: no date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;marital_status&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;extra_fields&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;::&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;blood_group&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;last_surname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# new member in existing family
&lt;/span&gt;            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;kramank&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;last_kramank&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;surname&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;last_surname&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;full_name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pdf_page_num&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;page_num&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;registered_by&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;village_vatan&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;village_mosal&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;વર્ષ&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# date exists
&lt;/span&gt;                &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
                &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;dob&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; વર્ષ&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
                &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
                &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;dob&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;warning: no date&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;marital_status&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;extra_fields&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;::&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;blood_group&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# continuation lines
&lt;/span&gt;            &lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;મો.ઃ&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;extra_fields&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;::&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:])&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        
    &lt;span class="n"&gt;jstr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;guj.json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;w&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jstr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;written page &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;page_num&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; to json..&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;Every PDF has its own nuances that must be accounted for. In this case, a new serial number (like 0૧ or 0૨) in the first field signaled a new group when the subsequent field (surname) changed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pytesseract&lt;/code&gt; is a testament to the evolution and advancement in IT technology. About a decade ago, reading or parsing a PDF image using OCR in a non-English language on a modestly configured PC or laptop would have been nearly impossible. This is truly progress! Happy coding, and let me know how it goes in the comments below.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/q/46140485/849365" rel="noopener noreferrer"&gt;Tesseract installation in windows&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/q/37745519/849365" rel="noopener noreferrer"&gt;Use pytesseract OCR to recognize text from an image&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/q/65572698/849365" rel="noopener noreferrer"&gt;How to configure pytesseract to support text detection for non English language in windows 10?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>ocr</category>
      <category>pdf</category>
    </item>
    <item>
      <title>Beyond Google: the future of shopping and search with ChatGPT</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Wed, 13 Nov 2024 17:00:49 +0000</pubDate>
      <link>https://dev.to/prahladyeri/beyond-google-the-future-of-shopping-and-search-with-chatgpt-2ipj</link>
      <guid>https://dev.to/prahladyeri/beyond-google-the-future-of-shopping-and-search-with-chatgpt-2ipj</guid>
      <description>&lt;p&gt;I've been an indie tech blogger for several years, and the gradually declining page views and organic traffic point toward only one thing: The reach and omniscience of Google Search are on the decline as more people become addicted to ChatGPT. If you keep an ear out on blogging and SEO subs, you'll hear the same thing.&lt;/p&gt;

&lt;p&gt;When I interact with ChatGPT today, stepping out of my programming shoes and evaluating it as a layperson, I see that the potential here is enormous and very much within the realms of technical feasibility. Many Android apps could vanish from our phones if a few key players, like OpenAI, decide to take the initiative. Imagine a chat with an LLM called BBGPT that's linked to BigBasket:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Me:&lt;/strong&gt; Hey BB, please create an order for 1 kg of sugar, 4 packets of Nandini Blue Milk, and 800 grams of Parle-G biscuits.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;BB:&lt;/strong&gt; Sugar from the Popular or Royal brand?&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Me:&lt;/strong&gt; Which one tastes better and is healthier?&lt;br&gt;&lt;br&gt;
&lt;strong&gt;BB:&lt;/strong&gt; They're usually the same for most practical purposes, but you can check the nutrition facts here, if you're interested.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Me:&lt;/strong&gt; All right, please confirm the order!&lt;br&gt;&lt;br&gt;
&lt;strong&gt;BB:&lt;/strong&gt; I've just sent a Google Pay request for UPI payment.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Me:&lt;/strong&gt; (Makes the payment).&lt;br&gt;&lt;br&gt;
&lt;strong&gt;BB:&lt;/strong&gt; Your order is confirmed! Let me know if I can do anything else for you today.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Me:&lt;/strong&gt; Thanks BB, you're a great buddy!&lt;/p&gt;

&lt;p&gt;This is 10x more efficient than placing an order on BigBasket app or website, or any online order for that matter! It's only a matter of time before someone figures this out and starts rolling these changes out.&lt;/p&gt;

&lt;p&gt;About a decade ago, in 2014, if I had told you that something similar to Tom Riddle's Diary would give a tough competition to the greatest search engine on the planet, you'd probably have laughed at me! But not today, with the advent of ChatGPT.&lt;/p&gt;

&lt;p&gt;The future is here. The technology is ready. It's only a matter of who, when, and how someone will take the initiative! What do you think about this? Please let me know in the comments.&lt;/p&gt;

</description>
      <category>chatgpt</category>
      <category>ai</category>
      <category>googlecloud</category>
      <category>ecommerce</category>
    </item>
    <item>
      <title>The whole “shameless plug” conundrum and stigma associated with sharing one’s own blog posts</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Thu, 07 Nov 2024 17:50:35 +0000</pubDate>
      <link>https://dev.to/prahladyeri/the-whole-shameless-plug-conundrum-and-stigma-associated-with-sharing-ones-own-blog-posts-15ph</link>
      <guid>https://dev.to/prahladyeri/the-whole-shameless-plug-conundrum-and-stigma-associated-with-sharing-ones-own-blog-posts-15ph</guid>
      <description>&lt;p&gt;Traditionally, there has been a significant stigma associated with sharing one’s own posts on platforms like Reddit, Facebook, Twitter/X, and others. Moderators often discourage such behavior or at least try to limit it. Terms like “self-promotion” and “blogspam” are frequently used to create a sense of disgust or guilt, especially towards indie bloggers or writers who share their posts or articles.&lt;/p&gt;

&lt;p&gt;To be fair, there have been quality issues on the other side as well, and in many cases, the content may deserve to be ignored or removed. However, there is always a better way to communicate or send a message. Our efforts should focus on nurturing creativity, not crushing it under our feet the moment it starts to show signs of life on the internet.&lt;/p&gt;

&lt;p&gt;Moreover, the world seems to be becoming increasingly unfair with each passing day. On one hand, indie bloggers are guilt-tripped and admonished by moderators for sharing their content. On the other, big players with deep pockets have their low-quality content promoted across the internet simply because they’ve paid to do so.&lt;/p&gt;

&lt;p&gt;Despite the materialist ethics of our current times, which often tilt in favor of those who pay the big bucks, the works of smaller creators and indie bloggers deserve at least a small chance — a tiny window of opportunity to share their stories with the online world.&lt;/p&gt;

&lt;p&gt;Through this open letter, I want to strongly appeal to the decision-makers and CTOs who control the largest social networks and search engine algorithms: giving that tiny window to an indie blog post may not make immediate financial sense for shareholders, but it does contribute to making the world — and the online space — better and more organic. Think about it, and if possible, act to make it happen!&lt;/p&gt;

</description>
      <category>writing</category>
      <category>seo</category>
    </item>
    <item>
      <title>The illusion of simplicity: how OOP can overcomplicate simple problems</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Tue, 05 Nov 2024 14:37:45 +0000</pubDate>
      <link>https://dev.to/prahladyeri/the-illusion-of-simplicity-how-oop-can-overcomplicate-simple-problems-23nf</link>
      <guid>https://dev.to/prahladyeri/the-illusion-of-simplicity-how-oop-can-overcomplicate-simple-problems-23nf</guid>
      <description>&lt;p&gt;Object-oriented programming (OOP) has been hailed as the savior of the software world, promising more manageable codebases and scalable applications. From encapsulation to inheritance, the paradigm offers a toolkit that is designed to make developers’ lives easier. Yet, over the years, OOP has gained its fair share of critics who argue that the principles it upholds can often lead to overcomplication—especially when applied to simple problems. So, is OOP truly the answer to every software challenge, or is it an illusion of simplicity, cloaking unnecessary complexity beneath a facade of best practices?&lt;/p&gt;

&lt;p&gt;In this deep dive, we’ll explore why the abstraction and encapsulation principles of OOP might be overkill for simple problems and when sticking to basic solutions or alternative paradigms can lead to more effective and maintainable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The promise of object-oriented programming: simplicity through abstraction
&lt;/h2&gt;

&lt;p&gt;The core philosophy of OOP is to model software as a collection of objects that interact with each other. It’s akin to representing the real world in code. Principles like inheritance, polymorphism, and encapsulation provide a way to make code modular, reusable, and maintainable. In theory, this sounds like an absolute win.&lt;/p&gt;

&lt;p&gt;Consider an example of a basic &lt;code&gt;Car&lt;/code&gt; class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Car&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;drive&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The car is driving at "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" km/h."&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;repaint&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;newColor&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;newColor&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the surface, it looks quite simple and intuitive. If you want to create a car, you instantiate an object with a color and speed, and you can make it drive or repaint it with a method. It's elegant—until complexity starts creeping in.&lt;/p&gt;

&lt;h2&gt;
  
  
  When simple tasks become complex
&lt;/h2&gt;

&lt;p&gt;The illusion of simplicity in OOP begins to unravel when basic requirements evolve. Let's say we need to support a new vehicle type: a truck. Following OOP principles, you may introduce a &lt;code&gt;Truck&lt;/code&gt; class that inherits from &lt;code&gt;Car&lt;/code&gt;, or you might abstract both into a common superclass called &lt;code&gt;Vehicle&lt;/code&gt;. It looks like a small addition, but such minor changes snowball over time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layers of abstraction: How complexity multiplies
&lt;/h3&gt;

&lt;p&gt;In larger OOP-based systems, creating classes for every concept or behavior quickly results in a deep inheritance hierarchy. A simple problem, like managing vehicles, might require dozens of classes and interfaces due to enforced abstraction.&lt;/p&gt;

&lt;p&gt;For instance, to accommodate more types like electric cars and motorcycles, you might structure a hierarchy like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vehicle&lt;/strong&gt; (superclass)

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Car&lt;/strong&gt; (inherits from Vehicle)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ElectricCar&lt;/strong&gt; (inherits from Car)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Truck&lt;/strong&gt; (inherits from Vehicle)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Motorcycle&lt;/strong&gt; (inherits from Vehicle)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;If you now need to add a behavior like &lt;code&gt;calculateMaintenanceCost()&lt;/code&gt;, you could end up writing it in multiple places or creating an additional abstraction to handle it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Encapsulation and its trade-offs
&lt;/h3&gt;

&lt;p&gt;Encapsulation is another tenet of OOP that often contributes to this complexity. While encapsulation helps in hiding internal states and only exposing necessary details, enforcing this for simple problems can create a tangled mess of getters, setters, and boilerplate methods. &lt;/p&gt;

&lt;p&gt;For instance, if the internal state of an object is simple, having strict getters and setters can lead to code that is difficult to refactor. It also creates an illusion that these methods are somehow necessary for safety or maintainability when the underlying data could be as simple as a couple of fields.&lt;/p&gt;

&lt;p&gt;This proliferation of unnecessary boilerplate has even led to entire frameworks (like JavaBeans or Lombok in Java) existing solely to reduce the drudgery of writing these repetitive pieces of code. And at that point, you need to ask: Are we truly simplifying things?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why OOP may not be the best fit for simple problems
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Misalignment with the problem domain
&lt;/h3&gt;

&lt;p&gt;In many cases, using an OOP approach to solve a simple problem can feel like over-engineering. If all you need is a script that calculates the sum of integers from 1 to 1000, writing a class named &lt;code&gt;IntegerSummationService&lt;/code&gt; with multiple methods for "abstraction" is absurdly unnecessary. &lt;/p&gt;

&lt;h3&gt;
  
  
  Functional paradigms: Less fluff, more focus
&lt;/h3&gt;

&lt;p&gt;Functional programming (FP) has gained traction as an alternative to OOP precisely because of its emphasis on simplicity and immutability. FP offers the flexibility of defining isolated functions, leading to more straightforward code for many straightforward problems.&lt;/p&gt;

&lt;p&gt;For instance, consider how a vehicle maintenance cost might be handled in a functional style:&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;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_maintenance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vehicle_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;vehicle_type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;car&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;vehicle_type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;truck&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No need for a sprawling class hierarchy; the logic is contained within a small, easy-to-understand function.&lt;/p&gt;

&lt;h3&gt;
  
  
  Procedural simplicity for simple needs
&lt;/h3&gt;

&lt;p&gt;Sometimes, basic procedural programming—writing simple scripts and functions—can be more than adequate. For tasks like file reading, processing CSVs, or generating reports, there's often no tangible benefit to wrapping the logic in classes or objects. The code remains more readable and easier to maintain without the OOP overhead.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pitfalls of enforced best practices
&lt;/h2&gt;

&lt;p&gt;The notion that OOP is the &lt;em&gt;only&lt;/em&gt; way to organize code is a fallacy that often leads developers to overthink basic solutions. A classic example of this can be seen in frameworks that enforce design patterns, such as Model-View-Controller (MVC). While MVC is great for complex applications, forcing it on a simple CRUD application can lead to unnecessary classes, interfaces, and abstract factories.&lt;/p&gt;

&lt;p&gt;It’s like forcing every home cook to set up a professional kitchen just to make a bowl of cereal.&lt;/p&gt;

&lt;h3&gt;
  
  
  An anecdote: The battle with classes and interfaces
&lt;/h3&gt;

&lt;p&gt;Here’s a story that many developers can relate to. I once worked on a project where a senior developer insisted that every single domain object needed an accompanying factory class. For example, to instantiate an order, we had to go through an &lt;code&gt;OrderFactory&lt;/code&gt;. This was justified as a best practice, and when I inquired about what it achieved, the answer was always the same: &lt;em&gt;“It’s good design.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What it ended up achieving was hundreds of lines of boilerplate code and confused junior developers who spent more time understanding factories than solving actual business problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  When OOP works, and when it doesn’t
&lt;/h2&gt;

&lt;p&gt;Of course, there are situations where OOP shines. For large-scale systems with numerous entities and relationships—such as banking systems, e-commerce platforms, or content management systems—OOP can help manage the complexity effectively. The benefits of encapsulation, polymorphism, and inheritance pay off in these scenarios.&lt;/p&gt;

&lt;p&gt;However, using the same hammer for every nail isn’t always the right strategy. For smaller projects or simple tasks, other paradigms like functional programming, scripting, or procedural code can be more straightforward, easier to maintain, and require less boilerplate.&lt;/p&gt;

&lt;h2&gt;
  
  
  The key takeaway: balance over zealotry
&lt;/h2&gt;

&lt;p&gt;The takeaway here is not to discard OOP altogether. It’s a valuable tool, but one that needs to be wielded judiciously. Treating it as a panacea can lead to an illusion of simplicity that hides layers of unnecessary complexity. As developers, we must remain adaptable, choosing the right paradigm based on the problem at hand rather than blindly adhering to OOP principles.&lt;/p&gt;

&lt;p&gt;The next time you’re about to design a new system or refactor an existing one, ask yourself: &lt;em&gt;Is OOP truly the simplest solution?&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agile</category>
      <category>programming</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Robots.txt pitfalls: what I learned the hard way</title>
      <dc:creator>Prahlad Yeri</dc:creator>
      <pubDate>Sun, 27 Oct 2024 05:08:15 +0000</pubDate>
      <link>https://dev.to/prahladyeri/robotstxt-pitfalls-what-i-learned-the-hard-way-2aip</link>
      <guid>https://dev.to/prahladyeri/robotstxt-pitfalls-what-i-learned-the-hard-way-2aip</guid>
      <description>&lt;p&gt;This applies to sites indexed on Google that hope to gain organic traffic. As an indie blogger and SEO enthusiast, I foolishly updated my robots.txt file to prevent indexing of certain unwanted parts of my site, leading to subtle repercussions that I couldn't have foreseen.&lt;/p&gt;

&lt;p&gt;A few days ago, while reading about SEO, I came across the concept of a "crawl budget." Apparently, Google allocates a specific crawl budget to your indexed site, and the more useless content it has to index and store on its servers, the more it affects your site—resulting in delays for new content indexing, favicon updates, and robots.txt crawling.&lt;/p&gt;

&lt;p&gt;Being a minimalist and utilitarian, I decided to prevent indexing of the &lt;code&gt;/uploads/&lt;/code&gt; directory on my site since it mostly contained images used in my articles. I thought blocking this "useless content" would free up more crawling budget for my primary content, i.e., articles. So, I added this directory to my site's robots.txt:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Group 1
User-agent: *
Disallow: /public/
Disallow: /drafts/
Disallow: /theme/
Disallow: /page*
Disallow: /uploads/

Sitemap: https://prahladyeri.github.io/sitemap.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The way search engines work means there's typically a 5-7 day gap between updating the robots.txt file and crawlers processing it. After about a week, I noticed that my site's favicon disappeared from SERPs on mobile browsers! Instead, there was a bland (empty) icon in its place. That’s when I realized that my favicons also resided in the &lt;code&gt;/uploads/&lt;/code&gt; directory. After I recently optimized the favicon format by switching from WEBP to PNG, Google was unable to crawl and index the new favicon at all!&lt;/p&gt;

&lt;p&gt;Once I realized this mistake, I removed the blocking of &lt;code&gt;/uploads/&lt;/code&gt; from the robots.txt and requested a recrawl. But who knows how long it will take for Google's systems to sync this change and start showing the site's favicon back in SERPs! Two lessons learned:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The robots.txt file is highly sensitive; avoid modifying it if possible.&lt;/li&gt;
&lt;li&gt;Applying SEO is like steering an extremely large ship or vessel. You pull a lever now, and the ship only moves after several days!&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>seo</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
