This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
I built AI Lyrics Generator, a local AI-powered web application that helps a friend turn an idea, topic, or feeling into an original song.
The goal was simple: instead of struggling with a blank page or needing access to a paid AI service, my friend can enter a few details such as:
π΅ Song name or topic
πΈ Genre
π Mood
π Language
π Number of verses
The application then generates an original song structure with sections such as verses, chorus, bridge, and final chorus.
The project runs locally using Qwen2.5-Coder 3B through Ollama, with a FastAPI backend and a lightweight HTML/CSS/JavaScript frontend.
The main problem I'm solving is making AI-assisted songwriting simple, accessible, and local.
Demo
π₯ Demo Video: Coming soon
π Live Demo: Coming soon
The application can be run locally with Ollama, so users don't need a cloud AI API to generate lyrics.
Code
GitHub Repository
AI-Lyrics-Generator
[https://github.com/Bharatefb/AI-Lyrics-Generator](https://github.com/Bharatefb/AI-Lyrics-Generator)
The repository contains the complete frontend, FastAPI backend, prompt logic, and setup instructions.
Project Architecture
βββββββββββββββββββββββ
β Browser β
β β
β Song / Topic β
β Genre β
β Mood β
β Language β
β Verse Count β
ββββββββββββ¬βββββββββββ
β
HTTP POST
β
βΌ
βββββββββββββββββββββββ
β FastAPI β
β β
β /generate β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Ollama β
β β
β qwen2.5-coder:3b β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Generated Lyrics β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Browser β
β β
β [Verse 1] β
β [Chorus] β
β [Verse 2] β
β [Bridge] β
β [Final Chorus] β
βββββββββββββββββββββββ
How I Built It
The project is built around open-weight AI and local inference.
AI Model
I use:
Qwen2.5-Coder 3B
through:
Ollama
The model runs locally on the user's machine rather than requiring a remote AI API.
Backend
The backend is written in:
Python
FastAPI
Pydantic
Requests
Uvicorn
The frontend sends the user's song requirements to the FastAPI /generate endpoint.
FastAPI then builds a structured prompt and sends it to the local Ollama API.
Browser
β
POST /generate
β
FastAPI
β
Ollama
β
qwen2.5-coder:3b β
Generated lyrics
β
Browser
Frontend
The frontend uses standard web technologies:
HTML
CSS
JavaScript
No large frontend framework is required, keeping the project simple and easy to understand.
Prompt Design
Instead of simply asking the model:
Write a song about summer.
the application provides structured information:
Song/topic: Summer Love
Genre: Pop
Mood: Happy
Language: English
Number of verses: 3
The model is instructed to create completely original lyrics and organize them into a recognizable song structure.
For example:
[Verse 1]
...
[Pre-Chorus]
[Chorus]
[Verse 2]
[Bridge]
[Final Chorus]
Local AI
One of the key parts of the project is that the AI inference happens locally.
After installing Ollama and the model:
ollama pull qwen2.5-coder:3b the application can communicate with the local Ollama API.
This means the basic application does not require an OpenAI, Anthropic, Gemini, or other paid cloud AI API.
Why Does Open Innovation Matter?
Open innovation made this project possible because I could build around an openly available model and run inference locally.
A closed AI API would certainly make the implementation possible, but local open-weight inference gives the project some important advantages.
π More control
The user controls where the model runs and how the application communicates with it.
π» Local-first development
The project can be developed and tested without requiring a cloud AI account or API key.
π° Lower barrier to experimentation
Anyone with suitable hardware can experiment with the application without paying for every generated song.
π§π» Learning and customization
Because the application controls the prompt, backend, frontend, and model connection, developers can modify the entire pipeline.
They can experiment with:
Prompt engineering
Different models
Temperature settings
Song structures
Languages
Genres
UI features
Local AI workflows
π Open innovation encourages experimentation
The most interesting part for me is that the AI is not treated as a black box.
The project connects an open model, local inference, a Python backend, and a web interface into one small application.
That makes it easier to learn how AI applications actually work from end to end.
My Agent Session
I did not use DevRelay for this project.
Prize Categories
The project is primarily entering the categories related to:
π€ Open-source AI / open-weight models π₯οΈ Local AI / local inference
π§π» Developer tools and AI applications
Project Stack
AI Model β Qwen2.5-Coder 3B
Inference β Ollama
Backend β Python + FastAPI
Frontend β HTML + CSS + JavaScript
API β REST / JSON
Runtime β Local machine
Running the Project Locally
Clone the repository:
git clone [https://github.com/Bharatefb/AI-Lyrics-Generator.git](https://github.com/Bharatefb/AI-Lyrics-Generator.git)
cd AI-Lyrics-Generator
Install and run the Qwen model:
Set up the backend:
cd backend
python -m venv venv
On Windows:
venv\Scripts\activate
On macOS/Linux:
source venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Start FastAPI:
uvicorn main:app --reload --port 8000 Then open the frontend using a local development server such as VS Code Live Server.
What's Next?
I plan to continue improving the project with features such as:
π Generate Again
π Copy Lyrics
πΎ Download Lyrics
π Edit generated lyrics
π Song history
π Better multilingual support
π€ More vocal and writing controls
πΆ Custom verse/chorus structures
π¨ Improved UI
π Dark/light mode
β‘ Streaming generation
The long-term goal is to make AI-assisted songwriting a simple local-first experience that anyone can experiment with.
Built with β€οΈ, open-source AI, and a little musical inspiration.
Thanks for checking out AI-Lyrics-Generator! π΅