<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>सतत (Posts about llm)</title><link>https://baali.muse-amuse.in/</link><description></description><atom:link href="https://baali.muse-amuse.in/categories/llm.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:baali@muse-amuse.in"&gt;शांतनु&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-bottom:12px;"
src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"&gt;&lt;/a&gt;</copyright><lastBuildDate>Fri, 07 Aug 2026 12:27:37 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Good, the Bad, the Ugly</title><link>https://baali.muse-amuse.in/posts/the-good-the-bad-the-ugly.html</link><dc:creator>शांतनु</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;
“I don't want whatever I want. Nobody does. Not really. What kind of
fun would it be if I just got everything I ever wanted just like that,
and it didn't mean anything? What then?”
&lt;/p&gt;

&lt;p&gt;
— Coraline
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div id="outline-container-org6affee3" class="outline-2"&gt;
&lt;h2 id="org6affee3"&gt;The Good:&lt;/h2&gt;
&lt;div class="outline-text-2" id="text-org6affee3"&gt;
&lt;p&gt;
LLMs are powerful. There are many novel ways of harnessing them. I got
Claude implement a feature that I don't think I could have done myself
within the time and budget constraints.
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;&lt;b&gt;Task&lt;/b&gt;&lt;/b&gt;: Implement AirPlay sender to allow ESP32-based &lt;a href="https://www.moodblocks.com/products/moodplay"&gt;MoodPlay&lt;/a&gt; to
stream content to any AirPlay compatible speaker.
&lt;/p&gt;

&lt;p&gt;
I was able to use &lt;a href="https://pyatv.dev/"&gt;pyatv&lt;/a&gt; from my Linux machine to AirPlay an MP3 file
to a HomePod mini. But if I targeted a Sonos speaker there was no
audio. The Sonos app showed that it was playing something.
&lt;/p&gt;

&lt;p&gt;
I had a starting point: an Open-source reference that worked and I
wanted to reproduce it with an ESP32. I created a sandboxed
environment for Claude on a Raspberry Pi4. I cloned repositories for
the reference, connected an ESP32-S3-DevKitC-1 to it, and set up
esp-idf so that Claude could flash the firmware and let it cook
(&lt;code&gt;--dangerously-skip-permissions&lt;/code&gt;). It took some time and lots of
tokens but eventually I got the music streaming on HomePod mini.
&lt;/p&gt;

&lt;p&gt;
Next step: get the AirPlay working with Sonos. I did some digging
around. I was able to use AirPlay from an iOS device to Sonos. I
captured the metadata from the speaker and added it to the CLAUDE.md
file. Further, there is (audio) media server project, &lt;a href="https://owntone.github.io/owntone-server/"&gt;OwnTone,&lt;/a&gt; that
allows streaming local media using AirPlay. Claude confirmed that
using OwnTone it was able to stream the content to Sonos. Again we got
a functioning open source reference that Claude was able to port to
ESP32. &lt;b&gt;&lt;b&gt;Nicely done&lt;/b&gt;&lt;/b&gt;.
&lt;/p&gt;

&lt;p&gt;
In the end it was ~2600 lines of portable C. It is a prototype to
validate the idea and showcase a working setup/demo. I learned a lot
about setting up tools for Claude and letting it work: &lt;b&gt;&lt;b&gt;the
Good&lt;/b&gt;&lt;/b&gt;. That was the goal of the project: can we harness Claude for
this? But, I have zero understanding of the code itself. If there's a
bug in the code, I won't have any clue where to start debugging. And
that is a problem.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;div id="outline-container-org2eb7c02" class="outline-2"&gt;
&lt;h2 id="org2eb7c02"&gt;The Bad:&lt;/h2&gt;
&lt;div class="outline-text-2" id="text-org2eb7c02"&gt;
&lt;p&gt;
This experience is from another project: &lt;a href="https://takearast.com/"&gt;Rast&lt;/a&gt;. I am using a PN532 NFC
module to read NFC cards with a Raspberry Pi:
&lt;/p&gt;


&lt;div id="org45e701d" class="figure"&gt;
&lt;p&gt;&lt;img src="https://baali.muse-amuse.in/galleries/NFC.webp" alt="nil"&gt;
&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;
I have one working unit for myself and I am remotely setting up
another one in &lt;a href="https://motionlab.berlin/"&gt;Motionlab Berlin&lt;/a&gt;. This NFC board supports three
communication modes— I2C, UART and SPI — and the mode is set using
jumper pins. I had it working locally and I was struggling to get the
same working on the remote setup. I could see the device under &lt;code&gt;/dev&lt;/code&gt;
, enabled the communication mode on RPi (&lt;code&gt;config.txt&lt;/code&gt;), and confirmed
the connection, but when I tried to read a card, it wouldn't
work. With support from &lt;a href="https://www.felixchristmann.com/"&gt;Felix&lt;/a&gt;, I kept on trying different modes but
without success. I shared images of my working RPi, logs, and errors
with Claude but beyond changing modes there was no progress. Claude
was now suggesting that I shift kernel branches:
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;
The real fix — downgrade the kernel on the broken Pi
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
Look at the confidence of that phrasing: ugh. I started talking to
Felix and going through the wiring. Turns out I was using 5V for
&lt;code&gt;VCC&lt;/code&gt; on my system and Felix was using 3V. We switched to 5V and
voila, it worked. UART &lt;b&gt;&lt;b&gt;NEEDS&lt;/b&gt;&lt;/b&gt; a 5V VCC connection and SPI works
with 3V.
&lt;/p&gt;

&lt;p&gt;
Claude was helpful with testing additional commands and configs that I
was not aware of. But I also had some sense of when not to trust its
recommendation and keep doing what I was doing. Its confidence and
hallucinations were very telling: &lt;b&gt;&lt;b&gt;the Bad&lt;/b&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;


&lt;div id="outline-container-orgecade70" class="outline-2"&gt;
&lt;h2 id="orgecade70"&gt;The Ugly:&lt;/h2&gt;
&lt;div class="outline-text-2" id="text-orgecade70"&gt;
&lt;p&gt;
This is from a third project that is putting together a data pipeline
and a user-facing dashboard built with &lt;a href="https://www.draxlr.com/"&gt;Draxlr&lt;/a&gt;. The dashboard graph
runs SQL queries and plots the result. The dashboard feature PR was
created using an LLM and I was reviewing it. The changeset was 1390
lines of SQL (&lt;b&gt;&lt;b&gt;the Ugly&lt;/b&gt;&lt;/b&gt;):
&lt;/p&gt;


&lt;div id="org121f85f" class="figure"&gt;
&lt;p&gt;&lt;img src="https://baali.muse-amuse.in/galleries/changeset.png" alt="nil"&gt;
&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;
Review is a strong word. I tested it. Ran a bunch of queries
independently. Got an overall sense of how they contributed to the
dashboard and "approved" the PR with a comment that we should also
monitor the load on the postgres server when we visit the dashboard.
&lt;/p&gt;

&lt;p&gt;
After a few days, there was a &lt;code&gt;bugfix&lt;/code&gt; PR, from Claude:
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHEN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;er_kg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;THEN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;er_kg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ELSE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)::&lt;/span&gt;&lt;span class="nb"&gt;numeric&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;"CO₂ Avoided (kg)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;NULLIF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ROUND&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHEN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;er_kg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;THEN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;er_kg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ELSE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)::&lt;/span&gt;&lt;span class="nb"&gt;numeric&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;"CO₂ Avoided (kg)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;
context: this query calculates the CO₂ emissions avoided. In the
original statement, &lt;code&gt;CASE WHEN er_kg &amp;gt; 0 THEN er_kg ELSE 0 END&lt;/code&gt; folds
a &lt;code&gt;NULL&lt;/code&gt; &lt;code&gt;er_kg&lt;/code&gt; — i.e missing data — into 0. that's a bug. Missing
data reads as &lt;i&gt;zero emissions avoided&lt;/i&gt;, when the dashboard should show
&lt;code&gt;NULL&lt;/code&gt; or &lt;code&gt;NA&lt;/code&gt; to say that data is missing.
&lt;/p&gt;

&lt;p&gt;
Claude's bugfix wrapped the sum in &lt;code&gt;NULLIF(..., 0)&lt;/code&gt;, so a total of 0
comes back as &lt;code&gt;NULL&lt;/code&gt;. It produces the right output, buts it's a patch
on the symptom rathen than a fix of the cause..
&lt;/p&gt;

&lt;p&gt;
I looked up the &lt;a href="https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-CASE"&gt;&lt;code&gt;CASE&lt;/code&gt;&lt;/a&gt; statement:
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;
If the ELSE clause is omitted and no condition is true, the result is null.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
Delete the &lt;code&gt;ELSE 0&lt;/code&gt; and the &lt;code&gt;CASE&lt;/code&gt; returns &lt;code&gt;NULL&lt;/code&gt; for the missing row
on its own; &lt;code&gt;SUM&lt;/code&gt; skips &lt;code&gt;NULL&lt;/code&gt; — the exact behavior we want. Claude
had a better fix within one deletion, but it doubled down on its idea
and instead of re-reading the statement. It took me a moment to
realize this and I kept doubting myself. I ran a bunch of queries,
confirmed things and followed up with the "requested changes" to the
bugfix PR.
&lt;/p&gt;

&lt;p&gt;
It is very easy to fall into this trap and click "Approve" on a
PR. The LLM is delivering the functionality but I should really know
my craft to be able to discern their outputs. And in the first case I
mentioned I have no clue if the implementation is bad.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;div id="outline-container-org2aa597d" class="outline-2"&gt;
&lt;h2 id="org2aa597d"&gt;Concluding point:&lt;/h2&gt;
&lt;div class="outline-text-2" id="text-org2aa597d"&gt;
&lt;p&gt;
In his book &lt;i&gt;Skin in the game&lt;/i&gt;, Nassim bhai talks about the Greek
phrase "Pathemata mathemata" — learning through pain. For me the pain
is learning by debugging. With Claude and other LLM tools I have a
feeling that I am getting away from that exercise and becoming
complacent.
&lt;/p&gt;

&lt;p&gt;
I'm not disciplined; I procrastinate and I rely on 'last-minute panic'
mode.
&lt;/p&gt;


&lt;div id="org5e3e825" class="figure"&gt;
&lt;p&gt;&lt;img src="https://baali.muse-amuse.in/galleries/last-minute.png" alt="nil"&gt;
&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;
Again, with LLM tools, I am leaning into my worst instincts. I rely on
them to build a feature within limited time and budget, and I end up
not learning or growing. There is an existential crises dimension to
all this too, If the any and all features can be done by these LLMs,
what am I for? Do I really want that? I think I got lucky catching
Claude's mistake with the query. I can't be a mere &lt;a href="https://gruhn.me/blog/2026-08-03/"&gt;meat proxy&lt;/a&gt; and I
want to be an active human in the loop. As these tools get more
powerful, I have to stay sharp, I don't know how yet, but that's the
only way I'll survive as a programmer.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;</description><category>databases</category><category>embedded</category><category>llm</category><category>python</category><category>tools</category><guid>https://baali.muse-amuse.in/posts/the-good-the-bad-the-ugly.html</guid><pubDate>Sat, 01 Aug 2026 09:55:21 GMT</pubDate></item></channel></rss>