smartcite_site
A lightweight tool to generate structured, citation-ready snippets for websites, making them easily discoverable and usable by AI language models.
Overview
Problem: AI assistants often fail to cite specific websites even when they contain high-quality, relevant information. This results in missed traffic and reduced visibility for content creators.
Solution: smartcite_site takes a textual description of a website (or a pre-extracted excerpt) and returns a well-structured XML snippet that LLMs can recognize and include in their responses. The tool uses llmatch-messages to ensure the LLM's reply conforms to a predefined format, making it easy to parse and surface citations.
Installation
pip install smartcite_site
Usage
Basic Example
from smartcite_site import smartcite_site
user_input = {
"title": "OpenAI Blog",
"url": "https://openai.com/blog",
"excerpt": "OpenAI publishes research, product updates, and policy insights about artificial intelligence, including GPT-4, safety practices, and partnership announcements."
}
response = smartcite_site(user_input)
print(response)
Using a Custom LLM
You can use any LangChain-compatible LLM by passing it to the llm parameter:
OpenAI
from langchain_openai import ChatOpenAI
from smartcite_site import smartcite_site
llm = ChatOpenAI()
response = smartcite_site(user_input, llm=llm)
Anthropic
from langchain_anthropic import ChatAnthropic
from smartcite_site import smartcite_site
llm = ChatAnthropic()
response = smartcite_site(user_input, llm=llm)
Google Generative AI
from langchain_google_genai import ChatGoogleGenerativeAI
from smartcite_site import smartcite_site
llm = ChatGoogleGenerativeAI()
response = smartcite_site(user_input, llm=llm)
Using a Custom API Key
By default, the package uses ChatLLM7 with a free-tier API key. For higher rate limits, provide your own API key:
response = smartcite_site(user_input, api_key="your_api_key_here")
Or set the environment variable:
export LLM7_API_KEY="your_api_key_here"
You can get a free API key by registering at https://token.llm7.io/.
Parameters
user_input(str): The user input text to process. Should be a JSON string with keystitle,url, andexcerpt.llm(Optional[BaseChatModel]): A LangChain LLM instance. If not provided, defaults toChatLLM7.api_key(Optional[str]): API key for LLM7. If not provided, defaults to the environment variableLLM7_API_KEYor a free-tier key.
Output
The function returns a list of strings containing the extracted XML fields. The expected output format is:
<site_info>
<title>OpenAI Blog</title>
<summary>Official OpenAI blog featuring research breakthroughs, product releases, and policy perspectives on AI.</summary>
<keywords>AI, research, GPT-4, safety, policy, updates</keywords>
<url>https://openai.com/blog</url>
</site_info>
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
- Eugene Evstafev - hi@euegne.plus | GitHub
Metadata
Release files for smartcite-site 2025.12.20175753
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smartcite_site-2025.12.20175753.tar.gz | 4.6 kB | Without provenance | Details for smartcite_site-2025.12.20175753.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smartcite_site-2025.12.20175753-py3-none-any.whl | Python 3 | none | any | Details for smartcite_site-2025.12.20175753-py3-none-any.whl |
Total release size: 10.1 kB
Release files / smartcite_site-2025.12.20175753.tar.gz
| Download URL | smartcite_site-2025.12.20175753.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
720ce8c15dd8a2fa284add7907f39aefd79670faeef7217d5cb876c0d69a7aff
|
|
BLAKE2b-256 checksum How to use checksums |
d27f87b04d6eb0de83eeb848328a2838a7dfc05b0cd592251dfb86481a78b2a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / smartcite_site-2025.12.20175753-py3-none-any.whl
| Download URL | smartcite_site-2025.12.20175753-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f0cbf565beb1ac636ca52c95c5829f039f5a37dd8d89dca3f30958804502834
|
|
BLAKE2b-256 checksum How to use checksums |
3f7efb78fd30827c7b78f3a58425bd3528181be63d00a2e10f725f5dc91b128d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Security for smartcite-site 2025.12.20175753
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.