Repository navigation
Introducing AI-Powered HTML to Markdown Conversion in get-md #12
Replies: 1 comment
|
wordpress tool objection handling build on top of https://github.com/thephpleague/html-to-markdown, which has the following weaknesses according to Claude (not necessarily related to the wordpress plugin so we need to check) Useful angle. Here's where it's weak as a product, not just a library: Distribution/stack lock-in. PHP only. Most AI/agent stacks are Python, Node/TS, or Go — teams building LLM pipelines would have to shell out to PHP or run a separate service just to use it. A hosted API or native SDKs in the languages people actually build agents in is an easy wedge. Stagnant maintenance. Last release was July 2023 (5.1.1), 14 open issues sitting unaddressed, low commit velocity since. It works, but it's not evolving — no roadmap, no one to escalate bugs to, no SLA. That's a real gap for anyone building a product on top of it. Not built for the LLM use case at all. It was designed for "HTML doc → editable Markdown," not "webpage → clean context for an LLM." Concretely:
No pipeline, just a converter. No fetching, no proxy/anti-bot handling, no caching, no rate limiting, no batch/async processing. If someone wants "give me a URL, get me clean LLM-ready markdown," this library is only one piece — the plumbing around it is all on them. Bottom line: it's a credible free option only if someone is already in PHP and willing to hand-tune config. For anything positioned as "clean, reliable HTML→Markdown for LLM context" as a service, the differentiators are: multi-language/API access, active maintenance, built-in content extraction (not just syntax conversion), JS rendering, and LLM-specific output controls (token budgets, metadata, chunking). |
Uh oh!
There was an error while loading. Please reload this page.
We're excited to announce an upcoming feature for
@nanocollective/get-md: optional AI-powered HTML to Markdown conversion using locally-run language models. This enhancement will give developers the choice between lightning-fast conversion and AI-enhanced quality, all while maintaining complete offline functionality.The Challenge
While our current Turndown-based conversion is fast and reliable (sub-100ms for most pages), complex HTML structures like nested tables, intricate layouts, and heavily formatted content can sometimes result in less-than-perfect Markdown output. We wanted to offer a solution that could handle these edge cases better without forcing all users to adopt a slower, more resource-intensive approach.
The Solution: Optional Local LLM
We're adding support for ReaderLM-v2, a 1.5 billion parameter language model specifically designed for HTML-to-Markdown conversion. The key aspects of our approach:
How It Works
For CLI Users
The CLI provides interactive prompts and progress bars to guide users through the model download process.
For SDK/Package Users
Perfect for Application Developers
One of the most powerful aspects of this feature is how it works for developers building applications with get-md. Whether you're creating an Obsidian plugin, VS Code extension, Electron app, or web service, you can give your users the choice to enable AI conversion.
Example: Obsidian Plugin
Your users get a seamless experience with progress feedback, and the model downloads directly to their machine—no server-side infrastructure needed on your end.
Performance Trade-offs
We believe in transparency, so here's what you need to know:
When to Use Each
Use Turndown (default) for:
Use LLM (opt-in) for:
Technical Architecture
The LLM integration is designed to enhance, not replace, the existing pipeline:
By running the LLM on pre-cleaned HTML, we get better results while reducing token usage and processing time.
Callback System for Rich UIs
We've designed a comprehensive callback system so developers can build rich user interfaces around the conversion process:
This means whether you're building a CLI tool, desktop app, or web service, you can provide users with real-time feedback on what's happening.
Why ReaderLM-v2?
We chose ReaderLM-v2 for several reasons:
The Q4_K_M quantized version strikes the perfect balance—high quality at 986MB, running comfortably on systems with 8GB+ RAM.
Open Questions & Future Enhancements
We're considering several enhancements for future versions:
We'd love to hear your feedback on which features would be most valuable to you.
No Breaking Changes
This is a purely additive feature. All existing code continues to work exactly as before. The default behavior remains unchanged—fast, deterministic Turndown conversion. LLM conversion is opt-in only.
Try It Out
The implementation is currently in planning stages. We're working through the architecture and will be rolling this out in phases:
Follow our GitHub repository for updates, or check out Issue #3 to join the discussion.
We Want Your Feedback
This feature is being designed with the community in mind. We'd love to hear:
Join the conversation on GitHub or reach out to us directly. Let's build something amazing together.
get-md is an open-source HTML to Markdown converter optimized for LLM consumption, built by the Nano Collective. Fast, reliable, and now with optional AI enhancement.
All reactions