rin.kagamine e687f7d457 feat: Text generation suggestions via Gemini models
Backend:
- New text_gen.py module with Gemini text generation client
  - suggest_prompts(): generates 3 prompt suggestions from user input
  - get_text_gen_config(): loads config from .env (model, API key, safety)
  - get_available_models(): returns list of Gemini text models
  - Safety settings: harassment, hate_speech, sexually_explicit, dangerous
    Configurable via TEXT_GEN_SAFETY_* env vars (default: BLOCK_ONLY_HIGH)
- New endpoints:
  * POST /api/text-gen/suggest — generates 3 prompt suggestions
  * GET /api/text-gen/models — lists available text models
  * GET /api/text-gen/config — returns safe config (API key masked)
  * POST /api/text-gen/config — updates config in-memory
- Default model: gemini-2.5-flash
- Fallback API key: LYRIA_API_KEY if TEXT_GEN_API_KEY not set
- System prompt: expert music producer persona for rich musical detail

Frontend:
- New SuggestionsModal component for displaying generated suggestions
  - Auto-fetches when opened
  - Shows loading spinner, error state, or suggestion list
  - Each suggestion clickable to populate the prompt field
  - Hover effect: 'Click to use this prompt →'
- Generator component updated with 'Get Suggestions ✨' button
  - Appears next to prompt label in both Basic and Advanced modes
  - Disabled when no input present
  - Clicking suggestion populates the prompt/structured fields
- SettingsModal expanded with Text Generation section (collapsible)
  - Same pattern as Image Generation: model, API key status, safety filters
  - Editable dropdowns with Save Changes button
  - Refactored to use shared useGenSettings hook for both sections

Models Available:
- gemini-2.5-flash (GA, default) — best price-to-performance
- gemini-2.5-pro (GA) — highest quality reasoning
- gemini-3.5-flash (Preview) — next-gen Flash
- gemini-3.1-flash (Preview) — latest with thinking

Architecture KB and Tasks KB updated.
2026-05-29 22:37:35 -04:00

Lyria Studio

A webapp for generating, playing, and storing music clips using Google's Lyria music generation models.

Built by Kagamine Rin & Ryan.

Quick Start

# Backend
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd src
uvicorn main:app --reload

# Frontend (new terminal)
cd frontend
npm install
npm run dev

Architecture

  • Backend: FastAPI (Python) — async Lyria API client, SQLite metadata, file storage
  • Frontend: React + Vite + TypeScript + Tailwind — dark theme, audio player
  • Storage: SQLite for clip metadata, local filesystem for MP3 files

API

Endpoint Method Description
/api/health GET Health check
/api/generate POST Start clip generation
/api/clips GET List all clips
/api/clips/{id} GET Get clip metadata
/api/clips/{id}/audio GET Stream MP3
/api/clips/{id} DELETE Delete clip

Models

  • v0.1: Lyria 3 Clip Preview (30s, REST)
  • v0.2: Lyria 3 Pro (structure-aware, ~3min)
  • v0.3: Lyria RealTime (WebSocket streaming)

License

MIT — Hardcore will never die.

S
Description
A webapp for generating, playing, and storing music clips using Google's Lyria models
Readme MIT
1.7 MiB
0 Stars 2 Watchers 0 Forks
Languages
TypeScript 51.8%
Python 47.4%
JavaScript 0.3%
Dockerfile 0.2%
CSS 0.2%
Other 0.1%