{"slug": "ai-lyrics-generator", "title": "AI-Lyrics-Generator", "summary": "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.", "body_md": "This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend\n\nWhat I Built\n\nI built AI Lyrics Generator, a local AI-powered web application that helps a friend turn an idea, topic, or feeling into an original song.\n\nThe 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:\n\n🎵 Song name or topic\n\n🎸 Genre\n\n😊 Mood\n\n🌍 Language\n\n📝 Number of verses\n\nThe application then generates an original song structure with sections such as verses, chorus, bridge, and final chorus.\n\nThe project runs locally using Qwen2.5-Coder 3B through Ollama, with a FastAPI backend and a lightweight HTML/CSS/JavaScript frontend.\n\nThe main problem I'm solving is making AI-assisted songwriting simple, accessible, and local.\n\nDemo\n\n🎥 Demo Video: Coming soon\n\n🌐 Live Demo: Coming soon\n\nThe application can be run locally with Ollama, so users don't need a cloud AI API to generate lyrics.\n\nCode\n\nGitHub Repository\n\nAI-Lyrics-Generator\n\n[https://github.com/Bharatefb/AI-Lyrics-Generator](https://github.com/Bharatefb/AI-Lyrics-Generator)\n\nThe repository contains the complete frontend, FastAPI backend, prompt logic, and setup instructions.\n\nProject Architecture\n\n                 ┌─────────────────────┐\n\n                 │       Browser       │\n\n                 │                     │\n\n                 │  Song / Topic       │\n\n                 │  Genre              │\n\n                 │  Mood               │\n\n                 │  Language           │\n\n                 │  Verse Count        │\n\n                 └──────────┬──────────┘\n\n                            │\n\n                         HTTP POST\n\n                            │\n\n                            ▼\n\n                 ┌─────────────────────┐\n\n                 │       FastAPI       │\n\n                 │                     │\n\n                 │      /generate     │\n\n                 └──────────┬──────────┘\n\n                            │\n\n                            ▼\n\n                 ┌─────────────────────┐\n\n                 │       Ollama        │\n\n                 │                     │\n\n                 │ qwen2.5-coder:3b    │\n\n                 └──────────┬──────────┘\n\n                            │\n\n                            ▼\n\n                 ┌─────────────────────┐\n\n                 │   Generated Lyrics  │\n\n                 └──────────┬──────────┘\n\n                            │\n\n                            ▼\n\n                 ┌─────────────────────┐\n\n                 │       Browser       │\n\n                 │                     │\n\n                 │  [Verse 1]          │\n\n                 │  [Chorus]           │\n\n                 │  [Verse 2]          │\n\n                 │  [Bridge]           │\n\n                 │  [Final Chorus]     │\n\n                 └─────────────────────┘\n\nHow I Built It\n\nThe project is built around open-weight AI and local inference.\n\nAI Model\n\nI use:\n\nQwen2.5-Coder 3B\n\nthrough:\n\nOllama\n\nThe model runs locally on the user's machine rather than requiring a remote AI API.\n\nBackend\n\nThe backend is written in:\n\nPython\n\nFastAPI\n\nPydantic\n\nRequests\n\nUvicorn\n\nThe frontend sends the user's song requirements to the FastAPI /generate endpoint.\n\nFastAPI then builds a structured prompt and sends it to the local Ollama API.\n\nBrowser\n\n   ↓\n\nPOST /generate\n\n   ↓\n\nFastAPI\n\n   ↓\n\nOllama\n\n   ↓\n\nqwen2.5-coder:3b\n\n   ↓\n\nGenerated lyrics\n\n   ↓\n\nBrowser\n\nFrontend\n\nThe frontend uses standard web technologies:\n\nHTML\n\nCSS\n\nJavaScript\n\nNo large frontend framework is required, keeping the project simple and easy to understand.\n\nPrompt Design\n\nInstead of simply asking the model:\n\nWrite a song about summer.\n\nthe application provides structured information:\n\nSong/topic: Summer Love\n\nGenre: Pop\n\nMood: Happy\n\nLanguage: English\n\nNumber of verses: 3\n\nThe model is instructed to create completely original lyrics and organize them into a recognizable song structure.\n\nFor example:\n\n[Verse 1]\n\n...\n\n[Pre-Chorus]\n\n[Chorus]\n\n[Verse 2]\n\n[Bridge]\n\n[Final Chorus]\n\nLocal AI\n\nOne of the key parts of the project is that the AI inference happens locally.\n\nAfter installing Ollama and the model:\n\nollama pull qwen2.5-coder:3b\n\nthe application can communicate with the local Ollama API.\n\nThis means the basic application does not require an OpenAI, Anthropic, Gemini, or other paid cloud AI API.\n\nWhy Does Open Innovation Matter?\n\nOpen innovation made this project possible because I could build around an openly available model and run inference locally.\n\nA closed AI API would certainly make the implementation possible, but local open-weight inference gives the project some important advantages.\n\n🔒 More control\n\nThe user controls where the model runs and how the application communicates with it.\n\n💻 Local-first development\n\nThe project can be developed and tested without requiring a cloud AI account or API key.\n\n💰 Lower barrier to experimentation\n\nAnyone with suitable hardware can experiment with the application without paying for every generated song.\n\n🧑💻 Learning and customization\n\nBecause the application controls the prompt, backend, frontend, and model connection, developers can modify the entire pipeline.\n\nThey can experiment with:\n\nPrompt engineering\n\nDifferent models\n\nTemperature settings\n\nSong structures\n\nLanguages\n\nGenres\n\nUI features\n\nLocal AI workflows\n\n🌍 Open innovation encourages experimentation\n\nThe most interesting part for me is that the AI is not treated as a black box.\n\nThe project connects an open model, local inference, a Python backend, and a web interface into one small application.\n\nThat makes it easier to learn how AI applications actually work from end to end.\n\nMy Agent Session\n\nI did not use DevRelay for this project.\n\nPrize Categories\n\nThe project is primarily entering the categories related to:\n\n🤖 Open-source AI / open-weight models\n\n🖥️ Local AI / local inference\n\n🧑💻 Developer tools and AI applications\n\nProject Stack\n\nAI Model       → Qwen2.5-Coder 3B\n\nInference      → Ollama\n\nBackend        → Python + FastAPI\n\nFrontend       → HTML + CSS + JavaScript\n\nAPI            → REST / JSON\n\nRuntime        → Local machine\n\nRunning the Project Locally\n\nClone the repository:\n\ngit clone [https://github.com/Bharatefb/AI-Lyrics-Generator.git](https://github.com/Bharatefb/AI-Lyrics-Generator.git)\n\ncd AI-Lyrics-Generator\n\nInstall and run the Qwen model:\n\nSet up the backend:\n\ncd backend\n\npython -m venv venv\n\nOn Windows:\n\nvenv\\Scripts\\activate\n\nOn macOS/Linux:\n\nsource venv/bin/activate\n\nInstall dependencies:\n\npip install -r requirements.txt\n\nStart FastAPI:\n\nuvicorn main:app --reload --port 8000\n\nThen open the frontend using a local development server such as VS Code Live Server.\n\nWhat's Next?\n\nI plan to continue improving the project with features such as:\n\n🔄 Generate Again\n\n📋 Copy Lyrics\n\n💾 Download Lyrics\n\n📝 Edit generated lyrics\n\n📚 Song history\n\n🌍 Better multilingual support\n\n🎤 More vocal and writing controls\n\n🎶 Custom verse/chorus structures\n\n🎨 Improved UI\n\n🌙 Dark/light mode\n\n⚡ Streaming generation\n\nThe long-term goal is to make AI-assisted songwriting a simple local-first experience that anyone can experiment with.\n\nBuilt with ❤️, open-source AI, and a little musical inspiration.\n\nThanks for checking out AI-Lyrics-Generator! 🎵", "url": "https://wpnews.pro/news/ai-lyrics-generator", "canonical_source": "https://dev.to/bscdevloper/ai-lyrics-generator-2oec", "published_at": "2026-10-04 17:03:25+00:00", "updated_at": "2026-10-04 17:12:56.588275+00:00", "lang": "en", "topics": ["ai-tools", "generative-ai", "large-language-models", "developer-tools"], "entities": ["AI Lyrics Generator", "Qwen2.5-Coder 3B", "Ollama", "FastAPI", "GitHub", "Bharatefb"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/ai-lyrics-generator", "markdown": "https://wpnews.pro/news/ai-lyrics-generator.md", "text": "https://wpnews.pro/news/ai-lyrics-generator.txt", "jsonld": "https://wpnews.pro/news/ai-lyrics-generator.jsonld"}}