AI tasks in your module
Use generation, transcription, separation, rhythm and analysis as host tasks: declare the task, let the host run whichever model and runtime it supports, and keep the module working when a task is unavailable.
A module asks for a task, such as "generate a take", "turn this clip into MIDI" or "split these stems". It never names a model or runs one. The host chooses an implementation it supports (on this device, on Maru's servers, or through a provider), runs it outside the audio callback, and hands the result back through the module's existing contracts.
Because tasks are separate from models, the implementation behind a task can change without changing your module. A faster model, a new provider or a local runtime arrives as another option on the host, not as an SDK migration. The model directory describes the models themselves; AI for music explains why Maru works on these tasks. For what each task is good for, its limits and ideas to build, start with AI tasks in the Help Center.
How a task reaches your module
- Declare it. List the task's host capability as optional in the module's UI options, and declare any resource slots the result is installed into.
- Read it from the face. The host passes a task surface as a face prop: display-safe state (status, progress, takes, notes) and intent methods (generate, select, cancel). The face never sees tokens, URLs or model files.
- Handle "not here". A host without the task omits the prop. Keep the module's ordinary controls, factory sounds and saved results usable.
ui: {
entry: "./ui/index.tsx",
hostCapabilities: { optional: ["audio.generation/v1"] },
},
Inference always runs beside the audio path. A Processor only ever receives ordinary data (a sample buffer, MIDI notes, a parameter) through the same resource and event contracts it already uses.
Tasks
| Task | In a module face | From an app or server | Guide | Implementations |
|---|---|---|---|---|
| Generate audio | audio.generation/v1 (takes installed into the Processor) or app.generation/v1 (takes saved to the person's library) | generate_audio job | Generate audio in a module | Stable Audio 3 Small, Stable Audio 3 Medium |
| Audio to MIDI | audio.transcription/v1; audio.transcription.pitch/v1 selects the finite pitch profile | transcribe_audio_to_midi with mode monophonic, polyphonic or drums | Audio to MIDI in a module | Basic Pitch (polyphonic), Pitchy (monophonic, no model), Inverse Drum Machine (drums) |
| Live audio to MIDI | audio.transcription.live/v1 (notes played into the Processor's note input) | — | Live audio to MIDI | Pitchy (monophonic, no model) |
| Separate stems | audio.separation/v1 | separate_audio_stems | Separate stems in a module | Spleeter (device), SCNet (server) |
| Beats and tempo | Beat grid through audio.separation/v1 (trackRhythm); model-free onsets from @maruaudio/audio-sdk/analysis/novelty | analyze_audio with tempo, or rhythm alone for a beat grid | Beats and tempo in a module | Beat This (beats and downbeats) |
| Analyse a clip | audio.clip-analysis/v1 | analyze_audio | Add generative audio to your app | Model-free loudness, sections and quality |
| Camera control | vision.hand-landmarks/v1, vision.face-landmarks/v1, vision.pose-landmarks/v1, vision.hand-gestures/v1 | — | Camera control in a module | MediaPipe landmark models |
| Transcribe speech | — | transcribe_speech | — | A host without a speech model refuses jobs before execution |
The implementation column names the runtimes behind each task. Inspect the
task's state in the face, or maru.audio.capabilities() from an app, for what a
host offers; a catalog entry alone does not mean a model is online.
One host contract per task
Each task, and each mode of a task such as clip or live, has one host contract: the capability a module declares, the face prop the host fills, the input the host prepares, what comes back and how it reaches the Processor. Every host reads the same contract, so a module written against it works in any host that offers the task, and a new engine or model reaches it without a change to the module. To write an engine for a task, declare the model files it needs or run engines in your own host, read Implement an ML task engine.
Where tasks are available
A module with an optional task capability runs on every target; the task appears where a host supports it.
Website module pages run these tasks: generation on this device in WebGPU
browsers and hosted for admitted accounts, plus audio to MIDI, stems, clip
analysis and camera control. Live audio to MIDI appears in each host that
carries audio.transcription.live/v1. The module:dev workbench offers camera control and
generation through a test runtime, this device or a configured hosted proxy.
Native plug-ins (VST3, AU, CLAP) play factory and saved takes. Mobile and hardware
targets do not run these tasks.
The finite pitch-transcription carrier has a separate browser scope:
local maru dev, Studio built previews and standalone maru.page hosts.
See Pitch detection and audio-to-MIDI for the
required toolkit release, exact profile declaration and validation matrix.
This does not establish availability for other transcription tasks, the
immediate draft Face tab, desktop Studio or native plug-ins. Microphone capture
is optional and depends on a host-owned input service.
Choose an architecture or training workflow
Start with the artifact your task must return: label scores, PCM audio, note events or text. A shared Python library is useful for experiments, but it does not make those contracts interchangeable. Several heads can reuse one audio encoder; an audio-language model additionally needs a trained connection between audio features and its language backbone.
For concrete exercises, compare the architectures in How models see audio, adapt a sound generator with Training on your own sounds, or prepare MIDI tokens with Generating notes. The model directory's tools tab links the external training and serving tools. For reference workflows, a MIDI round-trip example, dataset splits and a copyable run record, use Run an audio or MIDI model experiment.
vLLM-Omni is a candidate for serving supported multimodal stages together. It does not train them, merge arbitrary checkpoints or establish a Maru integration. Verify reference inference for the exact model before comparing serving backends. Keep training and inference in the existing host service or worker boundary, with prepared results crossing into the module through its declared task contracts.
Licences and attribution
Each implementation carries its own licence. A face's generation state reports each model's licence string, and the model directory records the terms Maru has reviewed. Some open models are licensed for non-commercial use only, and Maru has not confirmed the output terms for Stable Audio; check the model page before you sell a module whose factory content was generated.
Further reading
- Generate audio in a module, Audio to MIDI, Separate stems, Beats and tempo and Camera control
- Add generative audio to your app: jobs, sources, recovery, consent and billing.
- Generate audio: the hosted generation architecture.
- Adding a model: what changes when a model becomes a feature.