I'm Ayush Gurung — an AI Engineer who cares about the engineering underneath the model. The question that drives most of my work isn't "which LLM is smartest?" — it's "how do I make this reliable, fast, and cheap to operate at scale?"
My flagship project, bbygrl / thotqen , is a production-grade RAG system that lets users upload any PDF and have a context-aware, history-grounded conversation with it. It is not a demo — it ships with a three-tier caching strategy designed to eliminate redundant LLM calls entirely.
The first cache tier lives at the Cloudflare edge — a TypeScript Worker that intercepts every chat request, generates a 384-dimensional query embedding with Cloudflare Workers AI ( @cf/baai/bge-small-en-v1.5), and checks a PL/pgSQL cosine-similarity function in PostgreSQL for any semantically equivalent previous answer. A cache hit never reaches FastAPI — the cached answer is streamed back directly from the edge as a ReadableStream, indistinguishable to the client from a live LLM response.
The second tier is a flat-file read cache on HuggingFace Space's persistent /data volume. Every session's message list is serialised as a single JSON file using POSIX-atomic writes ( NamedTemporaryFile + os.replace). Chat-switch reads cost zero Supabase round-trips.
Inside the FastAPI backend, the LangChain RAG chain uses create_history_aware_retriever to rephrase ambiguous follow-up questions into standalone queries before retrieval — meaning the bot stays coherent across a long conversation without leaking one user's document context into another's (per-user pgvector filter enforced at the DB layer). The LLM itself is selectable at runtime — Groq's LLaMA 3.3 70B or Qwen 32B for low-latency cloud inference, or a local Ollama model for completely offline use.
Auth is handled by verifying Supabase HS256 JWTs on every request — both authenticated and anonymous users receive a stable UUID sub claim, so the data isolation model is uniform. Uploaded PDFs are streamed directly to Cloudflare R2 before text extraction, meaning the origin file is always retrievable from the edge.
I build the frontend with the same level of care — the landing page uses GSAP and HTML5 Canvas Canvas animations that reflect the AI's real-time state (Idle / Thinking / Streaming). The application workspace streams LLM tokens character-by-character using the Fetch API reader.read() loop, making a cached response and a live response indistinguishable from the user's perspective.