Write Once, Talk to Any LLM: a Provider-Agnostic Abstraction
Every LLM provider has its own message shape, token counting, and errors. Here's how to hide all of it behind one Chatter interface, using mixin composition instead of factory boilerplate.
Every LLM provider has its own message shape, token counting, and errors. Here's how to hide all of it behind one Chatter interface, using mixin composition instead of factory boilerplate.
When a conversation overflows the context window, dropping the oldest turns throws away meaning. Summarize the middle instead: the pattern every major LLM provider now ships natively, and how the loop works when you build it yourself.
HTTP request/response can't push. Django Channels makes Django event-driven: an async WebSocket consumer with channel-layer groups broadcasts to every connected client, while a small wrapper keeps the synchronous ORM safe inside the async world.
Storing recipes, bookmarks, journals and groceries behind a single REST surface: a polymorphic Item base, dynamically composed nested serializers, atomic multi-table writes, and the eager-loading that kills the N+1 queries.
You don't need a paid API to transcribe audio. With faster-whisper, int8 quantization, and a little ffmpeg preprocessing you get offline, free transcription. I benchmarked all five model sizes on CPU against LibriSpeech, and the biggest one didn't win.
Résumés, recipes, invoices and receipts all hide structured facts in free-form layouts. Pulling them out reliably means combining a few well-known techniques (layout parsing, heuristics, NER, document-AI models, and a grounded LLM) rather than reaching for one hammer.
Modern sites fingerprint the device and timing, not just navigator.webdriver. Here's how a stealth Selenium setup injects CDP commands, masks automation markers, and persists realistic state to pass real detection suites.
Pulling years of monthly vehicle prices from a flaky legacy ASP site is a resilience problem: checkpoint and resume, handle modal dialogs, retry hard, and land the result as clean columnar data you can actually analyze.