This project is an Express.js application that generates professional cover letters using your CV (PDF) and a Job Description. It uses Ollama for local LLM inference and embeddings.
- Upload a PDF CV
- Extracts text content from the PDF
- Generates vector embeddings using
ollama(model:gemma:2b) - Creates a tailored, AI-generated cover letter using your CV and job description
Before running the app, ensure you have the following installed:
-
Node.js (version ≥ 18)
-
Ollama (for local model inference)
-
Model pulled locally:
ollama pull gemma:2b
-
Clone this repository
git clone https://github.com/abdulganiyy/cvwriter.git cd cvwriter -
Install dependencies
npm install
-
Make sure Ollama is running locally
-
Open a terminal and start Ollama if it’s not running:
ollama serve
-
Verify it works:
ollama list
-
Start the development server:
node index.jsBy default, the server will start at:
http://localhost:8000
Generates a cover letter based on the uploaded CV and job description.
{
"fileContent": "<base64-encoded PDF data>",
"description": "Software engineer position focusing on full-stack web development..."
}{
"coverLetter": "Dear Hiring Manager, ..."
}.
├── build/ # Optional frontend build (e.g., React app)
├── index.js # Main Express app
├── package.json
└── README.md
-
You can integrate a frontend that uploads the CV (PDF) and job description via
fetch('/upload'). -
The current embedding model is
gemma:2b. You can switch to another available embedding model by changing:model: "gemma:2b";
to something like
"Qwen2:0.5b" -
Ensure your machine has enough RAM and CPU to run
gemma:2b.
const handleUpload = async (pdfBase64, description) => {
const res = await fetch("http://localhost:8000/upload", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
fileContent: pdfBase64,
description,
}),
});
const data = await res.json();
console.log("Generated Cover Letter:", data.coverLetter);
};