Skip to main content

The easiest way to crawl a website and produce LLM ready markdown files

Project description

url2llm

I needed a super simple tool to crawl a website (or the links in a llms.txt) into a formatted markdown file (without headers, navigation etc.) to add to Claude or ChatGPT project documents.

I haven't found an easy solution, there is some web based tool with a few free credits, but if you are already paying for some LLM with an api, why pay also someone else?

Quickstart

With uv (recommended):

Thanks to uv, you can easily run it from anywhere without installing anything:

uv run \
   --with url2llm \
   url2llm \
   --depth 1 \
   --url "https://modelcontextprotocol.io/llms.txt" \
   --instruction "I need documents related to developing MCP (model context protocol) servers" \
   --provider "gemini/gemini-2.5-flash-preview-04-17" \
   --api_key ${GEMINI_API_KEY}

Then drag ./model-context-protocol-documentation.md into ChatGPT/Claude!

With pip (alternative):

pip install url2llm

What it does

The script uses Crawl4AI:

  1. For each url in the crawling, the script produces a markdown
  2. Then it asks the LLM to extract from each page only the content relevant to the given instruction.
  3. Merge all pages into one and save the merged file.

Command args and hints

  • To use another LLM provider, just change --provider to eg. openai/gpt-4o
    • always set --api-key, it is not always inferred correctly fron env vars
  • Provide a clear goal to --instruction. This will guide the LLM to filter out irrelevant pages.
  • Recommended depth (default = 2):
    • 2 or 1 for normal website
    • 1 for llms.txt
  • Provide --output_dir to change where files are saved (default = .)
  • If you need the single pages, use --keep_pages True (default = False)
  • You can specify the concurrency with --concurrency (default = 16)
  • The scripts deletes files shorter than --min_chars (default = 1000)

[!CAUTION] If you need to do more complex stuff use Crawl4AI directly and build it yourself: https://docs.crawl4ai.com/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

url2llm-0.3.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

url2llm-0.3.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file url2llm-0.3.0.tar.gz.

File metadata

  • Download URL: url2llm-0.3.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for url2llm-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5fd7150c1328c6ffbf60a390f19574735cd59943a8db5cb3ea1884fe03bb222f
MD5 944eb5bba4e307384201bf9c2572979b
BLAKE2b-256 b6b1ec3eb9fddf285d363b0b055153d90c96d57cc8e92fef5e3b19ec84a30b6a

See more details on using hashes here.

File details

Details for the file url2llm-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: url2llm-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for url2llm-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b7e2059c3ba1b21fd33b49ab995b8d84eedb393510588d7f3ef5198119ba636
MD5 c4af3167b45c965e394822bc7efff78f
BLAKE2b-256 f4edf0649310c41d8b960133aa7c25f2187489d9db424e8c4c6a9047343f569a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page