Instructions to use KeraAI/kera-songwriter-e4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KeraAI/kera-songwriter-e4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KeraAI/kera-songwriter-e4b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("KeraAI/kera-songwriter-e4b") model = AutoModelForMultimodalLM.from_pretrained("KeraAI/kera-songwriter-e4b", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use KeraAI/kera-songwriter-e4b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf KeraAI/kera-songwriter-e4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf KeraAI/kera-songwriter-e4b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf KeraAI/kera-songwriter-e4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf KeraAI/kera-songwriter-e4b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf KeraAI/kera-songwriter-e4b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf KeraAI/kera-songwriter-e4b:Q4_K_M
Use Docker
docker model run hf.co/KeraAI/kera-songwriter-e4b:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use KeraAI/kera-songwriter-e4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KeraAI/kera-songwriter-e4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KeraAI/kera-songwriter-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KeraAI/kera-songwriter-e4b:Q4_K_M
- SGLang
How to use KeraAI/kera-songwriter-e4b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "KeraAI/kera-songwriter-e4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KeraAI/kera-songwriter-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "KeraAI/kera-songwriter-e4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KeraAI/kera-songwriter-e4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use KeraAI/kera-songwriter-e4b with Ollama:
ollama run hf.co/KeraAI/kera-songwriter-e4b:Q4_K_M
- Unsloth Desktop
- Pi
How to use KeraAI/kera-songwriter-e4b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KeraAI/kera-songwriter-e4b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "KeraAI/kera-songwriter-e4b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use KeraAI/kera-songwriter-e4b with Docker Model Runner:
docker model run hf.co/KeraAI/kera-songwriter-e4b:Q4_K_M
- Lemonade
How to use KeraAI/kera-songwriter-e4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull KeraAI/kera-songwriter-e4b:Q4_K_M
Run and chat with the model
lemonade run user.kera-songwriter-e4b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use KeraAI/kera-songwriter-e4b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KeraAI/kera-songwriter-e4b:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default KeraAI/kera-songwriter-e4b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use KeraAI/kera-songwriter-e4b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KeraAI/kera-songwriter-e4b:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "KeraAI/kera-songwriter-e4b:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf KeraAI/kera-songwriter-e4b:# Run inference directly in the terminal:
llama cli -hf KeraAI/kera-songwriter-e4b:Build from source code
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-app# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama serve -hf KeraAI/kera-songwriter-e4b:# Run inference directly in the terminal:
./build/bin/llama cli -hf KeraAI/kera-songwriter-e4b:Use Docker
docker model run hf.co/KeraAI/kera-songwriter-e4b:
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
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:
llama-server -hf KeraAI/kera-songwriter-e4b:Q4_K_M -c 16384 -ngl 99 --jinja
Or with a file you've downloaded:
llama-server -m kera-songwriter-e4b-Q4_K_M.gguf -c 16384 -ngl 99 --jinja
Then ask it on http://localhost:8080:
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.
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.
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
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.
- Downloads last month
- 612
Install (macOS, Linux)
# Start a local OpenAI-compatible server with a web UI: llama serve -hf KeraAI/kera-songwriter-e4b:# Run inference directly in the terminal: llama cli -hf KeraAI/kera-songwriter-e4b: