Skip to main content

Plugin for LLM that adds support for fetching markdown content from URLs using Jina Reader API

Project description

llm-url-markdown

PyPI Changelog License

LLM plugin for pulling web page content as Markdown.

This plugin fetches the primary content of a URL, formatted as Markdown, and makes it available as an LLM fragment.

For background on LLM fragments:

Installation

Install this plugin in the same environment as LLM.

llm install llm-url-markdown

Usage

You can feed the Markdown content of a web page into LLM using the md: fragment prefix followed by the URL.

For example:

# Fetch content from a full URL
llm -f md:https://llm.datasette.io/en/stable/plugins/index.html 'Summarize the types of plugins available'

# Fetch content, defaulting to https://
llm -f md:github.com/simonw/llm 'What is the main goal of this LLM tool?'

The plugin prepends https:// if no protocol (like http:// or https://) is specified in the URL. The fetched content is the Markdown representation of the webpage.

Jina Reader API Token (Optional)

This plugin uses the Jina Reader API, which allows requests without an API key, although potentially subject to lower rate limits. The plugin functions without an API token, which is often sufficient for typical LLM fragment usage and improves usability.

If you have a Jina Reader API token and want to use it (for higher rate limits), you can set it as an environment variable:

# Set the token (only needed once per shell session)
export JINA_READER_TOKEN=your_api_token_here

# Then use the plugin as normal
llm -f md:example.com 'Summarize this page'

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-url-markdown
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

# Installs llm, httpx, and testing tools like pytest
pip install -e '.[test]'

To run the tests:

python -m pytest

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

llm_url_markdown-0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

llm_url_markdown-0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file llm_url_markdown-0.1.tar.gz.

File metadata

  • Download URL: llm_url_markdown-0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_url_markdown-0.1.tar.gz
Algorithm Hash digest
SHA256 e7dc0ce7ec99813cc78cd59b1d1c6827c422804e2bcde1e2edc76092263f737f
MD5 34c095adaca1f8cd9793043d23ea4ee2
BLAKE2b-256 871eeb1fbbb874ce9228d901fb79b8ffc014f02bbdd4e5cbc3bc65c93c29e4fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_url_markdown-0.1.tar.gz:

Publisher: publish.yaml on saeedesmaili/llm-url-markdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_url_markdown-0.1-py3-none-any.whl.

File metadata

  • Download URL: llm_url_markdown-0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_url_markdown-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f3ef9be152c36a2a68ff3b191c4820f5b02f6b5a239a1a01b178237748d5284
MD5 f4d29b6f57fcc85935b9bea059e92d04
BLAKE2b-256 f3fcb8c0f6b04e7f28f9ab2c2d0ec32d1d8853a20bbe5166520f37259bb51fc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_url_markdown-0.1-py3-none-any.whl:

Publisher: publish.yaml on saeedesmaili/llm-url-markdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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