This is a Node.js application that allows users to upload PDF files and summarize the content of the PDF file. The application uses Groq to run the large language model (LLM) inferences that power the PDF summarization. It demonstrates the ability to easily use LLMs to implement intelligent natural language workflows.
This simple script will convert PDF files into summarized TXT files using Groq-sdk
- Run
npm install
to install modules. - Place
.pdf
files in thefiles
folder. - Create a
.env
file in the root directory. - Sign up at Groq and generate an API key.
- Add your Groq API key to the
.env
file:GROQ_API_KEY=your_api_key_here
- Run
npm start
in the terminal.
After starting the application:
- Select a model from the available Groq models
- Choose a PDF file from the
files
folder - The application will process the PDF and create a summary
- Find the summary in a .txt file with the same name as your PDF in the
files
folder
- Interactive model selection from available Groq models
- Support for multiple PDF files
- Automatic chunking of large documents
- Summary of summaries for very large documents
- Output as txt
- Groq SDK - Groq API client for Node.js
- pdf-parse - Pure JavaScript cross-platform module to extract texts from PDFs
- prompts - Interactive command line interface
- dotenv - Environment variable management
- yargs - Command line argument parsing
This project is licensed under the MIT License.