Automated pipeline for creating personalized cover letters:
- Data Collection: Clipping job postings from Notion (or another source).
- Processing & Generation: Using an LLM (via Outlines) to produce a structured cover letter.
- PDF Output: Generating final PDF cover letters using LaTeX templates.
- Orchestration: Optional Zapier integration for automation, or direct polling/webhook triggers.
- Notion Integration: Seamlessly clip job postings into your Notion database.
- LLM-driven Generation: Uses open-source LLMs (LLaMA, Mistral) or fallback to GPT-4/Claude.
- Structured Output: Enforced JSON schema via Outlines, ensuring reliable cover letter segments.
- Latex PDF Generation: Fills a TeX template, automatically produces professional PDFs.
- Dockerized: Simple deployment with docker-compose.
.
├─.venv/ # Local virtual environment (Windows or Unix)
├─.venv-3.13/ # Another local virtual environment for Python 3.13
├─assets/ # Images or static assets
├─config/ # Configuration files (YAML, TOML, etc.)
├─cover_letters/ # Generated PDFs or letter drafts
├─data/ # If you store CSV/JSON data or intermediate results
├─docs/ # Documentation (api, dev, user)
├─examples/ # Example scripts or usage demos
├─logs/ # Log files
├─requirements.lock # Locked dependencies
├─requirements.txt # Main Python dependencies
├─scripts/ # Setup or utility scripts
│ ├─setup/
│ └─tools/
├─src/
│ ├─api/
│ ├─core/
│ ├─server/
│ │ └─webhook_server.py # A Flask or FastAPI server for receiving triggers
│ └─utils/
├─templates/
│ ├─awesome-cv.cls # CV style (from Awesome-CV)
│ ├─awesome_cv_cover_letter_template.tex
│ └─coverletter.tex # A simpler cover letter template
├─tests/
│ ├─fixtures/
│ ├─integration/
│ └─unit/
├─Dockerfile
├─docker-compose.yml
├─README.md # You're reading it now
└─...
Below is the core list of dependencies you'll need outside of Python:
- Python 3.9+
- Recommended to use Python 3.11 or 3.12, or you can try 3.13 if you're prepared to compile Rust code for certain packages.
- Rust toolchain (if needed for outlines-core compilation)
- On Windows, Install Rust via rustup.
- On Unix, install via your package manager or rustup.
- TeX distribution
- On Windows: MiKTeX or TeX Live.
- On Unix: sudo apt-get install texlive-latex-extra texlive-xetex (or distro equivalent).
- Docker (optional)
- If you prefer containerized deployment.
All Python libraries are listed in requirements.txt. Key libraries include:
- Outlines for structured generation.
- PyTorch or Transformers (depending on your open-source LLM usage).
- Flask or FastAPI if you run a server.
- requests or any HTTP library for triggers/integrations.
-
Install Python
- Get the latest Python 3.x from python.org.
- During install, check "Add Python to PATH."
-
(Optional) Install Rust
- If outlines-core needs to compile from source (no pre-built wheel for your Python version).
- Download from rustup.rs → run the .exe.
-
Install a TeX Distribution
- MiKTeX or TeX Live for Windows.
-
Create & Activate Virtual Environment
# In your project folder:
python -m venv .venv
.\.venv\Scripts\activate
- Install Python Dependencies
pip install --upgrade pip
pip install -r requirements.txt
- Verify
# Example check
python -m outlines --version
- Install Python
- Use your package manager or python.org.
- e.g., on Ubuntu:
sudo apt-get update
sudo apt-get install python3 python3-venv python3-pip
-
(Optional) Install Rust
- If needed for building outlines-core.
- e.g.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install a TeX Distribution
- e.g.
sudo apt-get install texlive-latex-extra texlive-xetex.
- e.g.
-
Create & Activate Virtual Environment
python3 -m venv .venv
source .venv/bin/activate
- Install Python Dependencies
pip install --upgrade pip
pip install -r requirements.txt
- Verify
python -m outlines --version
-
Install Docker
- Windows: Docker Desktop
- macOS: Docker Desktop or
brew cask install docker - Linux: Check your distro's repo or Docker Docs
-
Build Image
docker build -t cover-letter-app .
- Run Container
docker run -p 8080:8080 cover-letter-app
- (Optional) docker-compose
- Use the provided docker-compose.yml if you have multiple services or want a simpler spin-up:
docker-compose up --build
- This approach ensures a consistent environment across all platforms.
- Start Your Backend (Locally or via Docker)
- If local (without Docker):
# Still in your .venv
python src/server/webhook_server.py
- If Docker:
docker-compose up
-
Add a Job Posting
- For example, in Notion, create a new entry in your "Job Postings" database.
- If using Zapier or a custom script, it triggers the endpoint (e.g. POST /generate-letter).
-
Cover Letter Generated
- The LLM processes it via Outlines, ensures JSON format.
- A LaTeX template is filled, compiled to PDF, and saved in ./cover_letters.
-
Review the PDF
- Check in cover_letters/YourCoverLetter.pdf.
You can use a .env file or system environment variables to store:
| Variable Name | Description | Example |
|---|---|---|
| OPENAI_API_KEY | API key if using GPT-4 fallback. | sk-ABC123 |
| NOTION_API_TOKEN | If using direct Notion API polling. | secret_... |
| FLASK_ENV | Set to development or production. | development |
(Ensure .env is in your .gitignore to avoid committing secrets.)
- Code Linting
- Use a linter (flake8, black, ruff) for consistent style:
pip install black
black src/
- Unit Tests
- Place unit tests under tests/unit/.
- Example:
pytest tests/unit
- Integration Tests
- Check pipeline flow from Notion input to PDF output.
- Place them in tests/integration/.
- Add Kubernetes Deployment: Helm chart for scaling multiple LLM containers.
- Switch/Upgrade Models: Try LLaMA-2-13B, Mistral, or a fine-tuned version for better cover letters.
- Retrieval-Augmented Generation: Store resume or user data in a vector DB for highly contextual letters.
- User Interface: A small React/Flask front end for easier manual triggers.
- CI/CD: GitHub Actions to run tests, build Docker images automatically.
MIT License – Feel free to use or adapt this project for your own purposes. (Replace with your actual chosen license.)
- Open an issue on GitHub or create a Pull Request.
- Feel free to reach out with suggestions, feature requests, or bug reports!
Happy Generating!