cd /news/ai-tools/ai-lyrics-generator Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-144924] src=dev.to β†— pub= topic=ai-tools verified=true sentiment=↑ positive

AI-Lyrics-Generator

A developer built AI Lyrics Generator, a local web application that turns a topic, genre, mood, language and verse count into an original song structure with verses, chorus and bridge. The project pairs a FastAPI backend with a lightweight HTML/CSS/JavaScript frontend and runs the Qwen2.5-Coder 3B model locally through Ollama, so users do not need a cloud AI API to generate lyrics.

by read5 min views2 publishedOct 4, 2026

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! 🎡

── more in #ai-tools 4 stories Β· sorted by recency
── more on @ai lyrics generator 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/ai-lyrics-generator] indexed:0 read:5min 2026-10-04 Β· β€”