AI-powered email assistant built with Meta LLaMA-4, Cerebras API, Streamlit, and Docker.
Smart Email Generator helps users instantly create professional, friendly, or technical emails using AI-powered role and tone awareness.
Users can describe what they want in natural language or use structured inputs for tone, intent, and role.
The app generates a subject and body, previews it, and lets users send it directly via Gmail.
- 🎯 Intent, Tone & Role Control
- 💬 Natural Instruction + Context Input
- 🧠 Meta LLaMA-4 via Cerebras API
- 📤 Send Email via Gmail API
- 🐳 Dockerized for Deployment
- 🧾 Secure .env & Volume-based Credentials
| Category | Technology |
|---|---|
| LLM | Meta LLaMA-4 (via Cerebras Cloud SDK) |
| Frontend | Streamlit |
| Backend | Python |
| Email API | Gmail API (OAuth 2.0) |
| Deployment | Docker + Docker Compose |
git clone https://github.com/<your-username>/smart-email-generator.git
cd smart-email-generatorCreate .env file:
CEREBRAS_API_KEY=sk-your-cerebras-keyFROM python:3.11-slim
WORKDIR /app
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
To enable Gmail sending, you need to create OAuth credentials from your Google Cloud Console.
- Go to the Google Cloud Console.
- Create a new project (or use an existing one).
- Navigate to APIs & Services → Library.
- Search for Gmail API and click Enable.
- Go to APIs & Services → Credentials.
- Click Create Credentials → OAuth client ID.
- Choose Desktop app as the application type.
- Download the
credentials.jsonfile and place it in your project root folder.
⚠️ Important: Do not commit this file to GitHub.
It contains private keys that authorize access to your Gmail account.
When you run the app for the first time, a browser window will open asking for Gmail permissions.
- Log in with the Gmail account you want to use for sending.
- Allow the required permissions (sending emails).
- The app will save a token file named
token.pklautomatically — this stores your authorization credentials securely for future use.
⚙️ Files created locally:
credentials.json→ your OAuth client secretstoken.pkl→ saved access token (generated after first login)
You can then mount these files inside your Docker container using:
volumes:
- ./credentials.json:/app/credentials.json:ro
- ./token.pkl:/app/token.pkldocker-compose up --buildThen open → http://localhost:8501
🧠 Cerebras → AI inference using LLaMA-4 model via Cerebras Cloud SDK.
🧠 Meta (LLaMA) → Role-aware, tone-controlled text generation using structured prompts.
🐳 Docker → Containerized deployment with environment-based security for portability.
👉 YouTube: Smart Email Generator (3-min Demo)
Integrated Cerebras SDK with Meta LLaMA models.
Managed Gmail OAuth securely.
Designed modular prompts with intent/tone conditioning.
Containerized AI apps for fast, reproducible deployment.
✅ Cerebras ✅ Meta
Smart Email Generator helps students, employees, and professionals communicate more effectively by automating repetitive, time-consuming email writing tasks — while keeping tone, role, and personalization intact.