**Problem:**
Project description
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
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 smartcite_site-2025.12.20175753.tar.gz.
File metadata
- Download URL: smartcite_site-2025.12.20175753.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
720ce8c15dd8a2fa284add7907f39aefd79670faeef7217d5cb876c0d69a7aff
|
|
| MD5 |
5b201b5591917ca46be9aa4e7ecf69c6
|
|
| BLAKE2b-256 |
d27f87b04d6eb0de83eeb848328a2838a7dfc05b0cd592251dfb86481a78b2a0
|
File details
Details for the file smartcite_site-2025.12.20175753-py3-none-any.whl.
File metadata
- Download URL: smartcite_site-2025.12.20175753-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f0cbf565beb1ac636ca52c95c5829f039f5a37dd8d89dca3f30958804502834
|
|
| MD5 |
df0551c77a634269e3c8f648d02cb18f
|
|
| BLAKE2b-256 |
3f7efb78fd30827c7b78f3a58425bd3528181be63d00a2e10f725f5dc91b128d
|