- Objective
- Architecture Overview
- LLM Model Selection
- Deliverables
- Getting Started & Running the Code
- Future Scope
- Contact
This project demonstrates a minimal viable product (MVP) for automating the creation of digital ad campaigns using a Large Language Model (LLM) and deploying them on platforms like Meta, TikTok, or LinkedIn. The tool takes a structured campaign brief and optionally a PDF input, and generates ad copy and targeting suggestions using prompt-engineered LLM responses.

- Product: Smartwatch X
- Goal: Drive website traffic
- Audience: Young professionals aged 25–35 interested in fitness and productivity
- Budget: $2000
- Platform: LinkedIn
- Company Website: -
- Upload Reference PDF (Optional): -
-
PDF Text Extraction
UtilizesPyMuPDF
for multi-page PDF parsing and conversion to usable plain text. -
LLM-Powered Ad Generator
Uses Google's Gemini 1.5 Flash via the Generative AI API to generate structured campaign content with tailored prompt engineering for LinkedIn. -
Campaign Deployment (Prototype)
Placeholder logic that simulates campaign submission. Modularized to integrate Meta, LinkedIn, and TikTok Ads APIs in production.
Model | Pros | Cons | Reason for Not Choosing |
---|---|---|---|
Gemini 1.5 Flash | Fast, structured output, stable formatting | API limits, Easy to deploy | ✅ Chosen for MVP |
LLaMA 2 | Open-source, local control | Requires GPU, setup-heavy | Not practical for quick MVP |
Mistral | Lightweight, open license | Lower instruction-following ability | Less robust for prompt structure |
Claude | Strong reasoning and summarization | Inconsistent formatting, slower | Good alternative, not ideal here |
GPT-4 | Powerful and accurate | Expensive, slow | Overkill for MVP, high latency |
Gemini 1.5 Flash was chosen for its optimal trade-off between inference speed, formatting reliability, and ease of integration for a structured prompt environment.
Clone the repository and install the required Python packages:
git clone https://github.com/your-username/atomicads-ai-engineer-assignment-margi.git
cd atomicads-ai-engineer-assignment-margi
pip install -r requirements.txt
Create a .env file in the root directory and add your Google Generative AI API key:
GOOGLE_API_KEY=your_google_genai_api_key_here
- Go to the Zapier Dashboard
- Click on "Create Zap"
- App: Webhooks by Zapier
- Trigger Event:
Catch Hook
- Zapier will generate a custom webhook URL. Use it in your Python script to POST the generated LinkedIn ad content.
Run the python app.py to generate an ad campaign:
python app.py
- Python scripts (
main.py
,llm_generator.py
, etc.) - Environment config (
.env
) - README documentation
- Prompt examples
- Simulated ad output and screenshots
- ✅ Add frontend via Streamlit or Flask
- ✅ Real-time deployment via Ads API (Meta, LinkedIn, TikTok)
- ✅ Feedback loop and A/B testing capabilities
- ✅ Cost optimization via local open-source models
- ✅ Prompt tuning and output validation logic
Feel free to reach out on LinkedIn or Email for any questions or feedback.