Transform your ideas into engaging LinkedIn posts with the power of AI! PostyAI combines advanced language models with machine learning to generate professional, high-quality content tailored to your specific needs.
- AI-Powered Content: Uses Groq's DeepSeek model for high-quality, contextual post generation
- Smart Few-Shot Learning: Learns from 300+ real LinkedIn posts to understand engagement patterns
- 10 Topic Categories: Content Creation, Career Advice, Productivity, Leadership, UX Design, Technology, Wellness, Networking, Personal Branding, and Industry Insights
- Multiple Languages: Generate posts in English and Hinglish
- Flexible Tones: Professional, Casual, Inspirational, Educational, and Conversational
- Smart Length Control:
- Short (1-4 lines) for quick insights
- Medium (5-10 lines) for detailed thoughts
- Long (11+ lines) for comprehensive content
- Batch Generation: Create up to 5 posts at once for content planning
- ML Engagement Prediction: Machine learning models predict post engagement with confidence scores
- Real-time Analytics: Instant analysis of word count, reading time, and engagement potential
- Post History: Track all your generated content with session storage
- Multiple Export Formats: Download posts as TXT or JSON files
- One-Click Actions: Copy to clipboard, regenerate, and export with notifications
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- Engagement Prediction Models: Multiple ML algorithms (Random Forest, XGBoost, LightGBM, etc.)
- Advanced Feature Engineering: 60+ text analysis features including sentiment, complexity, and engagement indicators
- Confidence Scoring: Get prediction confidence levels to guide content decisions
- Real-time Performance Monitoring: Live analytics dashboard with system metrics
- A/B Testing Framework: Test different generation strategies and track performance
- Trending Analysis: Discover popular topics and content patterns
- Advanced Caching: Redis-powered caching for 3x faster response times
- Rate Limiting: Smart API protection with user-friendly limits
- Beautiful UI: Modern design with smooth animations and gradients
- Dark/Light Mode: Elegant theme switching for comfortable use
- Keyboard Shortcuts:
Ctrl+Enter: Generate postCtrl+R: Regenerate last postCtrl+C: Copy to clipboard
- Real-time Notifications: Instant feedback for all actions
- Error Handling: User-friendly error messages with actionable suggestions
- Python 3.8+ (tested with Python 3.13)
- Free Groq API key from console.groq.com
# Clone the repository
git clone https://github.com/yourusername/PostyAI.git
cd PostyAI
# Create virtual environment
python3 -m venv ml_env
source ml_env/bin/activate # On Windows: ml_env\Scripts\activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the project root:
# Get your free API key from https://console.groq.com
GROQ_API_KEY=your_groq_api_key_here
# Optional Flask configuration
FLASK_ENV=development
FLASK_DEBUG=Truepython app.pyAccess the application at: http://localhost:8000
GET /- Main application interfaceGET /api/health- System health checkGET /api/tags- Get available topic categories
POST /api/generate- Generate single postPOST /api/batch-generate- Generate multiple postsPOST /api/regenerate- Regenerate with new parameters
POST /api/ml/predict-engagement- Get ML engagement predictionsGET /api/ml/model-info- View model performance metricsPOST /api/ml/analyze-text- Detailed text analysisGET /api/analytics/live- Real-time system analyticsGET /api/analytics/trending- Trending topics analysis
GET /api/history- Get post generation historyPOST /api/export- Export posts in various formatsGET /api/ab-testing/tests- A/B testing framework
curl -X POST http://localhost:8000/api/generate \
-H "Content-Type: application/json" \
-d '{
"length": "Medium",
"language": "English",
"tag": "Career",
"tone": "Professional"
}'PostyAI/
βββ app.py # Main Flask application with all API routes
βββ few_shot.py # Few-shot learning system for context
βββ post_generator.py # Core post generation logic
βββ llm_helper.py # LLM integration utilities
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (create this)
βββ data/
β βββ processed_posts.json # Training data (300+ LinkedIn posts)
βββ models/ # ML models and metadata
β βββ engagement_predictor_*.pkl # Various ML models
β βββ engagement_predictor_metadata.json
βββ static/
β βββ style.css # All CSS styles and themes
β βββ app.js # Frontend JavaScript logic
β βββ images/
β βββ favicon.svg # Animated favicon
βββ templates/
β βββ base.html # Base template for error pages
β βββ index.html # Main application interface
β βββ 404.html # Custom 404 page
β βββ 500.html # Custom 500 page
βββ src/
βββ ml/ # Machine Learning components
β βββ engagement_predictor.py
β βββ feature_engineering.py
β βββ train_models.py
βββ utils/ # Utility modules
βββ post_analytics.py # Post analysis functions
βββ real_time_analytics.py # Live analytics engine
βββ ab_testing.py # A/B testing framework
βββ caching.py # Redis caching system
- Random Forest (Primary): Best overall performance with 70%+ accuracy
- XGBoost: Gradient boosting for complex patterns
- LightGBM: Fast gradient boosting variant
- Gradient Boosting: Traditional ensemble method
- Ridge/Lasso/Elastic Net: Regularized linear models
- Support Vector Regression: Non-linear pattern recognition
Our ML pipeline extracts 60+ features from text:
- Engagement Features: Call-to-action detection, question count, curiosity indicators
- Sentiment Analysis: Emotional tone and polarity
- Complexity Metrics: Reading difficulty, cognitive load
- Format Features: Emoji usage, hashtag patterns, line structure
- Semantic Features: Vocabulary diversity, expertise indicators
- Industry Signals: Domain-specific terminology detection
- Primary Model RΒ² Score: 70%+ (Random Forest)
- Confidence Prediction: Available for all models
- Feature Importance: Transparency in prediction factors
- Fallback System: Heuristic-based predictions if ML fails
| Variable | Description | Required | Default |
|---|---|---|---|
GROQ_API_KEY |
Your Groq API key | β Yes | None |
FLASK_ENV |
Flask environment | β No | development |
FLASK_DEBUG |
Enable debug mode | β No | True |
- Single Generation: 5 requests per minute
- Batch Generation: 2 requests per 5 minutes
- Regeneration: 3 requests per minute
- ML Predictions: 10 requests per minute
python app.py # Runs on http://localhost:8000pip install gunicorn
gunicorn --bind 0.0.0.0:8000 --workers 4 app:app# Build image
docker build -t postyai .
# Run container
docker run -p 8000:8000 --env-file .env postyaiGROQ_API_KEY=your_production_api_key
FLASK_ENV=production
FLASK_DEBUG=False1. Import or Module Errors
# Ensure virtual environment is activated
source ml_env/bin/activate
pip install -r requirements.txt2. Missing API Key
# Check .env file exists and has correct format
cat .env
# Should show: GROQ_API_KEY=your_key_here3. Port Already in Use
# Kill existing processes on port 8000
lsof -ti:8000 | xargs kill -94. ML Model Loading Issues
- Models will fallback to heuristic predictions if loading fails
- Check
models/directory contains .pkl files and metadata.json - Verify Python version compatibility (tested with 3.13)
5. Performance Issues
- Enable Redis caching for production:
pip install redis - Check available memory for ML models (requires ~200MB)
- Consider using fewer models if memory is limited
Run with detailed logging:
FLASK_DEBUG=True python app.py- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test thoroughly with various inputs
- Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
- Follow Python PEP 8 style guidelines
- Add comprehensive error handling
- Test both API endpoints and UI functionality
- Update documentation for new features
- Ensure ML models have fallback mechanisms
This project is licensed under the MIT License - see the LICENSE file for details.
- Groq: For providing fast and reliable AI inference
- DeepSeek: For the powerful language model capabilities
- Flask: For the lightweight and flexible web framework
- Scikit-learn: For comprehensive machine learning tools
- The LinkedIn Community: For inspiring the training data patterns
If you encounter issues or have questions:
- Check the Troubleshooting section above
- Review the console/terminal output for error details
- Verify your
.envfile is properly configured - Test with a simple generation request first
For bug reports, please include:
- Python version (
python --version) - Error messages or stack traces
- Steps to reproduce the issue
- Your operating system
Ready to revolutionize your LinkedIn content strategy? Get your free Groq API key and start creating engaging posts that drive real engagement! π
Made with β€οΈ for content creators, marketers, and professionals who want to leverage AI for better social media presence.