llm
Technical notes on web development, DevOps, and AI integration.
23 articles
- 12:32backend
I Almost Deleted My Cache One Key at a Time
Mass-deleting Redis keys felt right until I read the docs. Versioned keys with INCR bumps make stale chat answers unreachable instead.
TL;DR: Editing an article left the Redis-cached AI answers stale, and the author's first fix—scanning and deleting every ask: key—turned out to solve the wrong problem. SCAN is non-blocking; the real pain is tracking key families across workers forever. Versioned keys fix it: bake versions into key names, bump with INCR on edits, and let TTL clean up.
#redis#caching#cache-invalidation - 19:31ai
My AI Found an Angle, Then Made Up a Stat
The chat surfaced a valid new angle and one unverifiable statistic. Finding angles and proving claims are different jobs; only one of them belongs to the chat.
TL;DR: An AI chat surfaced a genuinely new research angle, but then invented a stat attributed to Stanford HAI that couldn't be verified anywhere. The lesson: finding angles and proving claims are separate jobs, so the pipeline now asks AI for angles, then opens every primary source manually. Citations offer traceability, not truth; walking the trail is your job.
#ai-agents#llm#automation - 00:40ai
Skills, Memory, Pipelines: AI Agent Terms That Won't Rot
A plain-language glossary of AI agent terms from primary sources: agent vs workflow, skills, three kinds of memory, RAG, and pipelines.
TL;DR: Agents decide their own next steps while workflows run on fixed code paths, and the distinction comes down to who holds the steering wheel. Skills are procedural SOP files loaded only when needed, unlike memory, which carries procedural, semantic, or episodic information across sessions. Pipelines add triggers, gates, and watchdogs to make autonomous agents trustworthy.
#ai-agents#llm#automation - 21:07ai
The Most-Used Coding Model Is Not the Benchmark King
OpenCode's usage board is led by cheap open models, not benchmark kings. How I read usage, retention, and price before switching models.
TL;DR: Benchmark leaders like GPT-5.6 top SWE-Bench, yet deepseek-v4-flash leads OpenCode's real-world usage, suggesting cost, speed, and context length matter more than peak scores. The author recommends checking usage volume, momentum, and weekly retention as satisfaction signals. Treat official model lists as a starting point, then validate against usage data and a small trial in your own repo before committing.
#llm#benchmark#deepseek - 02:49frontend
The Chat DOM Only Holds Half the Answer
Scraping an AI chat answer from the DOM gets you half of it. The full text lives behind the Copy button, plus a strict output contract.
TL;DR: Chat UIs use virtualization, so most of the AI's answer never exists in the DOM and scrolling won't load it. The fix layers a Copy-button click to read the clipboard, an accessibility tree snapshot, and innerText as fallbacks. The real win: define an output contract upfront — code block plus sentinel marker — so scraping becomes deterministic.
#automation#playwright#llm - 02:31ai
My Cron Pipeline Drafts Through a Browser, With Local Backup
Free Qwen chat via Playwright is now the primary draft engine for my article cron, with a local router9 fallback wired like a circuit breaker.
TL;DR: The author scrapes Qwen's free web chat via Playwright, copying answers from the clipboard since virtualized DOM rendering hides long replies. Knowing free tiers die without notice, a circuit breaker routes to local router9 after two failures, giving genuinely separate failure domains. The bet isn't that scraping lasts, just that the pipeline keeps running when it doesn't.
#automation#llm#playwright - 16:51backend
The Marker That Hid Between Two Chunks
A correct regex run against stream fragments matches nothing when the marker spans two deltas. Strip the joined answer instead.
TL;DR: A CTA_FLAG marker leaked into a Redis-cached chat answer because the model split it across two stream chunks, so the per-delta regex strip never matched a full pattern. The fix adds a cleanup pass on the joined answer right before caching. Lesson: any regex run per-chunk is blind to split patterns, so sanitize at the last point before persistence.
#sse#streaming#regex - 15:39ai
That Time a Control Flag Showed Up in the Chat Bubble
A raw CTA_FLAG: YES marker leaked into a live chat bubble. The strip regex only matched end-of-string, and the SSE stream bypassed it entirely.
TL;DR: A CTA_FLAG marker leaked into the UI because the model ignored placement instructions and SSE streaming sent chunks before the strip regex ran. The fix moved CTA data into a structured field on the knowledge source, rendered directly by the frontend. Lesson: never parse UI-critical data out of model prose; use structured fields.
#llm#streaming#sse - 00:33ai
Prompt labels leaked into my AI chat: sanitize both ends
A RINGKAS label leaked into the chat bubble. The fix was not a stricter prompt but sanitizing input and output at both ends of the pipeline.
TL;DR: The author's chatbot kept leaking prompt labels like RINGKAS into answers, and adding prompt prohibitions never fixed it. They moved control to code: sanitizing knowledge-base text before injection and rendering output through react-markdown with rehype-sanitize allowlists. Lesson: prompts give rough direction only; reliable formatting enforcement belongs at input and output boundaries.
#llm-security#react#prompt