Click the button above to watch a comprehensive demonstration of AdPilot in action
Demo Highlights:
- User registration and authentication flow
- Campaign creation and management
- AI-powered ad copy generation using fine-tuned Llama 3.2
- Image generation for advertisements
- Campaign scheduling and publishing
- Analytics dashboard and performance tracking
Note: Most AI models in the demo are running on CPU, which have since been upgraded for better performance.
AdPilot is a comprehensive AI-powered advertising platform designed specifically for startups and teams with limited marketing budgets. It leverages artificial intelligence to help businesses create, manage, and optimize advertising campaigns across multiple platforms including Facebook and Instagram.
The platform provides tools for market analysis, content generation, image creation, and campaign management, all integrated into a seamless user experience. AdPilot aims to democratize access to professional-grade advertising tools, making them accessible to businesses of all sizes.
-
User Authentication & Management
- Secure registration and login system
- Email verification
- JWT-based authentication with refresh tokens
- User profile management
-
Campaign Creation & Management
- Create and manage advertising campaigns
- Schedule posts for future publication
- Track campaign performance metrics
- Support for multiple social media platforms (Facebook, Instagram)
-
AI-Powered Content Generation
- Generate advertisement copy based on product descriptions using fine-tuned Llama 3.2
- Create professional marketing content with specialized ad-focused language models
- Produce market analysis reports
- Custom-trained models optimized for advertising copy
-
Image Generation
- AI-powered image generation for advertisements
- Custom image styling based on mood and style preferences
- Image storage and management
-
Market Insights & Analytics
- Detailed market analysis
- Campaign performance tracking
- Data visualization and reporting
- PDF report generation
-
AI Chatbot Assistant
- Conversational interface for campaign insights
- Performance recommendations
- Marketing strategy suggestions
-
Facebook Integration
- Post creation and scheduling
- Campaign management
- Ad set configuration
- Creative asset management
-
Instagram Integration
- Post creation and scheduling
- Campaign management
- Platform-specific optimizations
- Framework: Next.js 14
- Language: TypeScript/JavaScript
- UI Components: React
- Styling: CSS/Tailwind CSS
- State Management: React Context API
- Form Handling: React Hook Form with Zod validation
- Animation: Framer Motion
- Icons: Lucide React
- Framework: FastAPI
- Language: Python 3.12+
- Database: PostgreSQL with SQLModel ORM
- Authentication: JWT (JSON Web Tokens)
- Password Hashing: Bcrypt
- Caching: Redis
- Task Queue: Background Tasks
- API Integration: Facebook Graph API, Instagram API
- LLM Integration: Together AI (Llama 3.2)
- Custom LLM: Fine-tuned Llama 3.2 for advertising content generation
- Local LLM Deployment: Ollama for efficient model serving
- Image Generation: FLUX.1-Schnell Model
- Data Analysis: Pandas, Matplotlib, Seaborn
- PDF Generation: ReportLab
- Package Management: Poetry (Backend), npm/yarn (Frontend)
- Environment Management: dotenv
- Image Storage: Cloudinary
- CORS Handling: FastAPI CORS Middleware
AdPilot follows a modern client-server architecture:
AdPilot/
βββ Frontend/ # Next.js frontend application
β βββ my-app/
β βββ public/ # Static assets
β βββ src/ # Source code
β β βββ app/ # Next.js app router
β β βββ components/ # React components
β β βββ context/ # Context providers
β β βββ styles/ # CSS styles
β βββ package.json # Frontend dependencies
β
βββ Backend/ # FastAPI backend application
βββ adpilot/
βββ adpilot/ # Main application code
β βββ router/ # API routes
β βββ models.py # Database models
β βββ auth.py # Authentication logic
β βββ db.py # Database connection
β βββ main.py # Application entry point
β βββ ... # Other modules
βββ pyproject.toml # Backend dependencies
βββ poetry.lock # Locked dependencies
- Python 3.12+
- Node.js 18+ and npm/yarn
- PostgreSQL database
- Redis server
- Cloudinary account
- Together AI API key
- Ollama (for local LLM deployment)
-
Clone the repository:
git clone https://github.com/saadsohail05/Ad-Pilot.git cd Ad-Pilot/Backend/adpilot
-
Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -
-
Install dependencies:
poetry install
-
Create a
.env
file in theBackend/adpilot
directory with the following variables:DATABASE_URL=postgresql://username:password@localhost:5432/adpilot SECRET_KEY=your_secret_key_here ALGORITHM=HS256 ACCESS_TOKEN_EXPIRE_MINUTES=30 # Cloudinary credentials CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret # Together AI API key TOGETHER_API_KEY=your_together_api_key # Ollama configuration OLLAMA_HOST=http://localhost:11434 # Facebook/Instagram API credentials FB_ACCESS_TOKEN=your_facebook_access_token FB_ACCOUNT_ID=your_facebook_account_id FB_PAGE_ID=your_facebook_page_id
-
Start the backend server:
poetry run uvicorn adpilot.main:app --reload
-
Navigate to the frontend directory:
cd Ad-Pilot/Frontend/my-app
-
Install dependencies:
npm install # or yarn install
-
Create a
.env.local
file with the following variables:NEXT_PUBLIC_API_URL=http://localhost:8000
-
Start the development server:
npm run dev # or yarn dev
-
Open http://localhost:3000 in your browser to see the application.
- Navigate to the signup page and create a new account
- Verify your email address through the verification link
- Log in with your credentials
- Navigate to the "Create Campaign" section
- Fill in the campaign details (name, platform, etc.)
- Proceed to the ad creation step
- Enter your product details and description
- Use the AI-powered content generator to create ad copy
- Customize the generated content as needed
- Describe the desired image or use the AI to generate image prompts
- Select style and mood preferences
- Generate and preview the image
- Save or regenerate as needed
- Review your campaign details, ad copy, and images
- Choose between immediate posting or scheduling for later
- Select targeting options (if applicable)
- Launch the campaign
- Navigate to the dashboard to view campaign metrics
- Analyze performance data and insights
- Use the AI chatbot for performance recommendations
AdPilot leverages a custom fine-tuned version of Llama 3.2 specifically optimized for advertising content generation:
- Training Data: Curated dataset of high-performing advertising copy across various industries and platforms
- Optimization: Fine-tuned to generate persuasive, concise, and conversion-focused ad content
- Deployment: Served locally using Ollama for fast inference and data privacy
- Capabilities:
- Generates platform-specific ad copy (Facebook, Instagram)
- Creates headlines, body text, and calls-to-action
- Adapts tone and style based on target audience and product category
- Optimizes for engagement metrics
- Base Model: Llama 3.2 (8B parameter version)
- Training Method: Low-rank adaptation (LoRA) fine-tuning
- Training Data: 10,000+ high-performing ads across various industries
- Hyperparameters:
- Learning rate: 2e-5
- Epochs: 3
- Batch size: 8
- LoRA rank: 16
- LoRA alpha: 32
- Evaluation Metrics: ROUGE, BLEU, and human evaluation for creativity and persuasiveness
The custom model is exposed through a dedicated API endpoint that provides:
- Specialized temperature settings for creative ad generation
- Optimized context handling for product descriptions
- Consistent brand voice maintenance
- Industry-specific terminology and best practices
AdPilot uses Ollama to efficiently serve and manage the fine-tuned models:
- Local Deployment: Models run locally for faster inference and data privacy
- Model Management: Easy switching between different fine-tuned versions
- Resource Efficiency: Optimized for running on standard hardware without requiring specialized GPUs
- API Interface: RESTful API for seamless integration with the backend
- Custom Model Format: Packaged using Ollama's Modelfile format with specific parameters for advertising tasks
The backend API is documented using Swagger UI. Once the backend server is running, you can access the API documentation at:
http://localhost:8000/docs
This interactive documentation allows you to:
- View all available endpoints
- Understand request and response formats
- Test API calls directly from the browser
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.