A new package that processes user input to generate structured summaries of decentralized protocol concepts, such as Polyproto, by extracting key features and benefits. It uses pattern matching to ens
Project description
decentralized-summarizer
decentralized-summarizer is a Python package that turns user input about decentralized protocols (e.g., Polyproto) into clear, structured summaries. It extracts key features and benefits while avoiding technical jargon, making the output accessible to non‑expert audiences. The package leverages pattern matching to guarantee that the generated summaries follow a predefined format.
Features
- Simple API – One function call to generate a summary.
- LLM‑agnostic – Uses
ChatLLM7by default; you can plug any LangChain‑compatible LLM. - Formatted output – Enforces a regex pattern, ensuring consistent structure.
- No jargon – Tailored prompts keep language clear and approachable.
Installation
pip install decentralized_summarizer
Quick Start
from decentralized_summarizer import decentralized_summarizer
# Simple usage with the default ChatLLM7
summary = decentralized_summarizer(
user_input="Explain the main advantages of Polyproto in a decentralized network."
)
print(summary) # => List of formatted summary strings
Function Signature
def decentralized_summarizer(
user_input: str,
api_key: Optional[str] = None,
llm: Optional[BaseChatModel] = None,
) -> List[str]:
| Parameter | Type | Description |
|---|---|---|
| user_input | str |
The raw text you want to summarise. |
| api_key | Optional[str] |
API key for ChatLLM7. If omitted, the function reads LLM7_API_KEY from the environment or uses a placeholder "None" (which works for the free tier). |
| llm | Optional[BaseChatModel] |
A LangChain LLM instance. If not provided, ChatLLM7 from langchain_llm7 is used. |
Using a Custom LLM
You can pass any LangChain‑compatible chat model (OpenAI, Anthropic, Google, etc.):
OpenAI
from langchain_openai import ChatOpenAI
from decentralized_summarizer import decentralized_summarizer
my_llm = ChatOpenAI(model="gpt-4o-mini")
summary = decentralized_summarizer(
user_input="What are the security benefits of a decentralized exchange?",
llm=my_llm,
)
Anthropic
from langchain_anthropic import ChatAnthropic
from decentralized_summarizer import decentralized_summarizer
my_llm = ChatAnthropic(model="claude-3-opus-20240229")
summary = decentralized_summarizer(
user_input="Describe how decentralised governance works.",
llm=my_llm,
)
Google Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
from decentralized_summarizer import decentralized_summarizer
my_llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
summary = decentralized_summarizer(
user_input="Summarise the key points of the Polkadot parachain model.",
llm=my_llm,
)
API Key & Rate Limits
- The package defaults to
ChatLLM7from the langchain_llm7 package. - The free tier of
ChatLLM7provides sufficient rate limits for typical usage. - For higher limits, supply your own API key:
- Environment variable:
export LLM7_API_KEY="your_key" - Direct argument:
api_key="your_key"
- Environment variable:
Obtain a free API key by registering at: https://token.llm7.io/
Contributing & Support
- Issues: https://github.com/chigwell/decentralized_summarizer/issues
- Pull requests: Contributions are welcome—please follow standard GitHub workflow.
Author
Eugene Evstafev
Email: hi@eugene.plus
GitHub: chigwell
The package uses ChatLLM7 from langchain_llm7 by default. Feel free to replace it with any other LangChain chat model that matches the BaseChatModel interface.
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 decentralized_summarizer-2025.12.21120929.tar.gz.
File metadata
- Download URL: decentralized_summarizer-2025.12.21120929.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b2fbbc62a9a95747319f83296d927aa0f373e53beb26423c298814ea0901216
|
|
| MD5 |
6ede7e8e720a8cfc1b47a504247b4fef
|
|
| BLAKE2b-256 |
a28b2579d0f38f1ad58c0e18cd2f6a06af9debfbd2f7fa7c7d29d1f5c64a27e5
|
File details
Details for the file decentralized_summarizer-2025.12.21120929-py3-none-any.whl.
File metadata
- Download URL: decentralized_summarizer-2025.12.21120929-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 |
88f53b1807d39e25b16d40e9a76971071ce9c563f73f82c52e0f6fec4b64055d
|
|
| MD5 |
1a9afb78cfe36356eb919a52dc884fc2
|
|
| BLAKE2b-256 |
3488d76893636d219c61df00f24f56a246dac36de62cda1dbfed2ee5762e3081
|