--- license: apache-2.0 base_model: google/gemma-4-E4B-it base_model_relation: finetune library_name: transformers pipeline_tag: text-generation language: - en tags: - gguf - lora - music - lyrics - songwriting - text-to-music - gemma4 - kera ---

Kera

# Kera Songwriter Turns one line into **style tags, the vocal, tempo, key, a section-by-section plan and original lyrics** for an AI music generator. ## Stats | | | |---|---| | **Model size** | 8B parameters · 5.3 GB (Q4_K_M) | | **Time per song** | about 15 seconds per lyric | --- ## Run it ```bash kera serve -m kera-songwriter-e4b-Q4_K_M.gguf --alias songwriter -c 16384 -ngl 99 ``` | File | Size | Use | |---|---|---| | `kera-songwriter-e4b-Q4_K_M.gguf` | 5.3 GB | **Start here** | | `kera-songwriter-e4b-Q8_0.gguf` | 8.0 GB | Higher quality | | `kera-songwriter-e4b-BF16.gguf` | 15 GB | Full precision | | `model-*.safetensors` | 16 GB | transformers | | `lora/` | 77 MB | Just the fine-tune | ### llama.cpp Download and run it straight from Hugging Face: ```bash llama-server -hf KeraAI/kera-songwriter-e4b:Q4_K_M -c 16384 -ngl 99 --jinja ``` Or with a file you've downloaded: ```bash llama-server -m kera-songwriter-e4b-Q4_K_M.gguf -c 16384 -ngl 99 --jinja ``` Then ask it on `http://localhost:8080`: ```bash curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{ "temperature": 0.8, "top_p": 0.95, "max_tokens": 2400, "chat_template_kwargs": {"enable_thinking": false}, "messages": [ {"role": "system", "content": "You are Generators'\'' songwriter. From what the person asks for, plan the song for the music generator (style tags, vocal, tempo, key, time, length, section-by-section build with energy 1-10) and write original lyrics that fit it. Never use real songs'\'' lyrics or artists'\'' names."}, {"role": "user", "content": "dreamy synth-pop about driving home at 3am, female vocal, slow build\nLength: 3:30"} ]}' ``` ## Ask it Use this system prompt and turn thinking off. Temperature 0.8, top-p 0.95. ```text You are Generators' songwriter. From what the person asks for, plan the song for the music generator (style tags, vocal, tempo, key, time, length, section-by-section build with energy 1-10) and write original lyrics that fit it. Never use real songs' lyrics or artists' names. ``` ```text dreamy synth-pop about driving home at 3am, female vocal, slow build Length: 3:30 ``` It answers with `TAGS`, `VOCAL`, `BPM · KEY · TIME · LENGTH`, `PLAN`, `BRIEF` and `LYRICS`. Give your music model the tags as the style and the lyrics as the lyrics.
transformers ```python from transformers import AutoModelForCausalLM, AutoTokenizer repo = "KeraAI/kera-songwriter-e4b" tok = AutoTokenizer.from_pretrained(repo) model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", device_map="auto") SYSTEM = ("You are Generators' songwriter. From what the person asks for, plan the song for the music generator " "(style tags, vocal, tempo, key, time, length, section-by-section build with energy 1-10) and write " "original lyrics that fit it. Never use real songs' lyrics or artists' names.") msgs = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": "warm acoustic folk love song, male vocal, fingerpicked guitar\nLength: 3:00"}] ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True, enable_thinking=False).to(model.device) out = model.generate(**ids, max_new_tokens=2400, do_sample=True, temperature=0.8, top_p=0.95) print(tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True)) ```
How it was made - **Training method:** a LoRA fine-tune of Gemma 4 E4B it (rank 16, alpha 32), 7,000 steps on one DGX Spark, merged into the weights here. - **Data:** song facts from Wikipedia (CC BY-SA 4.0) and MusicBrainz/AcousticBrainz (CC0). Claude Sonnet 5.5 turned the facts into 7,134 lessons, each planning a *new* song in that style. No real lyrics were used. - **Limits:** it writes in English only. Read the lyrics before you release a song.
**Licence:** Apache 2.0. Gemma 4 is a model by Google DeepMind.