← all projects

This Site: a Static Portfolio That Runs an LLM

The page you're reading. A zero-JS-by-default Astro build that hosts for free, with a chat widget that can optionally load a real language model onto your GPU. No server, no API keys, no inference bill.

July 2026 AstroTypeScriptWebGPUtransformers.js

The constraint

A portfolio for AI work has a built-in tension: live demos are the best proof, but hosted inference means paying a GPU bill so strangers can ask my website what my favorite stack is. This site’s answer: the visitor brings the GPU.

How it’s built

  • Astro 5, fully static. Every page is plain HTML by default; JavaScript ships only for the islands that need it, like the chat widget. Hosting is free on GitHub Pages.
  • The About-section chat starts as a zero-parameter impostor: a hand-written keyword matcher with canned answers, honest about what it is.
  • One click upgrades it to a real language model: SmolLM2-360M-Instruct, quantized to q4f16 (~260 MB), downloaded from the Hugging Face CDN and run on WebGPU via transformers.js inside a web worker. The download is opt-in and cached, and nothing the visitor types ever leaves their browser.
  • The system prompt (everything the model knows about me) lives in one config file next to the canned answers, so both modes stay in sync.

The honest part

A 360M-parameter model is a party trick, not an oracle: it drifts, it hallucinates, and the canned answers are frankly more reliable. That’s why they stay the default and the fallback, and why the widget tells you which one you’re talking to.