Dev Tools · 2h ago
New library cuts LLM token waste by 93% converting HTML to Markdown
A developer built markdown-for-agents, a library that converts HTML to Markdown for AI agents, reducing token usage by 93% on a GitHub docs page. It works via content negotiation, serving Markdown when agents request it. The library is available in TypeScript and Python with middleware for popular frameworks.
Meridian48 take
The token savings are impressive, but the real value is in making agent-friendly content delivery a standard HTTP feature rather than a custom hack.
Read the full reporting
I was burning context feeding HTML to LLMs, so I built a Markdown converter for agents →
DEV Community
llm-token-optimizationmarkdown-converter