Repolode
steipete

steipete/lore.md

A Cloudflare Worker that serves one AI-generated markdown essay per domain per UTC day, cached at the edge.

Stars
28
Forks
10
Open issues
0
Last commit
2 days ago

What is it?

lore.md is a minimal Cloudflare Worker that returns a single AI-generated markdown essay for each hostname, refreshed once per UTC day. The first request of the day triggers generation through Cloudflare AI Gateway using an xAI model, and the result is stored in a Durable Object and cached at the edge, so each domain costs one model call per day.

The output is plain markdown rendered inside a monospace HTML page with automatic light and dark themes. The Worker uses the Host header to tailor the text to each domain. An optional /stream path shows the first generation live on a cache miss, and concurrent requests share the same in-flight generation. If the model call fails, a deterministic fallback text is stored for that day.

Key features

  • 01Generates one markdown essay per hostname per UTC day.
  • 02Caches results at the edge and in a Durable Object to limit model calls.
  • 03Routes model requests through Cloudflare AI Gateway's OpenAI-compatible endpoint.
  • 04Offers a /stream endpoint that streams the first generation live.
  • 05Renders output in a monospace page with automatic light and dark modes.

Use cases

  • Running a daily auto-generated text page on your own domain.
  • Learning how to build a Cloudflare Worker with Durable Objects and AI Gateway.
  • Experimenting with per-domain prompts and daily caching patterns.

Topics

FAQ

What is lore.md?
A Cloudflare Worker that serves one AI-generated markdown essay per domain per UTC day, cached at the edge. lore.md is a minimal Cloudflare Worker that returns a single AI-generated markdown essay for each hostname, refreshed once per UTC day. The first request of the day triggers generation through Cloudflare AI Gateway using an xAI model, and the result is stored in a Durable Object and cached at the edge, so each domain costs one model call per day.
Is lore.md free to use? What license does it have?
lore.md is open source under the MIT license. Check the license terms before using it in commercial products.
Is lore.md still maintained?
Actively maintained. The last commit to lore.md was on Oct 16, 2026.
What can I use lore.md for?
Running a daily auto-generated text page on your own domain. Learning how to build a Cloudflare Worker with Durable Objects and AI Gateway. Experimenting with per-domain prompts and daily caching patterns.
Where can I get lore.md?
The source code and installation instructions are on GitHub: https://github.com/steipete/lore.md

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects