Spaces:
Sleeping
title: GenAI Toolkit
emoji: π€
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
π€ GenAI Toolkit
A powerful, all-in-one Generative AI application combining multiple NLP features into a single, clean interface β powered by LangChain, LangGraph, and Groq LLaMA 3.
π Features
| Feature | Description |
|---|---|
| π Language Translation | Translate text across 20+ languages instantly |
| π Text Summarization | Condense long documents using map-reduce chunking |
| π Keyword Extraction | Extract key topics and phrases from any text |
| βοΈ Email Writer | Generate professional emails and cover letters |
| π¬ Chat Assistant | Multi-turn AI conversations with memory |
| π PDF Q&A | Upload PDFs and ask questions using RAG |
π οΈ Tech Stack
| Layer | Technology |
|---|---|
| LLM | Groq LLaMA 3.3 70B + LLaMA 3.1 8B |
| Orchestration | LangChain + LangGraph |
| Vector Store | FAISS + HuggingFace Embeddings |
| UI | Gradio |
| Deployment | Docker + Hugging Face Spaces |
ποΈ Architecture
GenAI-Toolkit/ βββ src/ β βββ features/ β β βββ translation.py # LangChain PromptTemplate β β βββ summarization.py # Map-Reduce summarization β β βββ keyword_extraction.py # Structured output extraction β β βββ email_writer.py # Email + Cover letter generation β β βββ pdf_qa.py # RAG pipeline with FAISS β βββ graphs/ β β βββ chat_graph.py # LangGraph conversation graph β βββ utils/ β β βββ llm.py # Groq LLM setup β β βββ vector_store.py # FAISS vector store β βββ app.py # Gradio UI βββ Dockerfile βββ requirements.txt
π How It Works
Language Translation
Uses LangChain PromptTemplate with Groq LLaMA 3.1 to translate text between 20+ languages while preserving tone and context.
Text Summarization
Implements map-reduce chunking β splits long documents into chunks, summarizes each chunk, then combines into a final summary. Handles documents of any length.
Keyword Extraction
Uses structured LLM output to extract the most relevant keywords with context and relevance explanations.
Email & Cover Letter Writer
Template-driven generation with customizable tone, email type, and recipient details. Cover letter writer tailors content to specific job roles and companies.
Chat Assistant
Built with LangGraph StateGraph β maintains full conversation history across turns using a stateful graph architecture.
PDF Q&A
Implements RAG (Retrieval Augmented Generation):
- Upload PDF β extract text with PyMuPDF
- Chunk text with RecursiveCharacterTextSplitter
- Embed chunks with HuggingFace sentence-transformers
- Store in FAISS vector store
- Retrieve top-k relevant chunks per question
- Generate answer with LangGraph agent
π§ Local Setup
# Clone the repo
git clone https://github.com/shashankheg/GenAI-Toolkit.git
cd GenAI-Toolkit
# Create virtual environment
uv venv
.venv\Scripts\activate
# Install dependencies
uv pip install -r requirements.txt
# Add API key to .env
echo "GROQ_API_KEY=your-key-here" > .env
# Run the app
python -m src.app
π³ Docker
docker build -t genai-toolkit .
docker run -p 7860:7860 -e GROQ_API_KEY=your-key genai-toolkit
π API Keys
- Groq API (free) β https://console.groq.com
- No OpenAI key required β fully powered by Groq
π Model Details
| Task | Model | Speed |
|---|---|---|
| Translation, Keywords, Email | LLaMA 3.1 8B Instant | ~0.5s |
| Summarization, Chat, PDF Q&A | LLaMA 3.3 70B Versatile | ~1-2s |
π¨βπ» Author
- HuggingFace: @shashankheg