vidconcept-sum is a lightweight Python package that turns a video title or short text description into a structured, factual summary of the scientific or educational concept being presented. It leverages an LLM (by default ChatLLM7) to interpret the topic and returns a concise explanation, key terms, and contextual information, all formatted according to a strict regex pattern.
- One‑line API – just pass a string, get a list of structured summary elements.
- LLM‑agnostic – works out‑of‑the‑box with ChatLLM7, but you can plug any LangChain‑compatible chat model.
- Safety‑first – the prompt enforces factual, non‑speculative answers and validates output against a regular expression.
- Easy installation – available on PyPI.
pip install vidconcept_sumfrom vidconcept_sum import vidconcept_sum
# Simple call using the default ChatLLM7 model (requires an API key)
summary = vidconcept_sum(
user_input="A short intro to quantum entanglement in YouTube video titles."
)
print(summary)| Name | Type | Description |
|---|---|---|
user_input |
str |
The video title or short description to be summarised. |
llm (optional) |
BaseChatModel |
Any LangChain chat model instance. If omitted, the default ChatLLM7 will be instantiated. |
api_key (optional) |
str |
API key for LLM7. If not supplied, the function looks for the environment variable LLM7_API_KEY. |
The function returns a List[str] containing the extracted summary data.
You can replace the default ChatLLM7 with any LangChain‑compatible chat model. Below are examples for OpenAI, Anthropic, and Google Generative AI.
from langchain_openai import ChatOpenAI
from vidconcept_sum import vidconcept_sum
llm = ChatOpenAI(model="gpt-4o-mini")
response = vidconcept_sum(
user_input="Explaining the basics of photosynthesis.",
llm=llm
)
print(response)from langchain_anthropic import ChatAnthropic
from vidconcept_sum import vidconcept_sum
llm = ChatAnthropic(model="claude-3-haiku-20240307")
response = vidconcept_sum(
user_input="A video about black holes and event horizons.",
llm=llm
)
print(response)from langchain_google_genai import ChatGoogleGenerativeAI
from vidconcept_sum import vidconcept_sum
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
response = vidconcept_sum(
user_input="Understanding the theory of relativity in simple terms.",
llm=llm
)
print(response)- LLM7 free tier provides generous rate limits that cover typical usage of this package.
- If you need higher limits, supply your own API key:
- Via environment variable:
export LLM7_API_KEY="your_key_here" - Or directly in the call:
vidconcept_sum(..., api_key="your_key_here")
- Via environment variable:
- Obtain a free API key by registering at https://token.llm7.io/.
If you encounter any issues or have feature requests, please open an issue on GitHub:
https://github.com/chigwell/vidconcept-sum/issues
This project is licensed under the MIT License.
Eugene Evstafev
Email: hi@euegne.plus
GitHub: chigwell
Enjoy using vidconcept-sum to instantly extract clear, educational concepts from video titles!