π pinned Β· a tour of the build
The Data Science Hiding in My Portfolio
π§The one idea everything is built on: embeddings
π‘ the concept
An embedding turns text (or an image) into a list of numbers, a vector. A good model places similar meanings close together, even with no shared words: "make LLMs faster" and "reduce inference latency" land near each other.
To measure "close" I use cosine similarity: the cosine of the angle between two vectors, from -1 (opposite) through 0 (unrelated) to 1 (identical). It cares about direction, not length, so a short phrase and a long paragraph on the same topic still match.
π¬Ask-my-portfolio chatbot (RAG)
π‘ the concept
πSemantic search across my projects
π‘ the concept
π try it: pick a search, watch it rank by meaning
Illustrative cosine scores. Anything under 0.24is treated as βno real matchβ and dropped, which is why a vague word still returns only what's genuinely relevant.
πThe embeddings galaxy (PCA)
π‘ the concept
π·οΈAuto-pulled blog with embedding zero-shot tagging
π‘ the concept
πΈPhoto clustering (k-means + silhouette + CLIP)
π‘ the concept
β¨The smaller LLM touches
π‘ the concept
- Poem mood classification into eight moods with a confidence score; average 0.894 across 8 poems, reported on the page.
- AI poem art: a model distills each poem into one evocative prompt and an image model renders it. Cached so it is paid for once, but I can regenerate a fresh take, keep versions I like, or upload my own.
- Auto-captioned photos via a vision model, low-detail to stay cheap.
- ELI5 / expert toggle rewrites every blurb for a 10-year-old or a senior engineer, under a strict "keep every fact truthful" rule.
- Guestbook moods: when someone signs the guestbook, the same temperature-0 JSON trick sorts their note into one of six moods (sweet, excited, curious, funny, kind, proud) and pins a matching little emoji to it.
π οΈThe engineering around it
- Caching + ISR. Embeddings, art, captions, and rewrites are computed once; GitHub and Substack refresh hourly, so the site stays fresh without re-paying every request.
- Batched calls. Labels and classifications go out in one batched call, not one-per-item.
- Graceful fallback. The live embedding classifier has a deterministic keyword backup, so a flaky API degrades quality instead of breaking the page.
- Evals as a habit. If I can't measure it, I try not to claim it.