Skip to main content

llms-ink

Turn any public link — a site, docs section, page, GitHub repo, PDF or video — into llms.txt or llms-full.txt, from Python. A client for llms.ink with LangChain and LlamaIndex loaders. No required dependencies.

pip install llms-ink

Use

from llms_ink import Client

ink = Client()
index = ink.llms("llmstxt.org")                         # llms.txt: an index of links
docs = ink.llms("docs.astro.build/en/guides/", mode="full")  # llms-full.txt: the content

print(docs.title, docs.kind, docs.tokens)
print(docs.text)

llms() returns a Result: url, kind (site, section, page, repo, document, video), source (native = published by the site, generated = made by llms.ink), mode, title, text, tokens, pages, model, cached, generated_at, and media for videos (duration, downloads, transcript segments). fresh=True skips the cache and rebuilds.

Check a site's published llms.txt:

report = ink.check("llmstxt.org")
print(report.found, report.summary.errors, [i.message for i in report.issues])

API key (optional)

Without a key you share the free anonymous limits (10 requests/minute, 60 new links a day per IP; cached links are free). A key gets its own daily quota:

export LLMS_INK_KEY=lk_...

or Client(key="lk_..."). It is sent as Authorization: Bearer. A bad key raises InvalidKey; it never falls back to anonymous. Ask for a key.

Errors

from llms_ink import Client, LlmsInkError, QuotaExceeded, RateLimited

try:
    Client().llms("example.com")
except (RateLimited, QuotaExceeded) as err:
    print(f"wait {err.retry_after}s")
except LlmsInkError as err:
    print(err.status, err.code, err.detail)

LlmsInkError carries the API's status, code (see the error table), detail and errors. InvalidKey, RateLimited and QuotaExceeded are subclasses.

LangChain

pip install 'llms-ink[langchain]'
from llms_ink.langchain import LlmsInkLoader

docs = LlmsInkLoader(["llmstxt.org", "github.com/AnswerDotAI/llms-txt"], mode="full").load()
docs[0].metadata  # {'url', 'title', 'kind', 'source', 'mode', 'tokens', 'generated_at'}

LlamaIndex

pip install 'llms-ink[llama-index]'
from llama_index.core import VectorStoreIndex
from llms_ink.llama_index import LlmsInkReader

docs = LlmsInkReader(mode="full").load_data(["docs.astro.build/en/guides/"])
index = VectorStoreIndex.from_documents(docs)

Command line

python -m llms_ink llmstxt.org            # llms.txt
python -m llms_ink llmstxt.org --full     # llms-full.txt
python -m llms_ink llmstxt.org --json     # the whole result

Development

python3 -m venv .venv && .venv/bin/pip install -e '.[langchain,llama-index]' pytest
.venv/bin/pytest                # against a local stub server
.venv/bin/pytest -m live        # one real call to https://llms.ink

LLMS_INK_API points the client at another API base URL.

MIT licensed.

Metadata

Release files for llms-ink 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llms-ink 0.1.0
File Size Uploaded Provenance Actions
llms_ink-0.1.0.tar.gz 12.6 kB Without provenance Details for llms_ink-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llms-ink 0.1.0
File Interpreter ABI Platform Actions
llms_ink-0.1.0-py3-none-any.whl Python 3 none any Details for llms_ink-0.1.0-py3-none-any.whl

Total release size: 24.0 kB

Release files / llms_ink-0.1.0.tar.gz

Download URL llms_ink-0.1.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1eb5fca89d0a15722eccab77d844fd734ad855dbc1d4283351ebb1a6aae574b4
BLAKE2b-256 checksum
How to use checksums
e01722d26c129c66e6750eef3268e828bdf0e71c96936a559dc47d81b68cf524
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / llms_ink-0.1.0-py3-none-any.whl

Download URL llms_ink-0.1.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c3a7de12e5e3450b8d3bef414ee577000111899498a6b6c006808e86c35c3cc6
BLAKE2b-256 checksum
How to use checksums
b3a04c2a1dc47f9d3f4ccd9c17142c481a45ae8a7945b82f20d09ff6c0dbd0dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for llms-ink 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page