{"slug": "the-ghost-doesn-t-need-the-cloud-building-a-local-ai-music-curator-with-gemma-3", "title": "The Ghost Doesn't Need the Cloud: Building a Local AI Music Curator with Gemma 3", "summary": "A developer built GhostWave, an open-source, local-first music player and crate manager that uses the open-weight Gemma 3 model via Ollama to organize and curate personal music libraries without a remote LLM API. The app serializes only compact track metadata for the model and validates AI-proposed track IDs against real library records rather than trusting generated IDs. It also includes an audio-reactive visualizer and a Tauri desktop build.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine](https://dev.to/challenges/hacktoberfest-week4-2026-10-26)*\n\n**GhostWave** is an open-source, local-first music player, crate manager, and audio-reactive visualizer with a Halloween-inspired design.\n\nIt is built around a simple idea: **your music library should remain useful even when the cloud isn't.**\n\nMost of us have personal music collections that have accumulated over the years: FLAC albums, MP3 downloads, anime soundtracks, Vocaloid tracks, live recordings, and music that might not even be available on streaming platforms anymore.\n\nBut having the files is only half the problem. Libraries become messy. Metadata goes missing. Filenames become inconsistent. Finding the right tracks for a particular mood can take longer than actually listening to them.\n\nGhostWave brings those tasks together in one application:\n\nThe central feature is the **Ghost in the Machine**: an open-weight AI model that can help organize your music collection without requiring a remote LLM API.\n\n**Watch the product film:**\n\n**Links:**\n\nThe product film combines animated product storytelling with recorded application footage. The external metadata responses shown in the scripted walkthrough are demonstration fixtures, not evidence that those particular lookups were performed against live services.\n\n**A spooky, local-first music player, crate manager, and audio-reactive visualizer powered by local open-weight AI (Gemma 3 via Ollama).**\n\n[The Origin Story](https://github.com/edgiaxel/GhostWave#-the-ghost-in-the-machine-origin-story) •\n  [Key Features](https://github.com/edgiaxel/GhostWave#-key-features) •\n  [Architecture](https://github.com/edgiaxel/GhostWave#-architecture) •\n  [Getting Started](https://github.com/edgiaxel/GhostWave#-getting-started) •\n  [Local AI Setup](https://github.com/edgiaxel/GhostWave#-running-local-ai-gemma-3) •\n  [Tauri Desktop](https://github.com/edgiaxel/GhostWave#-tauri-desktop-app) •\n  [QA & Testing](https://github.com/edgiaxel/GhostWave#-testing--verification) •\n  [Deployment](https://github.com/edgiaxel/GhostWave#-deployment-render)\n\n*(An imagined product scenario inspired by seasonal thunderstorms and connectivity concerns)*\n\nImagine Halloween Eve. Outside, a violent seasonal thunderstorm batters the neighborhood. The grid blinks—and the house plunges into darkness.\n\nWhen power snaps back on ten minutes later, the internet connection is dead. A gathering of friends is waiting for music, but the host's phone streaming app hangs on a spinning wheel: **buffering error 404, no connection**.\n\nAn offline backup drive of local music is plugged in—thousands of anime themes, Vocaloid tracks, electronic synths, and classical recordings. But…\n\nThe most interesting part of the project is how GhostWave turns an AI-generated playlist idea into a proposal grounded in the user's actual music library.\n\nHere are two important parts of that implementation.\n\n**1. Serialize only the metadata needed by the model**\n\nInstead of sending audio files or local file paths to the AI, GhostWave builds a compact catalog containing track metadata:\n\n```\nstatic serializeLibrary(\n  tracks: Track[]\n): CompactTrackSummary[] {\n  return tracks.map((t) => ({\n    id: t.id,\n    title: t.title,\n    artist: t.artist,\n    album: t.album,\n    genre: t.genre?.length\n      ? t.genre\n      : undefined,\n    durationSeconds: t.durationSeconds,\n    format: t.format,\n    bitrateKbps: t.bitrateKbps,\n    year: t.year,\n  }));\n}\n```\n\nThis gives the model enough context to make selections without including the actual audio bytes or filesystem paths.\n\n**2. Resolve AI suggestions against real library records**\n\nAn LLM can generate an ID that looks valid but does not exist. GhostWave doesn't blindly trust the response.\n\nThe service resolves proposed IDs against the actual library:\n\n``` js\nconst trackMap = new Map(\n  allTracks.map((track) => [track.id, track])\n);\n\nconst matched: Track[] = [];\nconst hallucinatedTrackIds: string[] = [];\n\nfor (const id of plan.matchedTrackIds) {\n  const track = trackMap.get(id);\n\n  if (track) {\n    if (!matched.some((item) => item.id === track.id)) {\n      matched.push(track);\n    }\n  } else {\n    hallucinatedTrackIds.push(id);\n  }\n}\n```\n\nUnknown IDs are rejected, duplicate selections are avoided, and duration and track-count constraints are enforced by application code rather than trusting the model's arithmetic.\n\nThe result is a **playlist proposal**, not an unrestricted AI operation. The user can inspect the selected tracks before saving the crate.\n\nRelevant implementation: [`AiPlaylistService.ts`](https://github.com/edgiaxel/GhostWave/blob/main/src/services/ai/AiPlaylistService.ts).\n\nGhostWave uses a modular TypeScript architecture with React on the frontend and a collection of focused services for audio, AI, metadata, history, and platform integration.\n\n**Technology stack:**\n\n`music-metadata-browser`.` gemma3:4b`) through Ollama.\nThe AI workflow is deliberately separated into several stages:\n\nThe model is instructed to return a structured response resembling this:\n\n```\n{\n  \"name\": \"Fast Electronic Workout\",\n  \"description\": \"High-energy electronic tracks\",\n  \"matchedTrackIds\": [\n    \"track-001\",\n    \"track-014\",\n    \"track-027\"\n  ],\n  \"explanation\": \"Selected for energetic genres and tempo.\"\n}\n```\n\nThe response is not accepted just because it is valid JSON. The application checks its required fields and verifies the proposed IDs against real track records.\n\nGhostWave uses Ollama's local API rather than a hosted LLM API.\n\n```\n# Download the model\nollama pull gemma3:4b\n\n# Start the Ollama service\nollama serve\n```\n\nThe default local endpoint is:\n\n```\nhttp://127.0.0.1:11434\n```\n\nThe model must be installed and Ollama must be running for local AI features to work. The core music library and playback features do not depend on Gemma.\n\nThe project currently reports:\n\nThe automated checks cover library operations, playback, visualizers, playlist management, AI workflows, metadata handling, and other application features.\n\nSome external-provider responses are mocked in automated tests so that the tests remain reproducible. This is different from testing against live third-party services.\n\nMusic collections are personal. They contain more than just audio files: they preserve memories, interests, and years of discovery.\n\nA closed AI service can be convenient, but it also introduces dependencies. Your application may depend on an external API, its pricing, its availability, and the data you must send to use it.\n\nOpen-weight models and open-source tools give developers another option.\n\nWith Gemma 3 and Ollama, GhostWave can perform its playlist-curation inference locally. The model does not need a remote LLM subscription, and the catalog sent to that local inference process does not need to include audio files or filesystem paths.\n\nIt also means developers can inspect and adapt the implementation instead of treating the intelligence as an inaccessible service.\n\nThere are still important boundaries:\n\nOpen innovation does not automatically make every integration private or offline. It gives developers the tools and freedom to build systems where those boundaries can be understood, inspected, and controlled.\n\nFor GhostWave, that means keeping the core music experience local while making external services optional.\n\n*An imagined scenario inspired by seasonal thunderstorms and connectivity concerns.*\n\nImagine Halloween Eve.\n\nYou're hosting a small gathering with friends. The weather outside is getting rough, and the internet connection suddenly becomes unreliable.\n\nSomeone tries to start a playlist through a streaming service. It buffers. Then it stops.\n\nFortunately, you have a local music collection: years of Vocaloid tracks, anime soundtracks, synthwave, electronic music, and other recordings.\n\nBut there's another problem. The library is messy. Some tracks have missing tags, filenames are inconsistent, and finding the right music for the evening is becoming a project of its own.\n\nThat's the situation GhostWave was designed around.\n\nYou open your local library, ask Gemma 3 for a spooky electronic playlist, review its suggestions, and start playing. The visualizer responds to the music while the rest of the gathering carries on.\n\nNo dramatic cloud infrastructure required. Just your music, your machine, and a little ghost in the machine.\n\n**Hacktoberfest Open-Source AI Challenge — Ghost in the Machine**\n\n**Google Cloud / Gemma**\n\n**Sentry**\n\n**SerpApi**\n\nBuilt with React, TypeScript, Gemma 3, Ollama, and a lot of love for local music libraries.\n\nThanks to DEV, GitHub, and MLH for organizing Hacktoberfest 2026!", "url": "https://wpnews.pro/news/the-ghost-doesn-t-need-the-cloud-building-a-local-ai-music-curator-with-gemma-3", "canonical_source": "https://dev.to/edgiaxel/the-ghost-doesnt-need-the-cloud-building-a-local-ai-music-curator-with-gemma-3-38", "published_at": "2026-10-31 20:45:00+00:00", "updated_at": "2026-10-31 20:52:20.208955+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-tools", "ai-products", "developer-tools"], "entities": ["GhostWave", "Gemma 3", "Ollama", "Tauri", "Hacktoberfest"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/the-ghost-doesn-t-need-the-cloud-building-a-local-ai-music-curator-with-gemma-3", "markdown": "https://wpnews.pro/news/the-ghost-doesn-t-need-the-cloud-building-a-local-ai-music-curator-with-gemma-3.md", "text": "https://wpnews.pro/news/the-ghost-doesn-t-need-the-cloud-building-a-local-ai-music-curator-with-gemma-3.txt", "jsonld": "https://wpnews.pro/news/the-ghost-doesn-t-need-the-cloud-building-a-local-ai-music-curator-with-gemma-3.jsonld"}}