Streaming LLM Responses to a React Frontend with Server-Sent Events
A tested Node.js server and fetch-based SSE reader that streams tokens, stops paying for abandoned requests, and plugs into a small React hook.
Building reliable features on top of LLM APIs: retries, evaluation, cost control, security and data work.
A tested Node.js server and fetch-based SSE reader that streams tokens, stops paying for abandoned requests, and plugs into a small React hook.
A small Node.js pattern for versioned prompt files with strict variables and a content hash in every log line, so you can always answer which prompt produced which output.
Stop retyping the same instructions. Build a small library of prompt snippets with /slash expansion in Node.js, plus how chat tools like Shortcut Chat handle reusable shortcuts.
A practical priority list for web developers adding LLM features: limit what the model can do, validate tool calls in code, and require confirmation for side effects. Includes a tested tool-call gate.
When pgvector or even a plain in-memory scan is enough for semantic search, with a runnable demo of the filtered-search trap that returns too few rows and the pgvector 0.8 fix.
Build a 30-case evaluation set, a 40-line runner and a CI check so prompt changes can't quietly break your LLM feature. Includes a runnable Node.js example with a baseline file.
A tested Node.js module that adds a per-user daily token budget and a TTL response cache around any LLM call, plus the habits that keep an AI feature's bill predictable.
A short, tested Node.js module that adds a hard timeout, backoff with jitter, Retry-After handling and schema-validated JSON to any chat-style LLM API call.
A practical, blind-scoring method for choosing between AI models for a real feature, with a tested Node.js scorer, plus where side-by-side chat tools like Shortcut Chat help and where they stop.
A synthetic Python experiment that shows how a leaky feature turns coin-flip data into a 70% 'model', and how a clean feature and walk-forward testing tell the truth. Education only.
Where AI-generated Solidity needs human review: tx.origin authorisation, ignored ERC-20 return values, and unchecked upgrade and access assumptions, with failing tests you can run.