A powerful text summarization tool built with LangChain and Streamlit that transforms long texts into concise summaries using AI.
- Multiple Summary Types: Choose between standard summaries and bullet-point format
- Flexible Input: Type/paste text directly or upload text files (.txt, .md)
- Smart Text Processing: Automatically handles long texts with chunking and map-reduce summarization
- Real-time Statistics: View character count, word count, and compression ratios
- Download Summaries: Save your summaries as text files
- User-friendly Interface: Clean, intuitive Streamlit web interface
Try it now: https://thetextssummarizer.streamlit.app/
- Python 3.7+
- OpenRouter API account (or compatible OpenAI API)
-
Clone the repository
git clone <repository-url> cd langchain-text-summarizer
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
Create a
.envfile in the project root:API_KEY=your_api_key_here MODEL_NAME=mistralai/mistral-small-3.1-24b-instruct:free BASE_URL=https://openrouter.ai/api/v1
-
Run the application
streamlit run app.py
| Variable | Description | Example |
|---|---|---|
API_KEY |
Your AI model API key | sk-... |
MODEL_NAME |
AI model identifier | mistralai/mistral-small-3.1-24b-instruct:free |
BASE_URL |
API endpoint URL | https://openrouter.ai/api/v1 |
This project is configured to work with OpenRouter's free models, but can be adapted for:
- OpenAI GPT models
- Anthropic Claude
- Other LangChain-compatible models
- Choose Summary Type: Select between "Standard Summary" or "Bullet Points"
- Input Text: Either paste text directly or upload a file
- Generate Summary: Click the "Generate Summary" button
- Review Results: View your summary with compression statistics
- Download: Save your summary as a text file
This project is open source and available under the MIT License.