A small full-stack app that accepts unstructured text and returns a structured summary using an LLM API.
Built as part of the AI Developer Intern take-home assignment.
Live url : https://assignment-summarizer.netlify.app/
- Frontend: React + Vite
- Backend: Node.js + Express
- LLM: Groq API (llama3-8b-8192)
- Other: dotenv, cors
git clone <your-repo-url>
cd assignment-summarizercd server
npm install
cp .env.example .envOpen .env and add your Groq API key:
GROQ_API_KEY=your_groq_api_key_here
Start the backend:
npm run devServer runs on http://localhost:3000
Open a new terminal:
cd client
npm install
npm run devFrontend runs on http://localhost:5173
I used Groq with the llama3-8b-8192 model for two reasons:
- It has a generous free tier with high rate limits — reliable for demos without hitting quota issues.
- Its API is OpenAI-compatible, which keeps the integration simple and easy to swap out if needed.
The prompt instructs the model to act as a strict JSON extractor, not a conversational assistant. It defines the exact output shape, constrains the sentiment to three allowed values, and explicitly forbids markdown or extra keys.
This reduces the chance of malformed output without needing complex post-processing. A lower temperature (0.3) further keeps the output consistent.
Input:
NASA's Perseverance rover has been exploring Mars since February 2021.
It has collected rock samples, studied the Martian atmosphere, and
helped test oxygen production on the planet. Scientists are excited
about the potential clues these samples may offer about ancient life on Mars.
Output:
{
"summary": "NASA's Perseverance rover has been actively exploring Mars since 2021, collecting samples and conducting experiments that could reveal evidence of ancient life.",
"keyPoints": [
"Perseverance has collected rock samples and studied the Martian atmosphere",
"The rover successfully tested oxygen production on Mars",
"Scientists believe the samples may contain clues about ancient Martian life"
],
"sentiment": "positive"
}- Used a simple fixed output schema instead of supporting user-defined fields — sufficient for the assignment scope.
- Kept a single backend route rather than splitting into service layers — easier to read and explain.
- No authentication — not needed for a local assignment demo.
- No test coverage — kept within the 1–2 hour time budget.
- Add file upload support so users can summarize
.txtfiles directly - Stream the LLM response for faster perceived performance
- Add schema validation on the LLM output using
zod - Support batch processing of multiple texts
