Plugin for LLM that adds support for fetching markdown content from URLs using Jina Reader API
Project description
llm-url-markdown
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7dc0ce7ec99813cc78cd59b1d1c6827c422804e2bcde1e2edc76092263f737f
|
|
| MD5 |
34c095adaca1f8cd9793043d23ea4ee2
|
|
| BLAKE2b-256 |
871eeb1fbbb874ce9228d901fb79b8ffc014f02bbdd4e5cbc3bc65c93c29e4fa
|
Provenance
The following attestation bundles were made for llm_url_markdown-0.1.tar.gz:
Publisher:
publish.yaml on saeedesmaili/llm-url-markdown
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_url_markdown-0.1.tar.gz -
Subject digest:
e7dc0ce7ec99813cc78cd59b1d1c6827c422804e2bcde1e2edc76092263f737f - Sigstore transparency entry: 198121173
- Sigstore integration time:
-
Permalink:
saeedesmaili/llm-url-markdown@bbb4f0ad2bf913db7a04e202976b4ee861899575 -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/saeedesmaili
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@bbb4f0ad2bf913db7a04e202976b4ee861899575 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f3ef9be152c36a2a68ff3b191c4820f5b02f6b5a239a1a01b178237748d5284
|
|
| MD5 |
f4d29b6f57fcc85935b9bea059e92d04
|
|
| BLAKE2b-256 |
f3fcb8c0f6b04e7f28f9ab2c2d0ec32d1d8853a20bbe5166520f37259bb51fc3
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_url_markdown-0.1-py3-none-any.whl -
Subject digest:
3f3ef9be152c36a2a68ff3b191c4820f5b02f6b5a239a1a01b178237748d5284 - Sigstore transparency entry: 198121178
- Sigstore integration time:
-
Permalink:
saeedesmaili/llm-url-markdown@bbb4f0ad2bf913db7a04e202976b4ee861899575 -
Branch / Tag:
refs/tags/0.1 - Owner: https://github.com/saeedesmaili
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@bbb4f0ad2bf913db7a04e202976b4ee861899575 -
Trigger Event:
release
-
Statement type: