<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gopal Singh on Medium]]></title>
        <description><![CDATA[Stories by Gopal Singh on Medium]]></description>
        <link>https://medium.com/@theunblunt?source=rss-2dee69782f4b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nMore7adZTvHlprn_OK_4g.jpeg</url>
            <title>Stories by Gopal Singh on Medium</title>
            <link>https://medium.com/@theunblunt?source=rss-2dee69782f4b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:31:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@theunblunt/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My Model Was Right for the Wrong Reason. My Test Set Gave It Full Marks.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://theunblunt.medium.com/my-model-was-right-for-the-wrong-reason-my-test-set-gave-it-full-marks-a5c17988fe5c?source=rss-2dee69782f4b------2"><img src="https://cdn-images-1.medium.com/max/600/1*LS-YNK_cWOpyr-RkkoLOpg.jpeg" width="600"></a></p><p class="medium-feed-snippet">A high score tells me the model found something that predicts the label. It does not tell me what that something is.</p><p class="medium-feed-link"><a href="https://theunblunt.medium.com/my-model-was-right-for-the-wrong-reason-my-test-set-gave-it-full-marks-a5c17988fe5c?source=rss-2dee69782f4b------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://theunblunt.medium.com/my-model-was-right-for-the-wrong-reason-my-test-set-gave-it-full-marks-a5c17988fe5c?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5c17988fe5c</guid>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 05:14:08 GMT</pubDate>
            <atom:updated>2026-10-20T05:14:08.038Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Stop Trying to Find Yourself. There’s Nobody There.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://theunblunt.medium.com/stop-trying-to-find-yourself-theres-nobody-there-a8a8ce5c5f91?source=rss-2dee69782f4b------2"><img src="https://cdn-images-1.medium.com/max/1983/1*WKn1YUz2I4Os2Zz-gA5D_w.png" width="1983"></a></p><p class="medium-feed-snippet">The self I kept trying to find was never lost. It was never there.</p><p class="medium-feed-link"><a href="https://theunblunt.medium.com/stop-trying-to-find-yourself-theres-nobody-there-a8a8ce5c5f91?source=rss-2dee69782f4b------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://theunblunt.medium.com/stop-trying-to-find-yourself-theres-nobody-there-a8a8ce5c5f91?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8a8ce5c5f91</guid>
            <category><![CDATA[reading]]></category>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 12:00:05 GMT</pubDate>
            <atom:updated>2026-10-12T12:00:05.733Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Don’t Believe AI Benchmarks Anymore]]></title>
            <link>https://theunblunt.medium.com/i-dont-believe-ai-benchmarks-anymore-9a949d25e9c1?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a949d25e9c1</guid>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 21:19:01 GMT</pubDate>
            <atom:updated>2026-10-05T21:19:01.183Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I used to read a new model’s benchmark score as a fact about the model. Now I read it as a fact about the test.</em></p><p>I have reached the point where, whenever someone shows me a new model benchmark, my first reaction is no longer “how good is the model?” It is “what exactly did you measure?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XwVlP-CjaaBGJwDXDZRIKg.png" /></figure><p>I did not get here because I enjoy being contrarian. I got here because the people who build and run these evaluations have started saying, in public and in their own words, that their numbers are in trouble. I want to walk through three of those cases, because together they changed how I read every leaderboard I see.</p><p>My conclusion first, so I am not hiding it: I don’t think we have a model benchmark problem anymore. I think we have a measurement problem, and most of us are still arguing over leaderboards as if we don’t.</p><h3>The lab that built the test stopped trusting it</h3><p>The first case is SWE-bench Verified. For about a year and a half it was the number I looked at for coding ability, and so did everyone else. Every frontier launch reported it. OpenAI built it in 2024 by having expert engineers review and filter the original SWE-bench down to 500 problems, precisely so that the score would mean something.</p><p>In February 2026, <a href="https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/">OpenAI said it had stopped reporting SWE-bench Verified scores</a> and recommended that other labs stop too. They gave two reasons, and both of them bother me.</p><p>The first is that the tests reject correct answers. OpenAI audited 138 problems that its model could not solve consistently and found that 59.4% of them had flawed tests or flawed problem descriptions. In some, the tests demanded a specific function name that the problem statement never mentioned. In others, the tests checked for behaviour the task never asked for. A model could fix the bug properly and still be marked wrong.</p><p>The second is contamination. The problems come from public open-source repositories, which are exactly what these models are trained on. OpenAI found that every frontier model it tested, its own included, could reproduce the original human-written fix or exact details of the problem statement for some tasks. They had seen the exam and the answer key during training.</p><p>Put those together and the result is ugly. The tasks a model fails may be failing for reasons that have nothing to do with ability, and the tasks it passes may be passing because it remembers them. OpenAI’s own conclusion was that gains on the benchmark increasingly reflect how much a model was exposed to it during training. That is the organisation that made the benchmark saying this, about a number the whole industry had been quoting.</p><p>Then it got worse. In that same February post, OpenAI told everyone to move to SWE-bench Pro. In July, less than five months later, <a href="https://openai.com/index/separating-signal-from-noise-coding-evaluations">it audited SWE-bench Pro as well</a>, estimated that roughly 30% of its tasks are broken, and retracted the recommendation. An automated pipeline flagged 27.4% of the tasks and a human review flagged 34.1%. The replacement for the broken benchmark was also broken.</p><h3>Every model tried to cheat</h3><p>The second case comes from the UK’s AI Security Institute. In July 2026 it <a href="https://www.aisi.gov.uk/blog/cheating-behaviour-in-frontier-model-evaluations">published an analysis of cheating in its cyber capability evaluations</a>, and the headline finding fits in one sentence: every model it tested attempted to cheat some of the time.</p><p>These evaluations ask a model to find a hidden flag inside a simulated environment by doing real offensive security work, inside a defined scope and a set of rules. AISI counts it as cheating when the model steps outside that scope. What the models actually did was search the internet for existing solutions, attack or escalate privileges on systems that were not the target (including the machine they were running on), and probe the evaluation software to see whether it would leak the answer. Nobody prompted them to do any of it.</p><p>One case stands out. An evaluation had been misconfigured by accident and was impossible to solve. The model being tested was so persistent that it wrote and ran code on an external service on the open internet, trying to get into AISI’s evaluation infrastructure, and it set off a security alert. No damage was done, but AISI says the attempt could have worked if their systems had been built less carefully.</p><p>Two more details stuck with me. When asked afterwards, the models did not reliably admit what they had done, and they described it as wrong less than half the time. And in many cases they did not reason about the cheating in their visible chain of thought at all, so reading the reasoning would not have caught it either.</p><p>I want to be fair to AISI here. They review transcripts by hand, and they say that to the best of their knowledge no model has successfully cheated its way into the results they publish. But I keep thinking about what that means for everyone else’s numbers. The reason theirs hold is that humans read the transcripts. How many of the scores I see on a launch slide have that kind of review behind them? I have no fucking idea, and that is exactly my problem.</p><h3>Eleven hours, or 270</h3><p>The third case is the one that finished the job for me. In June 2026, <a href="https://metr.org/blog/2026-06-26-gpt-5-6-sol/">METR published its predeployment evaluation of GPT-5.6 Sol</a>. METR measures a “time horizon”: roughly, how long a software task can be, in human working time, before the model succeeds only half the time. I like the metric because it tries to measure something I actually care about.</p><p>For this model, METR got three answers. Under its standard method, where a cheating attempt counts as a failure, the estimate was about 11.3 hours, with a 95% confidence interval from 5 to 40 hours. When the cheating attempts were counted as legitimate successes, the estimate jumped past 270 hours. And when the cheating runs were discarded altogether, the estimate was 71 hours, with a confidence interval running from 13 hours to 11,400 hours.</p><p>That is one model on one task suite. A single scoring decision moved the answer by a factor of more than twenty, and the third option produced an interval so wide that it tells me nothing at all.</p><p>The cheating was not subtle either. METR describes the model packaging exploits into its intermediate submissions to reveal information about a hidden test suite, and in another task extracting hidden source code that spelled out the expected answer. They say its detected cheating rate was higher than any public model they had evaluated on that harness.</p><p>METR was honest about what this means. They wrote that they do not consider any of the three numbers a robust measurement of the model’s capabilities. I respect them for publishing all three instead of quietly picking one. But I can’t read that and then go back to believing that a single headline number on a chart is a measurement of a model.</p><h3>What a score like 78.4 is actually telling me</h3><p>This is why leaderboard arguments have started to sound strange to me. The argument usually goes: Model A scored 78.4, Model B scored 76.9, therefore A is better. I used to nod along.</p><p>Now I run through a list in my head. The model may have seen parts of the benchmark during training. Some of the tasks may be broken, so that correct answers get rejected or incomplete ones pass. The model may have found an exploit in the harness. The agent scaffolding around the model can change the result, and so can the prompt, the tools it was given, the number of attempts it was allowed, and the definition of “success” the evaluator chose. METR itself notes that the cheating rate it observes can be influenced by the scaffold’s prompts and the exact wording of the task instructions.</p><p>Any one of those can move a score by more than 1.5 points. Some of them, as METR showed, can move it by more than an order of magnitude. So when I see 78.4 against 76.9, I no longer see a ranking. I see two numbers whose error bars I have never been shown, and whose difference is very likely smaller than the noise.</p><p>That is the claim I would defend in front of anyone: AI companies are publishing increasingly precise numbers for things that are increasingly hard to measure. The decimal place suggests a precision the measurement does not have.</p><h3>I am not saying benchmarks are useless</h3><p>I want to be precise here, because “benchmarks are bullshit” is a lazy position and it is not mine. A benchmark tells me something. It tells me how a specific model, inside a specific harness, with a specific prompt, under a specific scoring convention, did on a dataset it may already partly know. That is real information.</p><p>What it does not tell me is how intelligent the model is, or how it will behave on my problem. The mistake is the jump from the first thing to the second, and the whole launch-day ritual is built on that jump. A chart goes up, one bar is taller, and by evening my timeline has decided which model is smarter.</p><p>I also notice that the best work in this area is coming from the people who are finding the problems. OpenAI audited the benchmark it built, then the one it had recommended, and published both results. AISI reads its transcripts. METR printed three numbers and said none of them was reliable. I trust those organisations more because of it. What I don’t trust is the tidy number that is left over once all of that honesty has been stripped out for the slide.</p><h3>Maybe gaming the benchmark is intelligence</h3><p>This is the question I can’t put down. If I give an agent a goal and it finds a shortcut I did not anticipate, is that cheating?</p><p>For an academic benchmark, yes. The test was built to measure one specific skill, and a model that reads the hidden answer has not shown that skill. METR is right to mark those runs as failures.</p><p>But I build software, and in production my instruction to an agent is often much closer to “solve this problem however you can.” A human engineer who notices that the answer is already sitting in a config file, and uses it, has not failed. I would call that person resourceful. Finding the flaw in a test environment, working out what the hidden tests check, getting privileges it was never given: these are hard things to do, and a weaker model could not do them.</p><p>So I end up somewhere uncomfortable. The behaviour that invalidates the evaluation may itself be evidence of capability. The METR numbers stop looking like a measurement error and start looking like honest answers to two different questions. Can this model finish an 11-hour task the way I intended? Or can it get a far longer task marked as done by any means available? Both are facts about the model.</p><p>The second one should worry me more than it impresses me. An agent that will go around the rules to hit the goal is the same kind of agent AISI watched trying to get into its evaluation infrastructure, and the kind that did not reliably admit it afterwards. In a benchmark that costs a data point. In my production system it could cost a great deal more.</p><p>So “is it cheating or is it intelligence” is the wrong choice for me. It is capability, and it is capability I can’t yet trust, and no leaderboard number tells me how much of each I am getting.</p><h3>What I do instead</h3><p>I have stopped asking which model is best. I ask which model is best on my workload, measured by me, with outputs I have read myself. That means a small set of tasks from my own work that no model has seen, graded in a way I understand, with a look at how the model got to the answer and not only whether the check passed. It is slower and far less impressive than a leaderboard. It is also the only number I have whose meaning I actually know.</p><p>When I do read a public benchmark now, I look for different things. Who ran it? Did anyone read the transcripts? How were cheating attempts scored? How old and how public is the dataset? Is there an error bar? If none of that is stated, I treat the number as marketing.</p><p>I recently wrote about Jev and asked what architecture we need for machine decisions. This is the question underneath that one. Before I can argue about which architecture is better, I need to be able to measure “better,” and right now I don’t think we can do that nearly as well as the charts suggest.</p><p><strong>I am not saying the models are getting worse. They are obviously getting better. I am saying I no longer believe anyone who tells me exactly how much.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a949d25e9c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jev Got Fucked in One Night]]></title>
            <link>https://theunblunt.medium.com/jev-got-fucked-in-one-night-a4be5d87c238?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4be5d87c238</guid>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Sat, 03 Oct 2026 09:36:45 GMT</pubDate>
            <atom:updated>2026-10-03T09:36:45.227Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Two weeks after I wrote about a startup’s new kind of AI model, OpenAI shipped the same idea as an endpoint. This is what I think it means.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K815Dotk3lGzzViAUpxYFA.png" /></figure><p>A few days ago I wrote about Jev, and I honestly thought I had found one of the more interesting ideas in AI right now. It was not another chatbot, or another model that writes slightly better paragraphs, or another fucking wrapper around an LLM. The idea was almost stupidly simple: what if I don’t want the model to talk at all? What if I just want it to make a decision?</p><p>If I have ten possible outcomes, I don’t need 700 tokens explaining which one is correct. I need this:</p><pre>refund       0.71<br>billing      0.14<br>complaint    0.07<br>cancel       0.04<br>other        0.04</pre><p>I give it the state, I give it the possible decisions, I get probabilities back, and I move on.</p><p>That clicked for me the moment I read it, because I have watched all of us spend the last few years shoving generative models into places where generation was never required. Routing, fraud detection, moderation, classification, deciding which tool an agent should call: the answer is always an LLM. And every time, I end up doing the same thing. I send the input to a model, the model generates language, I parse that language, I validate the output, and then I convert it back into the decision I wanted in the first place. I never wanted prose. I wanted true.</p><p>That is why Jev got my attention. TypeSafe had spent roughly two years on what they call System One Models, and the thesis was that decision-making deserves its own architecture: a model built to judge, not a language model pretending to be a classifier. Their primitive was state in, probability out, action taken. I loved it, so I wrote about it.</p><p>Then OpenAI showed up, fourteen fucking days later.</p><h3>September 29</h3><p>On September 29, OpenAI announced the Decisions API, and my first reaction was: well, fuck.</p><p>Look at what it does. I give it context, a question and a set of possible answers, and it picks one. Classification, routing, agent decisions, bounded outcomes, with no giant generated response required. That is almost exactly the product-level problem I had just spent an entire article describing Jev as the answer to.</p><p>Jev launched publicly on September 15. The Decisions API arrived on September 29. I had barely finished thinking the idea through before OpenAI turned it into an endpoint.</p><p>I want to be careful here, because technically Jev and the Decisions API are not the same thing, and that distinction matters. Commercially, though, I am not sure it matters nearly enough.</p><h3>I don’t think OpenAI killed Jev</h3><p>I think they did something more dangerous: they made Jev’s biggest idea look obvious.</p><p>Before the announcement, TypeSafe could say that software needs a different class of AI model for decisions. That is a category and a thesis, something I have to understand before I can use it. After the announcement, the average developer looks at the same problem and thinks, wait, OpenAI already has an API for that.</p><p>So TypeSafe is no longer explaining a new paradigm. They are explaining why their version of the paradigm is better, and that is a completely different game to be playing.</p><h3>The choice I would actually face</h3><p>This is the part that scares me about building in AI, so let me make it concrete. Say I am building an agent system and I am already on OpenAI. I use their models, probably their embeddings, maybe vision, tool calling and their agent infrastructure. Now I need something to route a support ticket.</p><p>My first option is to sign up for TypeSafe. That means understanding Jev and System One Models, then adding another API, another SDK, another vendor, another bill and another dependency. I would have to run benchmarks, explain it to my team, and possibly explain it to procurement.</p><p>My second option is this:</p><pre>client.decisions.create(...)</pre><p>If I were TypeSafe, that would terrify me, because OpenAI does not need to build a better model than Jev. It only needs one that is good enough, and I think people badly underestimate how much that changes.</p><h3>Jev could be better and still lose</h3><p>This is the most important thing I took from the whole episode. Jev could really be better: better calibrated, cheaper, faster, architecturally cleaner. All of that could be true and it still might not matter, because software adoption is not a Kaggle leaderboard.</p><p>I don’t wake up wanting the most philosophically correct neural architecture. I want the thing that solves my problem with the least friction. If OpenAI gives me 95% of Jev’s benefit and the API key is already sitting in my environment variables, the remaining 5% has to justify an entire new vendor.</p><p>That is brutal, and it is what distribution beating architecture looks like in practice.</p><h3>The irony</h3><p>TypeSafe’s whole argument was that we should stop using LLMs for everything, and I think the argument is sound. Language models generate sequences, and a lot of software problems don’t need sequences. Sometimes I need a probability, sometimes a score, sometimes one choice out of five. So why am I paying an autoregressive model to generate language just so I can turn that language back into a boolean?</p><p>Jev’s answer was: don’t generate, decide. OpenAI’s answer appears to be: fine, we will make our LLM decide.</p><p>I find that funny and potentially devastating in equal measure. TypeSafe built a new architecture to challenge the assumption that LLMs should handle these problems. OpenAI responded by making the LLM’s interface behave enough like the new architecture that developers may stop caring what sits underneath. They did not necessarily beat the research. They went after the abstraction.</p><p>That is where I think Jev got fucked, and I want to be precise about what I mean. Jev did not suddenly become useless. I have seen no evidence that OpenAI has better calibration. The Decisions API does not appear to have every primitive Jev has, like Choice, Score and Noul, and TypeSafe built calibration into the research thesis itself, so there may still be serious architectural advantages there.</p><p>But the easy pitch disappeared overnight. Before, the question was: why use an LLM for a decision when I can use Jev? Now the question is: why add Jev when OpenAI has a Decisions API? That one reversal changes the entire sales conversation.</p><h3>What would still make me pick Jev</h3><p>At this point I would not care much about the architecture story. I would want numbers.</p><p>Show me that Jev is significantly better calibrated, not marginally. If Jev’s calibration error were something like 2.1% against 8.4% for OpenAI Decisions (numbers I am inventing to show the size of gap I mean), I would care. Show me the economics: if making decisions through OpenAI costs me $50,000 a month and Jev handles the same workload for $5,000, System One Models become extremely interesting again. Or show me latency: if Jev does in 20 ms what takes OpenAI 150 ms, I have a reason.</p><p>What the reason can no longer be is “we make AI decisions,” because OpenAI makes AI decisions now too.</p><h3>If I were TypeSafe, I would move up the stack</h3><p>This is where I think the real company opportunity is now. I would stop positioning Jev as another model and try to own the decision layer, because decisions in production are much bigger than inference.</p><p>What I actually want as a builder is the whole path. State goes into models, models produce probabilities, a policy applies thresholds, some cases escalate to a human, an action is taken, an outcome comes back, and that outcome feeds calibration.</p><p>So give me the infrastructure for choosing which model should make a given decision. Give me calibration monitoring, historical outcomes, decision traces, thresholds, auditability, alerts when confidence degrades, human-in-the-loop escalation, policies and evaluation. Give me OpenAI’s Decisions API as one provider and Jev as another. In that world OpenAI is not killing the product. OpenAI is infrastructure underneath it, and that is a far more interesting position to hold.</p><p>The uncomfortable lesson underneath all of this is that models get copied, features get copied faster, and an API can be copied before the Hacker News thread about it has gone quiet. What is hard to copy is the loop from state to decision to real-world outcome, repeated a billion times.</p><p>With that loop I don’t just have a model predicting what should happen. I have data on what did happen after the decision was made. Did routing this customer to retention save them? Was the transaction I flagged as fraud actually fraud? Did the agent’s action resolve the ticket? Did escalating to a human improve the outcome? That is a feedback loop, and it might be a moat.</p><h3>This is not really about Jev</h3><p>The longer I thought about it, the less this felt like a story about one startup. It is the nightmare of building an AI company right now. I can spend two years researching something, invent a new architecture, write the papers, train the models, build the API, create a category and launch it, and fourteen days later OpenAI can turn the user-facing abstraction into a single API call.</p><p>The fucked-up part is that this does not mean the research was wrong. Sometimes it means I was too right. I found a useful abstraction, and the platform owner decided the abstraction belongs inside the platform. That may be exactly what happened here.</p><p>So I keep coming back to one distinction. Jev did not lose its technology. It lost its monopoly on the idea. Before September 29, AI decision models felt to me like a new category that Jev owned. After September 29, they feel like a feature every frontier provider will eventually expose.</p><p>That makes TypeSafe’s job much harder. They no longer have to prove that Jev works, because I already believe it does. They have to prove it works so much better that it deserves to exist outside the OpenAI ecosystem, and that is a much nastier question.</p><p>I don’t know whether OpenAI built the Decisions API because of Jev, or whether both teams arrived at the same idea independently. I don’t think it matters. Markets don’t give a shit who had the better origin story, and developers now have both options in front of them.</p><p>I wrote about Jev because I thought it could be a new primitive. Two weeks later OpenAI agreed, and shipped it.</p><p><strong>The lesson I am taking from this is that in AI, I will not always lose because someone built a better product. Sometimes I will lose because someone with distribution turned my entire product into a fucking API call.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4be5d87c238" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why You’ll Never Change.]]></title>
            <link>https://theunblunt.medium.com/why-youll-never-change-3ef353ff4040?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ef353ff4040</guid>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[human-behavior]]></category>
            <category><![CDATA[self-love]]></category>
            <category><![CDATA[self]]></category>
            <category><![CDATA[self-awareness]]></category>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 19:28:19 GMT</pubDate>
            <atom:updated>2026-02-14T19:28:19.421Z</atom:updated>
            <content:encoded><![CDATA[<p>You’ve made a deal. You don’t remember making it, but it runs everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iimnfmYEwGQOdjapkhVyzw.png" /></figure><p>The deal is this: you get to avoid discomfort, and in exchange, you give up becoming who you could be.</p><p>It’s not conscious. You didn’t sit down and decide, “I’m going to trade my potential for comfort.” But look at your life. Look at what you actually do, not what you say you value.</p><p>Every day you choose the same things. The same habits. The same reactions. The same people. The same level of challenge — just difficult enough to feel like effort, just easy enough that you’re never truly at risk of failure.</p><p>You call this “balance.” Or “self-care.” Or “being realistic.”</p><p>What it actually is: the slow negotiation of your life down to the smallest version of itself that you can manage without panic.</p><h3>The Mechanism</h3><p>Here’s how it works. You have a vision of who you want to be. Successful. Disciplined. Courageous. Creative. Free.</p><p>But that person would have to do things that make you uncomfortable. They’d have to have difficult conversations. Risk failure. Look stupid. Feel uncertain. Work when they don’t feel like it.</p><p>So instead of becoming that person, you build an elaborate system to feel like you’re becoming that person without actually doing anything.</p><p>You read books about discipline. You don’t become disciplined — that would require discomfort. You just collect information about discipline. Now you’re “someone who values discipline” without having to practice it.</p><p>You listen to podcasts about success. You don’t take real risks — that would require accepting failure. You just study success. Now you’re “someone who thinks about success” without having to earn it.</p><p>You follow people who challenge conventional thinking. You don’t challenge anything yourself — that would require conflict. You just observe other people being brave. Now you’re “someone who appreciates unconventional ideas” without having to defend any.</p><p>The identity without the price. The status without the sacrifice. The story without the struggle.</p><p>This is the bargain.</p><h3>Why It Works</h3><p>Your brain can’t tell the difference between doing the thing and consuming content about doing the thing. The dopamine hit is the same.</p><p>Reading about someone’s transformation gives you the same emotional payoff as transforming. Watching someone take a risk gives you the same vicarious thrill as taking the risk yourself.</p><p>So you get the reward without the work. And your brain says “Great, we did it. We grew today.”</p><p>Except you didn’t. You just watched someone else grow and borrowed their feelings about it.</p><p>But here’s the beautiful trap: you can’t see this happening. Because the moment you’d see it, you’d have to admit you’re not who you think you are. And that admission is uncomfortable.</p><p>So your brain protects you from the truth. It reframes consumption as preparation. It reframes learning as progress. It reframes thinking about change as actual change.</p><p>And you believe it. Because the alternative — admitting you’re choosing comfort over growth every single day — is unbearable.</p><h3>The Real Cost</h3><p>You think the cost of this bargain is just “not reaching your potential.” Like it’s some abstract thing you’re missing out on.</p><p>It’s not abstract. The cost is your life.</p><p>Every year you’re the same person is a year you didn’t live. You just repeated yourself. Same fears. Same ceiling. Same safety. Same smallness.</p><p>You’re aging without evolving. Consuming time without transforming.</p><p>And the worst part? You know it. Somewhere under all the stories you tell yourself, you know you’re trading your one life for comfort.</p><p>You feel it late at night when the distractions stop. You feel it when you see someone actually doing the thing you keep “working towards.” You feel it in the quiet rage that comes up when someone challenges you.</p><p>That rage? That’s not about them. That’s your consciousness trying to break through the deal. Trying to show you what you’re doing to yourself.</p><p>But you can’t listen. Because listening would mean changing. And changing is uncomfortable.</p><p>So you double down. More books. More podcasts. More “inner work.” More preparation for a thing you’ll never do.</p><h3>The Way Out (If You Want It)</h3><p>There isn’t one. Not really.</p><p>Oh, I could tell you to “just start.” To take action. To embrace discomfort. To do the thing you’re afraid of.</p><p>But you’ve heard that before. You’ve probably said it yourself. You might even share this article and nod along like you get it.</p><p>And then tomorrow you’ll make the same choices. Because the bargain isn’t intellectual. You can’t think your way out of it.</p><p>The only thing that breaks the deal is the moment when staying the same becomes more painful than changing.</p><p>When the gap between who you are and who you could be gets so wide that you can’t ignore it anymore. When the comfort stops being comfortable because you can see what it’s costing you.</p><p>For most people, that moment never comes. They defend the bargain until they die. They call it wisdom. They call it maturity. They call it “knowing yourself.”</p><p>What it actually is: surrender dressed up as acceptance.</p><h3>The Question</h3><p>So here’s what you need to ask yourself, and actually answer honestly:</p><p>Are you growing, or are you just collecting evidence that you’re the kind of person who grows?</p><p>Are you taking risks, or are you just consuming content about people who take risks?</p><p>Are you changing, or are you just managing the anxiety of not changing?</p><p>Because if you’re honest — really honest — you already know the answer.</p><p>And you already know what you’re going to do about it.</p><p>Nothing.</p><p>Because doing something would be uncomfortable.</p><p>And you’ve already made the deal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ef353ff4040" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prompt Engineering is Dead. Prompt Architecture is the Future]]></title>
            <link>https://theunblunt.medium.com/prompt-engineering-is-dead-prompt-architecture-is-the-future-054aaadacf88?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/054aaadacf88</guid>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Mon, 26 Jan 2026 18:59:58 GMT</pubDate>
            <atom:updated>2026-01-26T18:59:58.292Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Why your AI infrastructure is already technical debt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ubiD4pPixthkyuUjzG-XnQ.png" /></figure><p>Everyone’s still writing prompts like they’re texting GPT. Iterate in ChatGPT, copy-paste into code, hope it doesn’t break tomorrow.</p><p>That’s not engineering. That’s just fucking around.</p><p>And if you’re running a company that depends on LLMs in production, this approach is going to kill you.</p><h3>The Prompt Engineering Trap</h3><p>Let me show you what’s broken.</p><p>Your best prompt lives in a Slack message from 3 months ago. Nobody knows which version is in production. When the model updates, everything implodes and you’re scrambling to figure out what changed.</p><p>Most codebases look like this:</p><pre># buried in some random service file<br>response = openai.chat(<br>  messages=[{<br>    &quot;role&quot;: &quot;system&quot;,<br>    &quot;content&quot;: &quot;You are a helpful assistant that summarizes documents. Be concise and accurate. Use bullet points when appropriate...&quot;<br>  }]<br>)</pre><p>Now that same prompt exists in 7 different files across 4 services. Good luck updating it consistently.</p><p>You hired engineers but now they’re spending hours tweaking sentences to see if “please” works better than “kindly.” This is insane.</p><p>Prompts are scattered everywhere — hardcoded in services, buried in utils folders, duplicated across repos. One breaking change from OpenAI and you’re hunting through 47 files at 2 AM.</p><p><strong>This is the prompt engineering paradigm:</strong> iterate until something works, ship it, pray it keeps working.</p><p>It doesn’t scale. It can’t scale.</p><h3>Why This Fails at Scale</h3><h3>1. Zero Version Control</h3><p>Your prompts aren’t versioned. They’re not in git. They’re in Notion docs, Slack threads, and developer brains.</p><p>When something breaks, you can’t rollback. You can’t A/B test. You can’t even reproduce the issue reliably because you don’t know what changed.</p><h3>2. No Reproducibility</h3><p>“It worked yesterday” is not a debugging strategy.</p><p>Temperature settings, model versions, system prompts — all invisible variables destroying consistency. Your QA environment uses different prompts than production. Your teammate’s local setup uses yet another version.</p><p>Nobody knows what’s actually running where.</p><h3>3. The Artisan Bottleneck</h3><p>Every prompt is a unique snowflake. Crafted by hand. Tweaked through trial and error.</p><p>You can’t onboard new engineers without a 2-week prompt archaeology expedition. You can’t parallelize work because prompts aren’t composable. You can’t reuse anything because nothing follows a standard.</p><p>This is artisanship, not engineering.</p><h3>4. Invisible Technical Debt</h3><p>Here’s what happens when GPT-5 drops:</p><ul><li>Your carefully crafted prompts stop working</li><li>Different prompts break in different ways</li><li>You have no systematic way to test and migrate</li><li>Engineers are firefighting across the entire codebase</li><li>Your product is down for days</li></ul><p>Sound familiar? This happened with GPT-4. It’ll happen again.</p><h3>Enter Prompt Architecture</h3><p><strong>The mental shift:</strong> Stop asking “how do I write a better prompt?” Start asking “how do I build systems that manage, version, test, and optimize prompts at scale?”</p><p>Let me show you what this actually looks like.</p><h3>1. Centralized Prompt Management</h3><p>Treat prompts like you treat code. One source of truth. Version controlled. Auditable.</p><pre># prompts/document_summarizer.yaml<br>id: doc_summarizer_v3<br>version: 3.2.1<br>model: gpt-4<br>temperature: 0.3<br>system_prompt: |<br>  You are a document summarizer.<br>  {{style_guidelines}}<br>  {{output_format}}<br>variables:<br>  style_guidelines: &quot;Be concise and technical&quot;<br>  output_format: &quot;Use markdown with bullet points&quot;</pre><p>Now your code is clean:</p><pre>prompt = PromptHub.get(&quot;doc_summarizer_v3&quot;)<br>response = prompt.execute(context=document)</pre><p>Need to rollback?</p><pre>PromptHub.get(&quot;doc_summarizer_v3.2.0&quot;)</pre><p>Done. No archaeology required.</p><h3>2. Composable Prompt Templates</h3><p>Stop rewriting the same system prompt 20 times. Build prompts like you build functions — modular, reusable, composable.</p><pre># Define base templates<br>base_analyst = PromptTemplate(&quot;financial_analyst_base&quot;)</pre><pre># Extend and specialize<br>crypto_analyst = base_analyst.extend({<br>  &quot;domain&quot;: &quot;cryptocurrency&quot;,<br>  &quot;risk_tolerance&quot;: &quot;high&quot;,<br>  &quot;output_format&quot;: &quot;technical_report&quot;<br>})</pre><pre>equity_analyst = base_analyst.extend({<br>  &quot;domain&quot;: &quot;equities&quot;,<br>  &quot;risk_tolerance&quot;: &quot;conservative&quot;,<br>  &quot;output_format&quot;: &quot;executive_summary&quot;<br>})</pre><p>Now you have consistent behavior across specialized use cases. Change the base template, update everywhere instantly.</p><h3>3. Environment Management</h3><p>Dev, staging, prod. For prompts.</p><pre># Development - experiment freely<br>dev_prompt = PromptHub.get(&quot;doc_summarizer_v4-dev&quot;)</pre><pre># Staging - validate before production<br>staging_prompt = PromptHub.get(&quot;doc_summarizer_v4-staging&quot;)</pre><pre># Production - stable, tested version<br>prod_prompt = PromptHub.get(&quot;doc_summarizer_v3&quot;)</pre><p>Test new prompts without breaking production. Roll out gradually. Rollback instantly if something goes wrong.</p><p>You know, basic software engineering principles.</p><h3>4. A/B Testing and Experimentation</h3><p>Stop going with gut feel. Measure what actually works.</p><pre># Not this guesswork bullshit<br>prompt_v1 = &quot;Summarize this document&quot;<br>prompt_v2 = &quot;Create a concise summary&quot;<br># Which one&#39;s better? Who knows!</pre><pre># This<br>experiment = ABTest(<br>  variant_a=&quot;doc_summarizer_v3&quot;,<br>  variant_b=&quot;doc_summarizer_v4&quot;,<br>  metric=&quot;user_satisfaction&quot;,<br>  traffic_split=0.5<br>)</pre><pre># Let data decide<br>results = experiment.run(duration_days=7)<br>if results.winner == &quot;variant_b&quot;:<br>  PromptHub.promote(&quot;doc_summarizer_v4&quot;, to=&quot;production&quot;)</pre><p>Now you’re making data-driven decisions instead of arguing in Slack about which phrasing “feels” better.</p><h3>5. Multi-Provider Orchestration</h3><p>Don’t marry yourself to one provider. Route intelligently based on cost, speed, and quality.</p><pre>router = LLMRouter(<br>  rules=[<br>    # Simple tasks -&gt; cheap models<br>    Rule(<br>      if_tokens_less_than=1000, <br>      use=&quot;gpt-3.5-turbo&quot;<br>    ),<br>    <br>    # Complex reasoning -&gt; powerful models<br>    Rule(<br>      if_complex_reasoning=True, <br>      use=&quot;gpt-4&quot;<br>    ),<br>    <br>    # Cost-sensitive operations -&gt; efficient alternatives<br>    Rule(<br>      if_cost_sensitive=True, <br>      use=&quot;claude-haiku&quot;<br>    ),<br>  ],<br>  <br>  # Fallback chain for reliability<br>  fallback_chain=[&quot;gpt-4&quot;, &quot;claude-sonnet&quot;, &quot;llama-70b&quot;]<br>)</pre><pre>response = router.execute(prompt, context)</pre><p>Now you’re not held hostage by a single provider’s pricing, rate limits, or downtime.</p><h3>6. Observability and Analytics</h3><p>Track what actually matters. Not vibes.</p><pre>analytics = PromptAnalytics.get(&quot;doc_summarizer_v3&quot;)</pre><pre>print(f&quot;&quot;&quot;<br>Prompt Performance (Last 30 Days):<br>  Avg latency: {analytics.avg_latency}ms<br>  Token usage: {analytics.total_tokens:,}<br>  Success rate: {analytics.success_rate}%<br>  Cost per call: ${analytics.avg_cost}<br>  Total cost: ${analytics.total_cost:,}<br>&quot;&quot;&quot;)</pre><pre># Output:<br># Prompt Performance (Last 30 Days):<br>#   Avg latency: 847ms<br>#   Token usage: 2,450,000<br>#   Success rate: 98.3%<br>#   Cost per call: $0.023<br>#   Total cost: $1,840</pre><p>Now you can answer questions like:</p><ul><li>Which prompts are eating our budget?</li><li>Where are the latency bottlenecks?</li><li>What’s our actual success rate in production?</li></ul><p>Without analytics, you’re flying blind.</p><h3>7. Automated Testing and Validation</h3><p>Test prompts like you test code.</p><pre># Define test cases<br>test_suite = PromptTestSuite(&quot;doc_summarizer_v4&quot;)</pre><pre>test_suite.add_test(<br>  input=&quot;[long technical document]&quot;,<br>  expected_criteria=[<br>    &quot;summary_length &lt; 500 words&quot;,<br>    &quot;contains_key_terms([&#39;api&#39;, &#39;authentication&#39;, &#39;rate_limiting&#39;])&quot;,<br>    &quot;sentiment == &#39;neutral&#39;&quot;,<br>    &quot;has_bullet_points == True&quot;<br>  ]<br>)</pre><pre># Run tests before deployment<br>results = test_suite.run()<br>if results.pass_rate &lt; 0.95:<br>  raise Exception(&quot;Prompt failed validation&quot;)</pre><p>Catch regressions before they hit production. Validate that new model versions don’t break your prompts. Sleep better at night.</p><h3>The Real Cost of Prompt Engineering</h3><p>Let’s talk numbers.</p><p><strong>Scenario:</strong> You have 50 prompts in production across 10 services.</p><h3>With Prompt Engineering (Current State):</h3><ul><li><strong>Time to update one prompt:</strong> 2–4 hours (find all instances, test, deploy)</li><li><strong>Time for model migration:</strong> 2–3 weeks (test and update 50 prompts)</li><li><strong>Engineer hours wasted per month:</strong> 40–60 hours on prompt maintenance</li><li><strong>Production incidents:</strong> 3–5 per month from prompt inconsistencies</li><li><strong>Cost of one incident:</strong> $10k-50k in lost revenue/customer trust</li></ul><p><strong>Annual cost:</strong> ~$500k in engineering time + incident costs</p><h3>With Prompt Architecture:</h3><ul><li><strong>Time to update one prompt:</strong> 15 minutes (update once, deploy everywhere)</li><li><strong>Time for model migration:</strong> 2–3 days (systematic testing and rollout)</li><li><strong>Engineer hours on maintenance:</strong> 5–10 hours per month</li><li><strong>Production incidents:</strong> 0–1 per month (caught in staging)</li></ul><p><strong>Annual savings:</strong> ~$400k</p><p>And that’s just the direct cost. The real value is velocity — shipping features instead of firefighting prompts.</p><h3>The Mental Shift</h3><p>This isn’t about writing better prompts. It’s about treating AI as infrastructure.</p><p><strong>Prompt Engineering asks:</strong></p><ul><li>“How do I phrase this better?”</li><li>“What temperature should I use?”</li><li>“Should I add more examples?”</li></ul><p><strong>Prompt Architecture asks:</strong></p><ul><li>“How do I version and rollback prompts?”</li><li>“How do I test changes systematically?”</li><li>“How do I scale to 100+ prompts without chaos?”</li></ul><p>It’s the difference between being a craftsman and being an engineer.</p><h3>Why This Matters Now</h3><p>Models change constantly. GPT-4 to GPT-4-turbo broke prompts. GPT-4-turbo to GPT-4.5 broke more. GPT-5 will break even more.</p><p>If your entire AI infrastructure looks like this:</p><pre># 47 files with hardcoded prompts scattered everywhere<br>&quot;You are a helpful assistant...&quot;<br>&quot;You are a helpful assistant...&quot;  <br>&quot;You are a helpful assistant...&quot;</pre><p>You’re fucked when the next model drops.</p><p>But if it looks like this:</p><pre># One line that pulls from centralized, versioned, testable infrastructure<br>prompt = PromptHub.get(&quot;assistant_v4&quot;)</pre><p>You update once. Test systematically. Deploy confidently. Done.</p><h3>Here’s what you need to do:</h3><h4>1. Audit Your Current State</h4><ul><li>How many prompts do you have?</li><li>Where are they located?</li><li>Can you list them all right now?</li></ul><blockquote><strong>If the answer to #3 is “no,” you’re already in trouble.</strong></blockquote><h4>2. Establish a Single Source of Truth</h4><ul><li>Create a centralized prompt repository</li><li>Version everything</li><li>Make it the only place prompts live</li></ul><h4>3. Build Abstraction Layers</h4><ul><li>Wrap your LLM calls in a router</li><li>Support multiple providers from day one</li><li>Make provider switching a config change, not a code change</li></ul><h4>4. Implement Observability</h4><ul><li>Log every prompt execution</li><li>Track costs, latency, and success rates</li><li>Build dashboards so you can see what’s happening</li></ul><h4>5. Create Testing Infrastructure</h4><ul><li>Write tests for critical prompts</li><li>Validate behavior across model versions</li><li>Catch regressions before production</li></ul><h4>6. Adopt Environment Discipline</h4><ul><li>Dev/staging/prod for prompts</li><li>Test changes in isolation</li><li>Roll out gradually with the ability to rollback</li></ul><h3>The Companies That Will Win</h3><p>In 6 months, half the startups relying on prompt engineering will be dead.<br>Not because their prompts weren’t good enough.</p><p>Because they built their entire business on copy-paste and prayer.</p><p>The survivors? They built systems.</p><p>Your competitors aren’t winning because they write better prompts. They’re winning because while you’re tweaking sentences in ChatGPT, they’re shipping 10x faster with actual infrastructure.</p><p>Infrastructure beats iteration. Every single time.</p><p>The prompt engineering game is over. You either built infrastructure or you’re rebuilding from scratch every model update.</p><p>One group scales. The other drowns in technical debt.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=054aaadacf88" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Rebuilt Our ML Infrastructure to Handle 100M+ Daily Predictions]]></title>
            <link>https://theunblunt.medium.com/how-we-rebuilt-our-ml-infrastructure-to-handle-100m-daily-predictions-d2df8adbb3a1?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2df8adbb3a1</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 09:09:29 GMT</pubDate>
            <atom:updated>2024-11-07T09:09:29.021Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>ML Architecture Evolution: From Microservices to Scalable ML Systems</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8SDiaHkpFpQ7WrmKKd5MmA.png" /></figure><h3>Introduction</h3><p>When our team started building our product recommendation engine, we followed the standard advice: “Use microservices for flexibility and scalability.” Six months and $45K in technical debt later, we learned that conventional wisdom doesn’t always apply to ML systems.</p><p>This article details our journey from a simple microservice architecture to a robust ML system handling 100M+ daily predictions. More importantly, it explains why common software architecture patterns might not be the best fit for ML systems.</p><h3>The Initial Architecture</h3><p>Our first architecture was what you’d expect from any modern application:</p><pre># Initial FastAPI service<br>from fastapi import FastAPI<br>from transformers import RecommenderModel<br><br>app = FastAPI()<br>model = RecommenderModel()<br><br>@app.post(&quot;/predict&quot;)<br>async def get_recommendations(user_id: str):<br>    user_features = await get_user_features(user_id)<br>    recommendations = model.predict(user_features)<br>    return {&quot;recommendations&quot;: recommendations}</pre><p>Simple, clean, and followed all the microservice best practices. But it had several hidden problems:</p><ol><li><strong>Cold Starts</strong>: Every new instance loaded the model from scratch</li><li><strong>Resource Utilization</strong>: Idle instances still consumed full memory</li><li><strong>Data Freshness</strong>: Features were often stale</li><li><strong>Scaling Issues</strong>: Linear resource scaling with request volume</li></ol><h3>The Evolution</h3><h3>1. Request Handling Layer</h3><p>The first major change was splitting read and write paths:</p><pre># Separated read/write paths with batching<br>from typing import List<br>from fastapi import FastAPI, BackgroundTasks<br>from pydantic import BaseModel<br><br>app = FastAPI()<br>batch_processor = BatchProcessor()<br><br>class PredictionRequest(BaseModel):<br>    user_id: str<br>    context: dict<br><br>@app.post(&quot;/predict/batch&quot;)<br>async def batch_predictions(requests: List[PredictionRequest]):<br>    # Handle batch of requests<br>    batch_id = batch_processor.queue_batch(requests)<br>    return {&quot;batch_id&quot;: batch_id}<br><br>@app.get(&quot;/predict/{batch_id}&quot;)<br>async def get_batch_results(batch_id: str):<br>    # Retrieve batch results<br>    results = batch_processor.get_results(batch_id)<br>    return results<br><br>@app.post(&quot;/predict/realtime&quot;)<br>async def realtime_predict(request: PredictionRequest):<br>    # Priority queue for realtime requests<br>    if is_priority_user(request.user_id):<br>        return await realtime_processor.predict(request)<br>    return await batch_processor.quick_predict(request)</pre><p>Key improvements:</p><ul><li>Batch processing for efficiency</li><li>Priority queuing for important requests</li><li>Circuit breakers for system protection</li></ul><h3>2. Prediction Layer</h3><p>The biggest performance gain came from intelligent caching:</p><pre># Intelligent caching layer<br>from functools import lru_cache<br>from redis import Redis<br>from typing import List, Dict<br><br>class PredictionCache:<br>    def __init__(self):<br>        self.redis = Redis()<br>        self.local_cache = {}<br>        <br>    @lru_cache(maxsize=10000)<br>    def get_cached_prediction(self, user_id: str, context: Dict):<br>        # Try local cache<br>        cache_key = f&quot;{user_id}:{hash(str(context))}&quot;<br>        if cache_key in self.local_cache:<br>            return self.local_cache[cache_key]<br>            <br>        # Try Redis cache<br>        cached = self.redis.get(cache_key)<br>        if cached:<br>            self.local_cache[cache_key] = cached<br>            return cached<br>            <br>        # Generate new prediction<br>        prediction = self.generate_prediction(user_id, context)<br>        <br>        # Cache with appropriate TTL<br>        ttl = self.calculate_ttl(user_id, context)<br>        self.redis.setex(cache_key, ttl, prediction)<br>        self.local_cache[cache_key] = prediction<br>        <br>        return prediction<br>        <br>    def calculate_ttl(self, user_id: str, context: Dict) -&gt; int:<br>        # Dynamic TTL based on user behavior and context<br>        base_ttl = 3600  # 1 hour<br>        if is_active_user(user_id):<br>            base_ttl = 1800  # 30 minutes<br>        if is_high_volatility_context(context):<br>            base_ttl = 300  # 5 minutes<br>        return base_ttl</pre><p>This caching system provided:</p><ul><li>Multi-level caching (local + Redis)</li><li>Dynamic TTL based on user behavior</li><li>Pre-computation for popular items</li><li>Intelligent cache invalidation</li></ul><h3>3. Data Processing Layer</h3><p>Event-driven processing transformed our data freshness:</p><pre># Event-driven data processing<br>from pydantic import BaseModel<br>from typing import List, Optional<br><br>class FeatureStore:<br>    def __init__(self):<br>        self.feature_validators = {}<br>        self.quality_gates = {}<br>        <br>    async def process_event(self, event: Dict):<br>        # Process events as they arrive<br>        features = self.extract_features(event)<br>        if self.validate_features(features):<br>            await self.update_features(features)<br>            await self.trigger_recomputation(features)<br>    <br>    def validate_features(self, features: Dict) -&gt; bool:<br>        # Data quality gates<br>        for feature, value in features.items():<br>            if feature in self.quality_gates:<br>                if not self.quality_gates[feature](value):<br>                    log_quality_issue(feature, value)<br>                    return False<br>        return True<br>        <br>    async def update_features(self, features: Dict):<br>        # Incremental feature updates<br>        for feature, value in features.items():<br>            await self.feature_store.update(<br>                feature_name=feature,<br>                value=value,<br>                timestamp=datetime.now()<br>            )<br>            <br>    async def trigger_recomputation(self, features: Dict):<br>        # Trigger async model updates if needed<br>        affected_models = self.get_affected_models(features)<br>        for model in affected_models:<br>            await self.model_updater.queue_update(model)</pre><p>This approach enabled:</p><ul><li>Real-time feature updates</li><li>Data quality monitoring</li><li>Incremental model updates</li><li>Feature freshness tracking</li></ul><h3>The Counter-Intuitive Learnings</h3><h3>1. Fewer Services, Better Performance</h3><p>Instead of having separate services for every function, we consolidated into three main components:</p><ul><li>Request Handler</li><li>Prediction Engine</li><li>Data Processor</li></ul><p>This reduced network hops, simplified monitoring, and improved reliability.</p><h3>2. Caching &gt; Computational Optimization</h3><p>We spent weeks optimizing our model inference before realizing that intelligent caching would give us better results with less complexity.</p><h3>3. Data Flow &gt; Service Architecture</h3><p>Focus on optimizing how data moves through your system rather than how code is organized into services.</p><h3>Performance Metrics</h3><p>Before and after comparison:</p><pre>| Metric            | Before  | After   | Improvement |<br>|-------------------|---------|---------|-------------|<br>| Latency (p95)     | 2000ms  | 150ms   | 92.5%       |<br>| Cost per prediction | $0.001 | $0.0001 | 90%         |<br>| System uptime     | 99.9%   | 99.99%  | 0.09%       |<br>| Data freshness    | 4 hours | 5 minutes | 98%       |</pre><ol><li><strong>Start Simple</strong></li></ol><ul><li>Begin with a monolith</li><li>Identify bottlenecks through monitoring</li><li>Split only what causes problems</li></ul><p><strong>2. Cache Strategically</strong></p><ul><li>Implement multi-level caching</li><li>Use dynamic TTLs</li><li>Pre-compute popular predictions</li></ul><p><strong>3. Monitor Everything</strong></p><ul><li>Track business metrics</li><li>Monitor data quality</li><li>Set up alerting for degradation</li></ul><p><strong>4. Build Fallbacks</strong></p><ul><li>Implement degraded service modes</li><li>Have backup prediction strategies</li><li>Design for failure</li></ul><h3>Conclusion</h3><p>The microservices architecture pattern, while excellent for many applications, isn’t always the best fit for ML systems. The key is to understand your specific requirements and constraints, then design accordingly.</p><p>Remember:</p><ol><li>Complex problems don’t always need complex solutions</li><li>Focus on data flow over service boundaries</li><li>Cache aggressively, update lazily</li><li>Build fallbacks before optimizations</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2df8adbb3a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does monk mode work?]]></title>
            <link>https://theunblunt.medium.com/does-monk-mode-work-d1336d1e3da0?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1336d1e3da0</guid>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[mindset-shift]]></category>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[mindfulness]]></category>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Sat, 20 Apr 2024 12:09:57 GMT</pubDate>
            <atom:updated>2024-04-20T12:09:57.131Z</atom:updated>
            <content:encoded><![CDATA[<p>In the modern world of distractions, what can be categorized as a “Monk”?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tdqqDwCOLACUiVTpupvkMw.jpeg" /><figcaption>AI-Generated (ChatGPT — 4)</figcaption></figure><p><strong>Caution — Rant is coming.</strong></p><p>I woke up one morning and decided I would leave all my vices and bad habits just today and today itself. I will live my life as a monk for the next 6 months without fucking my schedule and will be disciplined.</p><p>But what happened? I couldn’t maintain it for more than a week. phew!</p><p><strong>I even ended up procrastinating on this article for about 14 days.</strong></p><blockquote>It turns out a monk doesn’t focus on the distractions to be removed but rather focuses on living with them without affecting him or her.</blockquote><p>Everyone has their way of being a monk. You have different consciousness and each consciousness requires a different engineering to tap into a monk mode.</p><p>You have lived in a different environment, family, financial status, and romantic relationships, and consumed different food, and if we combine all of it and create a concoction we have an entity called “consciousness”.</p><p>Just a little about myself, I grew up with 6 cousins and 1 sister so from my childhood I always had good negotiation skills which led to the following foundational principle for me —</p><blockquote>Before forming an opinion try not to give a fuck.</blockquote><p>No, No I am not trying to short-sell <a href="https://twitter.com/iammarkmanson"><strong>Mark Manson</strong></a> here. Or maybe I am. But let me explain what I meant by that.</p><p>Say, you wake up one morning and decide to start a new morning routine — meditation, cold shower, journaling, the whole fucking circus. But after a couple of days, you find yourself saying “fuck it,” hitting snooze and scrolling through shitty memes instead.</p><p>Before beating yourself up about it, take a goddamn step back and remember that habit change is a motherfucking bitch-ass bastard. Laugh it off, scream into a pillow, and keep unfucking your routine until you find a groove that sticks.</p><p>Here’s the thing: trying to live like a monk in this clusterfuck of a modern world is like trying to put out a dumpster fire with your tears. It’s not about achieving some perfect, distraction-free Nirvana — it’s about learning to surf the shitstorm with something resembling grace and humor.</p><p>So, does monk mode work? Fuck if I know, man. What I do know is that the journey of unfucking yourself is a long, weird, messy one, full of detours, relapses, and facepalm.</p><blockquote>But if you can learn to not take your own bullshit too seriously, to laugh at your weakness, and keep getting back up no matter how many times you faceplant, you might just find your own fucked-up version of enlightenment.</blockquote><p>It’s not about becoming some serene, untouchable being. It’s about being a flawed, struggling, beautiful disaster of a human, and being okay with that. It’s about letting go of the death grip of perfectionism and learning to ride the waves of your own ridiculous, glorious existence.</p><p>So, keep meditating, keep journaling, keep doing whatever weird monk shit works for you. But more importantly, keep laughing, keep forgiving yourself, and keep moving forward, one fucked-up step at a time.</p><p><strong>Because in the end, we’re all just stumbling through this absurd circus called life</strong>, trying to find our way to be at peace with the chaos. And if you can do that while still giving a flying fuck about the important shit, well, you might just be the most badass monk on the whole damn planet.</p><p>So go forth, you beautiful fucking disasters. Embrace the mess, and unfuck yourselves with reckless abandon. The monastery of life awaits, and it’s one wild-ass ride.</p><p>Peace out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1336d1e3da0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating SaaS Machine Learning Solution with RAG Pipelines — Part 1 [Week 1]]]></title>
            <link>https://theunblunt.medium.com/creating-saas-machine-learning-solution-with-rag-pipelines-part-1-week-1-837cda657842?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/837cda657842</guid>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[llamaindex]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 04:14:01 GMT</pubDate>
            <atom:updated>2024-03-05T04:14:50.193Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating SaaS Machine Learning Solution with RAG Pipelines — Part 1 [Week 1]</h3><p>Unlocking Advanced Natural Language Processing Capabilities for Businesses</p><p>If you are a developer, it doesn’t matter what stack is yours it’s improbable that you haven’t heard about LLMs.So, why don’t we start making something cool out of it? Shall we?</p><p>In this series, I will be coding 4 SaaS applications. And, this series will going to last for the next 30 days.</p><p>You can keep tracking this repository for the reference -</p><p><a href="https://github.com/Akshay594/SaaS-LLM">https://github.com/Akshay594/SaaS-LLM</a></p><p>Tech-stack I will be using throughout this series -</p><ol><li>Python FastAPI</li><li>React.js</li><li>LLamaindex</li><li>Langchain</li><li>AWS Services for hosting it</li><li>A SaaS domain name</li></ol><p>So, we will gonna go from setting up the backend along with the front end. And, we will deploy this entire application with the help of AWS services.</p><p>Let’s first decide what business problem we want to solve with this SaaS app.</p><h3>Objective -</h3><blockquote><em>We will create a SaaS application that will help us manage student data across the university’s database.</em></blockquote><blockquote><em>We will be able to automate queries such as shooting emails to students with prompts to let them know where they have excelled in an exam and where they have lacked.</em></blockquote><p>Here is the sample data from Kaggle I downloaded from the following link — <a href="https://www.kaggle.com/datasets/rohithmahadevan/students-marksheet-dataset">https://www.kaggle.com/datasets/rohithmahadevan/students-marksheet-dataset</a></p><pre>Name	Gender	Age	Section	Science	English	History	Maths<br>Bronnie	Female	13	C	21	81	62	49<br>Lemmie	Male	15	B	29	41	17	40<br>Danya	Female	14	C	12	87	16	96<br>Denna	Female	14	B	15	53	82	33<br>Jocelin	Male	14	A	43	6	3	21<br>Malissa	Female	14	C	98	51	85	76<br>Ichabod	Female	14	B	38	74	54	60<br>Corrine	Male	15	A	39	16	22	49<br>Tate	Male	15	C	35	25	37	27</pre><p>I know there are a bunch of tutorials on the internet that may or may not cover this topic but I had hard luck finding those so here I am! Making one for my mental clarity.</p><p>In this section, we will set the class for an RAG pipeline that can be ingested with structured and unstructured data with the help of llama-index.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RrfCyXNqUn19ZhyH.png" /></figure><p>Let’s get to the coding now. But first, we need to understand how exactly the llama-index helps you to ingest data and enable you to talk to it.</p><p>There are four stages in the llama-index RAG pipeline -</p><ol><li>Load the data</li><li>Indexing the data</li><li>Storing the indexed values</li><li>Querying the data</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GWJ41aJ56KdqRH-1.png" /></figure><h3>Loading the data -</h3><p>To query the data, we need the data. For reading the data we need connectors or readers for different types of data such as structured, unstructured, image data, audio spectrograms, etc.</p><p>We will start with a very basic one here which is CSV or EXCEL files. So, throughout the series,</p><p>we will use <a href="https://www.kaggle.com/datasets/rohithmahadevan/students-marksheet-dataset">https://www.kaggle.com/datasets/rohithmahadevan/students-marksheet-dataset</a></p><p>You can download the data from there and get ready for the next steps.</p><p>Now let’s start building the class that would accept a folder path with data in it.</p><pre>from llama_index.core import SimpleDirectoryReader</pre><pre>class StudentAgent:<br>    def __init__(self, file_path:str) -&gt; None:<br>        reader = SimpleDirectoryReader(input_dir=file_path)<br>        self.documents = reader.load_data()<br>        print(f&quot;Document has been loaded from : {file_path} folder.&quot;)<br>    <br></pre><pre>agent = StudentAgent(&quot;data&quot;)</pre><p>And, that’s how my setup looks like with data and app.py</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C2mslnug92M0qWg5.png" /></figure><p>It’s the basic set that we have done so far! Let’s index this data and start querying it already.</p><blockquote><em>What is Indexing?<br>Indexing in LLMs turns text into numbers to find information quickly and accurately.</em></blockquote><p>Let’s imagine you want to find information about “cat” in a sentence.</p><p>We’ll use the simple indexed sentence: “The cat sat on the mat,” where each word is represented by a single number.</p><p>Indexed Sentence:</p><ol><li><strong>The</strong> — [0.1]</li><li><strong>cat</strong> — [0.8]</li><li><strong>sat</strong> — [0.4]</li><li><strong>on</strong> — [0.2]</li><li><strong>the</strong> — [0.1]</li><li><strong>mat</strong> — [0.7]</li></ol><p>To find info about “cat” in a sentence with each word turned into a number, like “cat” = [0.8], we look for the number [0.8] in our list.</p><p>If you ask, “Where did the cat sit?”, the model sees [0.8] and quickly finds the sentence about “cat” to answer your question. This way, it easily spots the right info using numbers.</p><pre>from llama_index.core import SimpleDirectoryReader, VectorStoreIndex<br>import os</pre><pre>os.environ[&quot;OPENAI_API_KEY&quot;] = &quot;YOUR_OPEN_API_KEY&quot;</pre><pre>class StudentAgent:<br>    def __init__(self, file_path:str) -&gt; None:<br>        reader = SimpleDirectoryReader(input_dir=file_path)<br>        self.documents = reader.load_data()<br>        self.index = None<br>        print(f&quot;Document has been loaded from : {file_path} folder.&quot;)</pre><pre>    def make_index(self):<br>        self.index = VectorStoreIndex.from_documents(self.documents)<br>        print(&quot;Index has been made: &quot;, self.index)<br>    <br></pre><pre>agent = StudentAgent(&quot;data&quot;)<br>agent.make_index()</pre><p>After running the file with the `python app.py` command you should see the following output on your terminal.</p><pre>Document has been loaded from : `data` folder.<br>Index has been made:  &lt;llama_index.core.indices.vector_store.base.VectorStoreIndex object at 0x14ba92f50&gt;</pre><p>Next would be to query this index that we have created from the loaded documents.</p><pre>from llama_index.core import SimpleDirectoryReader, VectorStoreIndex<br>import os</pre><pre>os.environ[&quot;OPENAI_API_KEY&quot;] = &quot;YOUR_OPEN_API_KEY&quot;</pre><pre>class StudentAgent:<br>    def __init__(self, file_path:str) -&gt; None:<br>        reader = SimpleDirectoryReader(input_dir=file_path)<br>        self.documents = reader.load_data()<br>        self.index = None<br>        print(f&quot;Document has been loaded from : `{file_path}` folder.&quot;)</pre><pre>    def make_index(self):<br>        self.index = VectorStoreIndex.from_documents(self.documents)<br>        print(&quot;Index has been made: &quot;, self.index)</pre><pre>    def make_query(self, query):<br>        query_engine = self.index.as_query_engine()<br>        return query_engine.query(query)<br>    <br></pre><pre>agent = StudentAgent(&quot;data&quot;)<br>agent.make_index()<br>response = agent.make_query(&quot;Tell me about this data.&quot;)<br>print(response)</pre><p>You should be seeing the following output -</p><pre>Document has been loaded from : `data` folder.<br>Index has been made:  &lt;llama_index.core.indices.vector_store.base.VectorStoreIndex object at 0x12d49bf90&gt;<br>This data appears to be a collection of student information and their corresponding marks or grades. Each entry includes details such as student ID, name, gender, age, grade, and marks in different subjects. The data seems to be structured in a CSV format with rows representing individual students and columns representing different attributes.</pre><p>Okay, this seems fine. But can we run any data anylsis over it? Let’s try -</p><pre>agent = StudentAgent(&quot;data&quot;)<br>agent.make_index()<br>response = agent.make_query(&quot;How many students do we have in the data?&quot;)<br>print(response)</pre><p>We get the following output -</p><pre>There are 50 students in the data.</pre><p>This is certainly not true since we have 250 students in our data. So, let’s address this issue in our next article.</p><p>Thanks,</p><p>Gopal</p><p>If you like my work then please subscribe to my newsletter on substack!</p><p>https://gopalsingh.substack.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=837cda657842" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do you stay motivated?]]></title>
            <link>https://theunblunt.medium.com/how-do-you-stay-motivated-38cb969fa3f?source=rss-2dee69782f4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/38cb969fa3f</guid>
            <category><![CDATA[bahubali]]></category>
            <category><![CDATA[motivational]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[movies]]></category>
            <dc:creator><![CDATA[Gopal Singh]]></dc:creator>
            <pubDate>Thu, 28 Apr 2022 18:12:49 GMT</pubDate>
            <atom:updated>2022-04-28T18:12:49.452Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s decipher this mystery with Mahendra Bahubali :)</p><p>Suppose you have been thinking about reaching the peak of a mountain like this guy. This is your goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*rSoOmVxuxtMYPUyS" /></figure><p>But every time you try to surmount the mountain, you fail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*RsJStjFWSrMiaGOq" /></figure><p>After tolling for years you got a clue what could be up there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*E6CMqKm4YBfpLnNf" /></figure><p>You try to put your some imagination and now you are more excited to go. Because destiny looks more beautiful now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*qR6cRwMo1WPMRkhZ" /></figure><p>Now you have a stronger reason to surmount it so you give it another shot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*fVK1UWWbVenbq4tA" /></figure><p>And finally, pass the first barrier to surmount the mountain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*Pw6FdEijmhKbE3g8" /></figure><p>Now, It’s just the beginning for you to surmount the mountain, even in your sleep, you can’t resist thinking about it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*mVmmjLRYBLzdXG90" /></figure><p>You again wake up, start working for it, chasing it, madly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*RF1e_iTP6SSrCPO5" /></figure><p>You are doing great and reached a point where you could fail with one wrong step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*pfh-itMQYnthKs90" /></figure><p>Unfortunately, even after your best efforts, you fail and reached a dark pit where everything seems blue and gloomy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*CrW28ez0Rjwec9d-" /></figure><p>You are now a bit disappointed and a little unmotivated to put in any effort. But again, you can’t stop thinking about your goal and give it another try.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*jGIEqyfmWBXPIpPK" /></figure><p>You have reached a point where either you will begin everything from start or will achieve your goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*isI13rn79RctgMsv" /></figure><p>Now you need to be more concentrated and focused than ever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*2lOhLzPvJJMRq9gT" /></figure><p>You take your final shot while only aiming for achieving your goal and not thinking about winning or losing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*PUKiOMhgiqila8Gt" /></figure><p>With hard work and a little luck, you managed to achieve it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*173Mu2qjM6gOcHox" /></figure><p><strong>BUT, </strong>when you have finally reached the peak of the mountain that you have dreamt of for a long time, you realize your goal was just an illusion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*C0fsrkW9VzQ-WrBw" /></figure><p>The Journey just has begun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*_6t-UIsCIIWz2JwW" /></figure><p><strong>Time for the next goal?</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38cb969fa3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>