Skip to main content
Glama
That's one sentence; but the instruction is no more than 2 sentences, so 2 is fine. Let me make it two sentences for clarity.

That's one sentence; but the instruction is no more than 2 sentences, so 2 is fine. Let me make it two sentences for clarity.

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
AUDIO_STUDIO_FFMPEGNoPath to ffmpegffmpeg on PATH
AUDIO_STUDIO_BACKENDNoauto or sa3-mlxauto
AUDIO_STUDIO_SA3_DIRNoUse another stable-audio-3 checkout<repo>/vendor/stable-audio-3
AUDIO_STUDIO_SA3_MODELNomedium (best quality, up to 380 s), sm-music or sm-sfx (small and fast, up to 120 s)medium
AUDIO_STUDIO_OUTPUT_DIRNoWhere audio files are written<repo>/outputs
AUDIO_STUDIO_MLX_CACHE_GBNoCap on MLX's buffer cache. Without it, a long generation can leave ~6 GB cached1
AUDIO_STUDIO_IDLE_UNLOAD_MINNoFree the models after this many idle minutes (0 = never)10

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Audio generation runs locally. Use Stable Audio 3 for instrumental BGM and sound effects. generate_audio/edit_audio write 44.1 kHz 24-bit stereo WAV + a .json sidecar (prompt, seed, settings) next to each file; process_audio trims, loops, fades, normalizes and exports 48 kHz WAV/OGG/FLAC for video or game engines.

For a song with vocals, use generate_song with the original lyrics in their language, section tags such as [Verse] and [Chorus], and a style description. It queues a local YuE2 job. Use song_status for progress/results and cancel_song to stop it. The WAV is stereo at 48 kHz. Song duration is an upper bound. To repeat a song with its recorded settings and seed, pass replay_from to generate_song with the song WAV path.

Stable Audio 3 prompting (official prompt guide + prompt-assistant rules):

  • Pick audio_type; the server adds the official prefix the model was trained on: music → "TrackType: Music, VocalType: Instrumental, ", instrument (solo/stem/loop) → "TrackType: Instrument, ", sfx (sound effects, ambience, one-shots) → "TrackType: SFX, ". Without the SFX prefix, effects often come out as music.

  • Write English, one or two dense natural sentences, ≤ ~45 words, no markdown. Translate other languages to English. Avoid vocal words (vocals, singer, lyrics, rap, choir voice…). Put the user's own wording in original_idea.

  • Music: genre/style + adjectives → main instruments → supporting layers/FX → drums/rhythm → mood/energy woven into the sentence. Pass tempo as bpm. e.g. "Lo-fi hip-hop chill track with mellow electric piano, soft vinyl crackle, low-pass filtered drums and soft plucked bass for a relaxed, dreamy vibe."

  • Instrument/stem/loop: instrument + technique + timbre/material + style/mood + recording/production qualities, plus bpm. Loops 6–20 s, stems 20–180 s.

  • SFX: fill sound_source (what makes it), sound_action (how it is triggered, how it evolves: attack, decay, movement/doppler), sound_material (texture, timbre, material) and sound_space (room, distance, dry/reverberant, mic); prompt can hold an overall one-line description. They are joined in that order. e.g. source "glass bottle", action "shattering on impact, fragments scattering", material "thick green glass, sharp bright transient", space "concrete floor, close-up, dry".

  • Duration should fit the content: impacts/clicks 1–3 s, actions 3–6 s, ambience 6–15 s (longer is fine), one-shots 1–3 s, loops 6–20 s, pop/rock 180–210 s, dance 120–180 s, cinematic/ambient 240–300 s. Max 380 s with the default medium model, 120 s with the small models.

  • Precise timing instructions ("climax at 15 s") are not followed reliably; for structure, generate then use edit_audio inpaint/continue.

  • Defaults steps=8, cfg=1.0 are the official distilled settings; more steps do not help. For stronger prompt adherence or to use negative_prompt, raise cfg (try 3–7, ≈2× slower). Results vary a lot per seed: use variations=2–4 and pick; candidates use seeds seed, seed+1, … so any one is reproducible.

  • Loudness is not mastered: generated files only get a safety ceiling (peak above −1 dBFS is turned down, never up). Use process_audio to normalize.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
generate_audioA

Generate BGM, instrument loops/stems or sound effects from text with Stable Audio 3 (runs locally). Returns one WAV path per candidate.

edit_audioB

Edit existing audio with Stable Audio 3: variation (audio-to-audio), inpainting a time range, or continuation/extension. Returns one WAV path per candidate.

Official tip: surrounding context outweighs the prompt — inpaint a large region first and shrink it, and keep prompts plausible for the context.
process_audioA

Post-process and export a clip: trim, trim silence, mono, normalize (peak or LUFS), seamless loop, fades, then write 48 kHz/44.1 kHz WAV, OGG Vorbis or FLAC (+ .json sidecar). The input file is not modified. Steps run in that order. Does not load any model.

generate_songA

Queue a local YuE2 song with vocals. Provide original lyrics with section labels and a style description, or replay_from a song WAV in the output folder to reuse its exact settings and seed. duration_seconds sets the cap. The model may end earlier. For caps of 30 seconds or less, suggest a single short chorus and a style prompt requesting the lead vocal on the first beat before submitting. Returns a job_id. Use song_status to check progress and retrieve the WAV. Use cancel_song to stop a waiting or running job.

song_statusA

Get the status, selected profile, estimate and WAV result of a song job. Clients that show the generate_song player card do not need to poll; the card follows the job itself.

cancel_songA

Cancel a queued or running song. Poll song_status until it is cancelled.

unload_modelsA

Free the ~5–7 GB of memory held by the loaded models now (they reload on the next call).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.8/5.0

Scored across 7 tools

Disambiguation4/5

Each tool has a distinct role: song generation (vocals/YuE2), job status, job cancellation, BGM/SFX generation, audio editing, post-processing/export, and model memory release. The only mild overlap is generate_song vs generate_audio, but descriptions clearly separate vocals-with-lyrics from instrumental/SFX text-to-audio. edit_audio vs process_audio is also distinguished (model-based editing vs model-free post-processing).

Naming Consistency4/5

Nearly all names follow a verb_noun pattern (generate_song, cancel_song, edit_audio, generate_audio, process_audio, unload_models). The single outlier is song_status, which is noun_noun and inverts the verb-object ordering used elsewhere, but it remains readable and predictable.

Tool Count5/5

Seven tools is well-scoped for a local audio generation suite, with each tool covering a distinct stage of the pipeline. Nothing feels redundant or padded.

Completeness4/5

The surface covers the full lifecycle for songs (generate, poll, cancel) plus generation, editing, post-processing/export, and memory management, which is strong coverage. Minor gaps exist: no tool to list queued/running jobs or available models/styles, and audio generation/editing have no cancel path unlike songs.

Maintenance

ActivityMaintained
ResponsivenessLimited data