Pre-check samples and lyrics
A clearance checklist of samples and lifted lyrics found against your catalogue, with times in both tracks, how sure, and whether it was declared.
Built on: Typed judgment, Signed record
Loading the tool…
Use it your way
Use it from your codeThe hosted API with your key, and prompts to paste into a coding agent
Get an API key
- Call the sample and lyric clearance pre-check API from your own code in minutes.
- Every model answer carries a signed receipt.
- Nothing to install; we run the models.
Run it yourself, on request
- The same open models and app, on Any CPU for the audio matching and lyric spans; Qwen3.8-27B (1× RTX 5090 32 GB or larger) for the lyric labels.
- Data never leaves your machines, and there are no Decosa charges.
- One prompt for Claude Code or Codex assembles the whole stack.
- Early access: the container images are not public yet and the source needs access; the prompt says how to ask.
Build with it
Paste one of these into Claude Code, Codex or another coding agent. The first wires your project to the hosted API with your DECOSA_API_KEY. The second pulls our containers and runs the same stack on your own GPU, with no Decosa charges.
- Base URL
- https://api.decosa.ai
- Auth
Authorization: Bearer $DECOSA_API_KEY(or a demo session token)- Tool id
- sample-clearance
Use the hosted API
# Decosa Sample and lyric clearance pre-check: use the hosted API
You are wiring Decosa's clearance pre-check into this project. It takes a track (audio), its lyrics and the list of
samples the artist declared, and returns a checklist: every sample (even pitched, stretched, filtered or looped),
re-played melody and lifted lyric line it finds in the reference catalog, with its time in the track and in the
reference, a confidence, whether it was declared (and with a clearance document), and whether to clear, replace or
remove it. It ends with a signed record. Each model call (lyric labels only) has its own signed receipt. Use only what
is listed below. If you need something else, stop and ask me.
- Base URL: `https://api.decosa.ai`
- Health check: `GET https://api.decosa.ai/healthz`.
- The hosted API checks against a small demo catalog (35 CC BY recordings and six synthetic melodies) and 156
public-domain songs; it is for trying the method and testing your integration. Unreleased tracks and your own
catalog belong on your own machine: use the self-host prompt for that.
- It is triage for clearance staff, not legal advice. Show every result as something to check.
## Auth: API key (or a demo session)
1. Preferred: an API key (`dk_…`) from "Get an API key" on the tool page. Keep it in an environment variable,
`DECOSA_API_KEY`, never in code. Send `Authorization: Bearer $DECOSA_API_KEY`.
2. Without a key: `POST https://api.decosa.ai/demo/session` with `{"vertical": "sample-clearance"}` returns `{"token", "expires_at", "budget"}`.
a limited number of sessions per network per hour (the current limits are in `demo_sessions` of GET /healthz). Over a limit: HTTP 429 with `Retry-After`.
3. One check at a time per demo token (409 otherwise).
## Endpoints
- `POST /clearance/check` (token). Body:
`{"audio_b64": "<base64 of the file>", "lyrics": "[00:20.00] a line\n...", "declared": "Title - Artist | sample | licence LIC-014", "title"?: "...", "judge_lyrics"?: true, "assume_reserved"?: false, "stream"?: true}`,
or `{"sample": "planted"}` (the demo track). At least audio or lyrics.
- Audio: WAV, FLAC, MP3, OGG, Opus or M4A as base64, up to 20 MB; the first 10 minutes are checked. Lyrics: one
line per line, LRC timestamps kept, up to 20,000 characters. Declared: a list `[{title, artist?, catalog_id?, type?: sample|interpolation|lyric, document?}]`
or text, one entry per line. `assume_reserved: true` treats every reference as all rights reserved.
- With `"stream": true` (or `Accept: text/event-stream`) it streams `ready`, `stage`, a `finding` per item, a
`receipt` after each model call, then `report`, `done` and `budget`. With `"stream": false`: one JSON object
`{run_id, totals, export, receipts, report, budget}`.
- `report.checklist[]`: `{id, kind: sample|interpolation|lyric, ref: {id, title, artist, rights, licence, source}, confidence: high|medium, where: [{start_s, end_s, ref_start_s, ref_end_s}] or [{line, start_s}], status: undeclared|declared_no_document|documented, action: clear|replace|remove, alternatives, why, how}`.
`report.declared_not_found[]`: declared entries the catalog does not hold. `report.record`: the signed record.
- Errors: 400 (the message says what is wrong, including audio that cannot be decoded), 402 budget, 413 over 28 MB,
429 busy, 503 when the catalog is not ready (lyrics-only checks still work).
- `GET /clearance/runs/{run_id}/export?format=csv` (checklist), `md`, `record` (signed).
- `POST /record/verify` (no token) `{"record": {...}}` → `{ok, summary, bad}`.
- `GET /clearance/info`, `GET /clearance/catalog`, `GET /clearance/samples`, `GET /clearance/samples/{id}`, `GET /attest/signing-key` (no token).
## Example: check a track and save the checklist (Python, `pip install httpx`)
```python
import base64, httpx, os, pathlib
API = "https://api.decosa.ai"
H = {"Authorization": f"Bearer {os.environ['DECOSA_API_KEY']}"}
body = {"audio_b64": base64.b64encode(pathlib.Path("track.mp3").read_bytes()).decode(),
"lyrics": pathlib.Path("lyrics.lrc").read_text(), "declared": "Dirt Rhodes - Kevin MacLeod | sample | LIC-014",
"stream": False}
r = httpx.post(f"{API}/clearance/check", headers=H, json=body, timeout=300)
r.raise_for_status()
run = r.json()
for x in run["report"]["checklist"]:
print(x["id"], x["kind"], x["ref"]["title"], x["confidence"], x["status"], x["action"])
pathlib.Path("clearance.csv").write_text(httpx.get(f"{API}{run['export']['csv']}", headers=H).text)
```
## Honest limits
- It finds only what is in the catalog it checks; the hosted catalog is a 41-reference demo.
- Measured recall on planted borrowings is moderate (57% on the test split; quiet samples and short loops are missed
most); high-confidence items were all correct. See the Stack tab.
- Heavy paraphrases of a lyric line are not flagged; lyric matching is English.
Run it yourself (containers)
On request. The container images and the compose file aren’t public yet. Ask for self-host access and Decosa sends the registry (DECOSA_REGISTRY) and the compose file’s URL (DECOSA_COMPOSE_URL) these steps use. They are the steps we tested end to end on a fresh machine.
# Decosa Sample and lyric clearance pre-check: run it yourself (containers)
You are setting up the Decosa clearance pre-check on this machine, so unreleased tracks and our catalog never leave
it. It matches a track's audio against our catalog (samples, even pitched, stretched, filtered or looped, and re-played
melodies), matches its lyrics against a lyric set, compares what it finds with what was declared, and signs a record.
Nothing is sent to Decosa's hosted API.
Status: the container images (${DECOSA_REGISTRY}/decosa-*) and the compose file are on request while self-host is in early access (not on a public registry yet): ask at https://decosa.ai/contact?topic=self-host, and Decosa sends the registry as DECOSA_REGISTRY, the compose file URL as DECOSA_COMPOSE_URL, and pull access. If a pull fails with
"not found", "denied" or "unauthorized", stop and tell me. Do not substitute other images.
Ask me before any command that needs sudo, and show me the command first.
## Step 0: set up with a coding agent, rehearse on mock data, then go private
This prompt is for a coding agent running on the machine that will host the service. We recommend Claude Code with
Claude Opus 5.5; any capable coding agent works. Work in this order:
1. Set up on mock data only. During the whole setup you (the agent) work with the synthetic sample bundle below and
nothing else. Do not ask me for real data, and do not open, read, list or copy files that hold real data, even to
"test with something realistic".
2. Rehearse. When the steps below are done and the service is healthy, fetch the mock-data bundle for this tool,
https://decosa.ai/samples/sample-clearance.zip (649 KB, 10 checks, synthetic or openly licensed: see `licence` in expected.json),
show me what is in it, and run the rehearsal against the local API:
`docker compose exec api python scripts/rehearse.py sample-clearance` (the api image carries the same bundle under /app/rehearsal/sample-clearance/;
with no key set, the script asks the local API for a short demo token). From a decosa-api checkout instead:
`python scripts/rehearse.py sample-clearance --bundle sample-clearance.zip --base-url http://127.0.0.1:<PORT>`.
It sends the mock inputs to the local API and prints PASS or FAIL for each expected property (for example: "the undeclared Fork and Spoon slice is flagged", "the Fork and Spoon slice is placed near 0:30", "the declared Dirt Rhodes loop is found and documented"). Show me
the full output. Every check must pass. If one fails, fix the install and run it again; never edit `expected.json`
to make a check pass.
3. Stop there. Once the rehearsal passes, tell me, and I will run my own data against the local API myself, on this
machine.
For the person running this: a coding agent that runs in the cloud sees everything in its context, including files it
reads, command output and anything pasted into the chat. Keep real data out of the chat and out of anything the agent
can read. Switch to your own data only after the rehearsal has passed and the agent's work is done.
## Steps
1. Docker: if `docker compose version` fails, install Docker Engine and the compose plugin using Docker's official
instructions for this distribution (docs.docker.com/engine/install). For the lyric labels, also install the NVIDIA
container toolkit and check `docker run --rm --gpus all nvidia/cuda:12.8.0-base-ubuntu24.04 nvidia-smi`.
2. Fetch the compose file:
`mkdir -p ~/decosa && cd ~/decosa && curl -fsSL "${DECOSA_COMPOSE_URL}" -o compose.yaml`
Read it. Keep the `llm` service (Qwen3.8-27B on vLLM) and the `api` service. For the `api` service set
`DECOSA_LLM_ROUTE=direct`, `DECOSA_LLM_URL=http://llm:8000/v1`, `DECOSA_LLM_MODEL=qwen3.8-27b`,
`DECOSA_CLEARANCE_CATALOG=/data/clearance/catalog`, `DECOSA_CLEARANCE_EMBED_DIR=/data/clearance/minilm`, and bind
every port to 127.0.0.1. Without a GPU, drop `llm` and send `"judge_lyrics": false`.
3. Pull and start: `docker compose pull && docker compose up -d`.
4. Embedding files and a catalog:
`docker compose exec api python -m decosa_api.verticals.clearance.embed fetch /data/clearance/minilm`, then either the
demo catalog (`docker compose exec api python scripts/clearance_catalog.py demo /data/clearance/catalog`, 35 CC BY
recordings, about 180 MB) or ours: our audio plus a `catalog.json` in that folder (see API_CONTRACT.md, "Sample and
lyric clearance pre-check"), then `python -m decosa_api.verticals.clearance.catalog build /data/clearance/catalog`.
Restart the api service.
5. Check: `curl -fsS http://127.0.0.1:<PORT>/clearance/info` shows `catalog.state: "ready"` and `"route": "direct"`;
`GET /attest/signing-key` shows this box's public key. Show me the key: it is what others pin to verify my records.
6. Smoke test (demo catalog): get a token with `POST /demo/session {"vertical":"sample-clearance"}` and run
`POST /clearance/check {"sample": "planted", "stream": false}`. Expect "Dirt Rhodes" documented, "Fork and Spoon"
and "Synthetic melody 02" undeclared, lyric lines 5 and 8 flagged, "Night Train Breaks" in `declared_not_found`,
receipts `attested`. Then `POST /record/verify` with `report.record`: `ok` must be true. `{"sample": "clean"}`
must come back empty.
7. Report back: the public key and key id, the checklist and how long the run took.
Off, and keep it off on a box that holds unreleased masters: joining serves other people's requests on this GPU.
If I ask for it later, on a separate machine, follow the Provide page instead of improvising.
No NVIDIA GPU? This tool also runs entirely on an Apple Silicon Mac (MLX, 32 GB of unified memory or more): use https://decosa.ai/prompts/sample-clearance-mac.md instead.
Run it on your own hardwareWhat it needs, and the prompt that sets it up
Run it on your own GPU
Same app, same pinned models, your hardware. Nothing goes to our servers and there are no Decosa charges.
Hardware check
Check your own hardware- CPU only, 64 GB RAMlite tierRuns with a smaller tier
The standard tier does not fit: Qwen3.8-27B (NVFP4) needs a GPU. The lite tier fits.
- GeForce RTX 4090standard tierRuns
The standard tier fits with changes: Replace Qwen3.8-27B (NVFP4) with A community 4-bit build of Qwen3.8-27B (AWQ or GGUF). This build is NVIDIA NVFP4, which needs a Blackwell GPU. (Memory is an estimate.)
- GeForce RTX 5090standard tierRuns
The standard tier fits with changes: Qwen3.8-27B (NVFP4): run it at its smallest setting (about 28 GB instead of 57.6 GB), with a shorter context and fewer parallel sessions.
- 2x GeForce RTX 5090standard tierRuns
The standard tier fits with changes: Split the language model across the GPUs with tensor parallelism (vLLM --tensor-parallel-size).
- L40Sstandard tierRuns
The standard tier fits with changes: Replace Qwen3.8-27B (NVFP4) with Qwen3.8-27B official FP8. This build is NVIDIA NVFP4, which needs a Blackwell GPU.
- H100 80 GB (SXM)standard tierRuns
The standard tier fits with changes: Replace Qwen3.8-27B (NVFP4) with Qwen3.8-27B official FP8. This build is NVIDIA NVFP4, which needs a Blackwell GPU.
- RTX PRO 6000 Blackwell 96 GBstandard tierRuns
The standard tier fits (57.6 of 96 GB).
- 2x RTX PRO 6000 Blackwell 96 GBstandard tierRuns
The standard tier fits (57.6 of 192 GB).
- Apple M3 Ultra (Mac Studio), 96 GBstandard tierRuns
The standard tier fits (32 of 96 GB).
- Apple M5 Max, 64 GBstandard tierRuns
The standard tier fits (32 of 64 GB).
Memory per component comes from measured footprints, the tool's stack.json, or an estimate from its parameter count, and each is labelled that way below. Only an RTX PRO 6000 and an M3 Ultra Mac Studio have actually been run.
On request. The container images and the compose file aren’t public yet. Ask for self-host access and Decosa sends the registry (DECOSA_REGISTRY) and the compose file’s URL (DECOSA_COMPOSE_URL) these steps use. They are the steps we tested end to end on a fresh machine.
- 1
Check the GPU, Docker and the NVIDIA Container Toolkit
The driver must see the GPU, and Docker must be able to pass it into a container.
nvidia-smi docker compose version docker run --rm --gpus all ubuntu nvidia-smi
- 2
Fetch the compose file
One file describes the API and the language model as services.
mkdir -p ~/decosa && cd ~/decosa curl -fsSL "${DECOSA_COMPOSE_URL}" -o compose.yaml - 3
Pull and start
The first start downloads pinned model weights, tens of gigabytes.
docker compose pull docker compose up -d
- 4
Check health
Wait until the API reports ok with the language model loaded. Then point your app at the local base URL.
curl -fsS http://localhost:<PORT>/healthz # {"ok": true, "llm": true, ...} curl -fsS -X POST http://localhost:<PORT>/demo/session \ -H 'Content-Type: application/json' -d '{"vertical":"sample-clearance"}'
Set up with a coding agent, rehearse on mock data, then go private
- Set up with a coding agent. Paste the self-host prompt into a coding agent on the machine that will run the service. We recommend Claude Code with Claude Opus 5.5; any capable coding agent works.
- Rehearse on mock data. The agent runs the tool on a bundle of synthetic inputs and checks each answer against the bundle's
expected.json. Every check must print PASS. - Go private. Only then do you run your own data against the local API, yourself, on that machine. Never give the agent real data during setup: a coding agent that runs in the cloud sees everything in its context, so keep real data out of the chat and out of the files it reads.
docker compose exec api python scripts/rehearse.py sample-clearance
Download the mock-data bundle (649 KB, 10 checks)expected.json
A 75 s demo track (a CC BY host with three planted borrowings), its lyrics with a lifted 1909 line, and a declared-samples list. The check must flag the undeclared slowed slice of "Fork and Spoon" near 0:30, find the declared "Dirt Rhodes" loop as documented, flag the lifted lyric line, list the declared sample that is not in the catalogue, export a Markdown checklist, and end in a signed record that verifies and fails once edited.
What the rehearsal checks
- the undeclared Fork and Spoon slice is flagged
- the Fork and Spoon slice is placed near 0:30
- the declared Dirt Rhodes loop is found and documented
- the lifted 1909 lyric line is flagged
- the re-played synthetic melody is flagged as an interpolation
- the declared sample that is not in the catalogue is listed
- the Markdown export names the flagged sample
- the signed record verifies
- a record with one entry edited no longer verifies
- every model call has a signed receipt
Licence: Audio: host "Hustle" by Kevin MacLeod (incompetech.com), CC BY 4.0; plants from catalogue tracks (CC BY 4.0) and a synthetic melody (CC0). Lyrics written for this demo; the lifted lines are from songs published in 1909 and 1913 (public domain in the US). Declared list: fictional.
Prompt for your coding agent
# Decosa Sample and lyric clearance pre-check: run it yourself (containers)
You are setting up the Decosa clearance pre-check on this machine, so unreleased tracks and our catalog never leave
it. It matches a track's audio against our catalog (samples, even pitched, stretched, filtered or looped, and re-played
melodies), matches its lyrics against a lyric set, compares what it finds with what was declared, and signs a record.
Nothing is sent to Decosa's hosted API.
Status: the container images (${DECOSA_REGISTRY}/decosa-*) and the compose file are on request while self-host is in early access (not on a public registry yet): ask at https://decosa.ai/contact?topic=self-host, and Decosa sends the registry as DECOSA_REGISTRY, the compose file URL as DECOSA_COMPOSE_URL, and pull access. If a pull fails with
"not found", "denied" or "unauthorized", stop and tell me. Do not substitute other images.
Ask me before any command that needs sudo, and show me the command first.
## Step 0: set up with a coding agent, rehearse on mock data, then go private
This prompt is for a coding agent running on the machine that will host the service. We recommend Claude Code with
Claude Opus 5.5; any capable coding agent works. Work in this order:
1. Set up on mock data only. During the whole setup you (the agent) work with the synthetic sample bundle below and
nothing else. Do not ask me for real data, and do not open, read, list or copy files that hold real data, even to
"test with something realistic".
2. Rehearse. When the steps below are done and the service is healthy, fetch the mock-data bundle for this tool,
https://decosa.ai/samples/sample-clearance.zip (649 KB, 10 checks, synthetic or openly licensed: see `licence` in expected.json),
show me what is in it, and run the rehearsal against the local API:
`docker compose exec api python scripts/rehearse.py sample-clearance` (the api image carries the same bundle under /app/rehearsal/sample-clearance/;
with no key set, the script asks the local API for a short demo token). From a decosa-api checkout instead:
`python scripts/rehearse.py sample-clearance --bundle sample-clearance.zip --base-url http://127.0.0.1:<PORT>`.
It sends the mock inputs to the local API and prints PASS or FAIL for each expected property (for example: "the undeclared Fork and Spoon slice is flagged", "the Fork and Spoon slice is placed near 0:30", "the declared Dirt Rhodes loop is found and documented"). Show me
the full output. Every check must pass. If one fails, fix the install and run it again; never edit `expected.json`
to make a check pass.
3. Stop there. Once the rehearsal passes, tell me, and I will run my own data against the local API myself, on this
machine.
For the person running this: a coding agent that runs in the cloud sees everything in its context, including files it
reads, command output and anything pasted into the chat. Keep real data out of the chat and out of anything the agent
can read. Switch to your own data only after the rehearsal has passed and the agent's work is done.
## Steps
1. Docker: if `docker compose version` fails, install Docker Engine and the compose plugin using Docker's official
instructions for this distribution (docs.docker.com/engine/install). For the lyric labels, also install the NVIDIA
container toolkit and check `docker run --rm --gpus all nvidia/cuda:12.8.0-base-ubuntu24.04 nvidia-smi`.
2. Fetch the compose file:
`mkdir -p ~/decosa && cd ~/decosa && curl -fsSL "${DECOSA_COMPOSE_URL}" -o compose.yaml`
Read it. Keep the `llm` service (Qwen3.8-27B on vLLM) and the `api` service. For the `api` service set
`DECOSA_LLM_ROUTE=direct`, `DECOSA_LLM_URL=http://llm:8000/v1`, `DECOSA_LLM_MODEL=qwen3.8-27b`,
`DECOSA_CLEARANCE_CATALOG=/data/clearance/catalog`, `DECOSA_CLEARANCE_EMBED_DIR=/data/clearance/minilm`, and bind
every port to 127.0.0.1. Without a GPU, drop `llm` and send `"judge_lyrics": false`.
3. Pull and start: `docker compose pull && docker compose up -d`.
4. Embedding files and a catalog:
`docker compose exec api python -m decosa_api.verticals.clearance.embed fetch /data/clearance/minilm`, then either the
demo catalog (`docker compose exec api python scripts/clearance_catalog.py demo /data/clearance/catalog`, 35 CC BY
recordings, about 180 MB) or ours: our audio plus a `catalog.json` in that folder (see API_CONTRACT.md, "Sample and
lyric clearance pre-check"), then `python -m decosa_api.verticals.clearance.catalog build /data/clearance/catalog`.
Restart the api service.
5. Check: `curl -fsS http://127.0.0.1:<PORT>/clearance/info` shows `catalog.state: "ready"` and `"route": "direct"`;
`GET /attest/signing-key` shows this box's public key. Show me the key: it is what others pin to verify my records.
6. Smoke test (demo catalog): get a token with `POST /demo/session {"vertical":"sample-clearance"}` and run
`POST /clearance/check {"sample": "planted", "stream": false}`. Expect "Dirt Rhodes" documented, "Fork and Spoon"
and "Synthetic melody 02" undeclared, lyric lines 5 and 8 flagged, "Night Train Breaks" in `declared_not_found`,
receipts `attested`. Then `POST /record/verify` with `report.record`: `ok` must be true. `{"sample": "clean"}`
must come back empty.
7. Report back: the public key and key id, the checklist and how long the run took.
Off, and keep it off on a box that holds unreleased masters: joining serves other people's requests on this GPU.
If I ask for it later, on a separate machine, follow the Provide page instead of improvising.
No NVIDIA GPU? This tool also runs entirely on an Apple Silicon Mac (MLX, 32 GB of unified memory or more): use https://decosa.ai/prompts/sample-clearance-mac.md instead.
Help me customise for my hardware
Pick your GPU or Mac, or enter its memory. You get the tier that fits, the model swaps it needs, measured speed where we have it, and a setup prompt with those choices written in.
GeForce RTX 5090: 32 GB GDDR7, 1,792 GB/s, FP8 and NVFP4. NVIDIA product page
RunsSample and lyric clearance pre-check on GeForce RTX 5090: use the Standard · adds lyric labels by Qwen3.8-27B (hosted demo) tier
The standard tier fits with changes: Qwen3.8-27B (NVFP4): run it at its smallest setting (about 28 GB instead of 57.6 GB), with a shorter context and fewer parallel sessions.
What this tool's stack says about this hardware:
- 1x RTX 5090 32 GB (fits): For the lyric labels, Qwen3.8-27B NVFP4 needs about 20 GB of weights plus a small KV cache (short prompts). Estimate: same model and prompts as the measured card, not run here on a 5090.
Standard · adds lyric labels by Qwen3.8-27B (hosted demo): what changesuses estimates
- Qwen3.8-27B (NVFP4): run it at its smallest setting (about 28 GB instead of 57.6 GB), with a shorter context and fewer parallel sessions.
Memory per component
- Audio matcher: decosa-api clearance module (decosa_api/verticals/clearance). CPU. Runs on CPU (vram_gb 0 in stack.json).
- Lyric-line embeddings: all-MiniLM-L6-v2 (ONNX). CPU. Runs on CPU (vram_gb 0 in stack.json).
- Model: Qwen3.8-27B (NVFP4). ~57.6 GB (at least ~28 GB), weights 21.4 GB (from stack.json). Qwen3.8-27B NVFP4: Weights 19.9 GiB (21.4 GB), measured (field stack.json). The compose file gives the server 0.60 of a 96 GB card (57.6 GB) so the rest is FP8 KV cache for several sessions. The 28 GB minimum is an estimate: weights plus a short-context KV cache, which is why several stacks list a 32 GB RTX 5090 as 'estimate'. (stack.json lists 20 GB for this component.)
Expected speed
Not measured.
Not measured on this hardware. The only measured setups are an RTX PRO 6000 Blackwell and a Mac Studio M3 Ultra.
Setup prompt for this hardware
The self-host prompt for Sample and lyric clearance pre-check, with a hardware plan for GeForce RTX 5090 added after Step 0. Loading the full prompt; until then it points your agent at the prompt's URL.
# Set up Sample and lyric clearance pre-check on my hardware Fetch https://decosa.ai/prompts/sample-clearance-selfhost.md and follow it (including Step 0: rehearse on mock data first), with the hardware plan below applied. ## Hardware plan for this machine (from https://decosa.ai/self-host/hardware?use=sample-clearance) Target machine: GeForce RTX 5090 (32 GB of GPU memory; CUDA, FP8 and NVFP4). Quality tier: Standard · adds lyric labels by Qwen3.8-27B (hosted demo) (standard). Fit check: runs with changes, about 28 GB of 32 GB used; some memory numbers are estimates, not measurements. First, check the machine: run `nvidia-smi` (or `rocm-smi`, or `sysctl hw.memsize` on a Mac) and confirm the GPUs and free memory match the line above. If they do not, stop and tell me before pulling anything. Use these components (the setup below describes the standard tier; change it to match): - Audio matcher: decosa-api clearance module (decosa_api/verticals/clearance), CPU - Lyric-line embeddings: all-MiniLM-L6-v2 (ONNX) (sentence-transformers/all-MiniLM-L6-v2), CPU - Model: Qwen3.8-27B (NVFP4) (nvidia/Qwen3.8-27B-NVFP4), 57.6 GB. Change: Qwen3.8-27B (NVFP4): run it at its smallest setting (about 28 GB instead of 57.6 GB), with a shorter context and fewer parallel sessions. GPU placement (set each service's device and its vLLM --gpu-memory-utilization to about the share shown): - GPU 0: Qwen3.8-27B (NVFP4) ~28 GB (88%); about 4 GB left During the rehearsal, watch GPU memory. If a model fails to load or runs out of memory, lower its --max-model-len and --max-num-seqs first, then its memory share, and tell me what you changed. The stack's own component list and compose layout: https://decosa.ai/prompts/sample-clearance-assemble.md
Or on a Mac Studio
No NVIDIA GPU needed: every model this tool uses runs natively on Apple Silicon through MLX. Any M-series Mac with 32 GB of unified memory or more. Measured speeds and what runs where
From a checkout of decosa-api, one command sets up the models and the API: scripts/mac/setup.sh
Mac prompt for your coding agent
# Decosa Sample and lyric clearance pre-check: run it on this Mac (Apple Silicon, no NVIDIA GPU) You are setting up the Decosa Sample and lyric clearance pre-check on this Mac, natively on Apple Silicon. The models run on the Mac's GPU through MLX and decosa-api runs from a git checkout with `uv`. Docker is not used for the models, because Docker on macOS cannot reach the GPU. Nothing is sent to Decosa's hosted API. Every model this tool needs runs on the Mac. It needs 32 GB of unified memory or more. Ask me before any command that needs sudo or installs software with Homebrew, and show me the command first. Never stop or kill a process this setup did not start; if a port is taken, pick another one. ## Step 0: set up with a coding agent, rehearse on mock data, then go private This prompt is for a coding agent running on the machine that will host the service. We recommend Claude Code with Claude Opus 5.5; any capable coding agent works. Work in this order: 1. Set up on mock data only. During the whole setup you (the agent) work with the synthetic sample bundle below and nothing else. Do not ask me for real data, and do not open, read, list or copy files that hold real data, even to "test with something realistic". 2. Rehearse. When the steps below are done and the service is healthy, fetch the mock-data bundle for this tool, https://decosa.ai/samples/sample-clearance.zip (649 KB, 10 checks, synthetic or openly licensed: see `licence` in expected.json), show me what is in it, and run the rehearsal against the local API: `.venv/bin/python scripts/rehearse.py sample-clearance` in the decosa-api checkout (the key comes from ~/.decosa-mac/api.key). It sends the mock inputs to the local API and prints PASS or FAIL for each expected property (for example: "the undeclared Fork and Spoon slice is flagged", "the Fork and Spoon slice is placed near 0:30", "the declared Dirt Rhodes loop is found and documented"). Show me the full output. Every check must pass. If one fails, fix the install and run it again; never edit `expected.json` to make a check pass. 3. Stop there. Once the rehearsal passes, tell me, and I will run my own data against the local API myself, on this machine. For the person running this: a coding agent that runs in the cloud sees everything in its context, including files it reads, command output and anything pasted into the chat. Keep real data out of the chat and out of anything the agent can read. Switch to your own data only after the rehearsal has passed and the agent's work is done. ## What runs where | Part | On an NVIDIA GPU | On this Mac | Status | |---|---|---|---| | Audio matcher: log-frequency landmarks with pitch and tempo search, peak-by-peak verification, melody shingles for composition references; lyric spans; declared vs detected; the signed record (no model; CPU) | Python on CPU | The same Python module, run with uv | Runs, measured | | Lyric-line embeddings: re-worded lines that share few characters with the original | ONNX Runtime on CPU | ONNX Runtime on CPU (macOS arm64 wheels) | Runs, not measured | | Model: labels each near-duplicate lyric line lift, variant, stock phrase or different | NVFP4 on vLLM 0.29 (Blackwell) | MLX 4-bit (EigenLabs/Qwen3.8-27B-4bit) on mlx_lm.server 0.31.3; oMLX 0.6.1 with MTP as an option | Runs, measured | ## Steps 1. Check the machine: `uname -m` must print `arm64` (an M-series chip; Intel Macs cannot run MLX), and `sysctl -n hw.memsize` should be at least 32 GB for this tool. Check about 30 GB of free disk with `df -h ~`. Show me the chip (`sysctl -n machdep.cpu.brand_string`) and the memory. 2. Tools: `uv --version`. If it is missing, ask me, then `brew install uv`. 3. Code: `git clone <decosa-api source: on request at https://decosa.ai/contact?topic=self-host> ~/decosa-api` (access required) and `cd ~/decosa-api`. Check that `scripts/mac/setup.sh` exists; if it does not, the checkout is too old: stop and tell me. 4. Start everything with one command: `scripts/mac/setup.sh`. It creates `.venv` (decosa-api) and `.venv-mac` (MLX, mlx-lm, mlx-audio), downloads the weights with the Hugging Face CLI (about 16 GB for the language model), starts the model servers and decosa-api on 127.0.0.1, and mints a local API key into `~/.decosa-mac/api.key` (mode 0600). The first run takes a while because of the downloads; later runs reuse them. If a download fails with 401 or 403, ask me for a Hugging Face token and set `HF_TOKEN`. 5. Check health: `scripts/mac/setup.sh status` shows each server, and `curl -fsS http://127.0.0.1:8445/healthz` must report `"llm": true`. `curl -fsS http://127.0.0.1:8445/attest/signing-key` shows this Mac's public key: show it to me, because it is what others pin to check the receipts and records this Mac signs. 6. Smoke test: `.venv/bin/python scripts/mac/bench_usecases.py sample-clearance`. It runs the tool's own sample end to end against the local API with the local key and prints `ok`, the wall time, the model calls and the receipts. `ok=True` is the pass condition. If it fails, read `~/.decosa-mac/logs/*.log` and tell me what you found. 7. Point the app at it: the API is `http://127.0.0.1:8445` with `Authorization: Bearer $(cat ~/.decosa-mac/api.key)`, the same routes as the hosted API. To stop everything: `scripts/mac/setup.sh stop`. 8. Report back: the chip and memory, the public key, the smoke-test result and its time, and the output of `scripts/mac/setup.sh status`. ## Good to know - Receipts: every model call is signed with this Mac's own Ed25519 key and names the exact MLX weights (`qwen3.8-27b-mlx-4bit` with a hash of the downloaded files). There is no gateway countersignature on a self-hosted Mac. - The weights are a 4-bit MLX build of the same open models, not the NVFP4 build the hosted route and the published evals use. Expect small differences in wording and scores. - Faster drafting: `scripts/mac/setup.sh stop && scripts/mac/setup.sh --engine omlx` serves the model with oMLX and multi-token prediction (about 2x faster for a single long answer, no faster for many parallel calls; typed judgments then use sampling because oMLX returns no log-probabilities). - Needs ffmpeg and the demo reference catalog (scripts/clearance_catalog.py); not run end to end on the Mac. - Measured speeds for a Mac Studio M3 Ultra and the memory each tool needs: https://decosa.ai/mac. Full details: `docs/self-host-mac.md` in the checkout.
The proof
How we tested itEval results and end-to-end checks, hosted and self-hosted, with dates
Verified end to end
Hosted: verified 25 Sep 2026 · measured 25 Sep 2026: · p50 6.7 s · ~<$0.001 per run · 1 receipt
Loading the nightly status…
Self-host: verified 25 Sep 2026 · Fresh clone into a clean directory, docker build, the api service with a named volume, embedding files and the demo catalog fetched inside the container, pointed at the running local vLLM (Qwen3.8-27B) over host networking; then torn down.
Measured cost to run: about $0.011 per 100 tracks (hosted, 25 Sep 2026). Self-hosting is free: the code is open and the models are open-weight. You pay only for your own hardware and power.
Verified on 2026-09-25: the image builds with ffmpeg and the clearance extra, the demo catalog builds in 81 s (download included), the planted sample returns the same five items and the declared-not-found entry as the hosted run in 5.4 s on the direct route (one attested call), the clean sample returns nothing, the signed record verifies and fails when one action is changed, and no lyric or title text reaches the logs. The first attempt found a bug (the demo track list was not in the image), fixed in the branch. The model server's own startup was not re-verified (no new GPU load).
Known limits (4)
- Recall is moderate: 57% of planted borrowings on the test split; quiet samples and short loops are missed most.
- It only finds what is in the catalog it is given; the hosted demo catalog is 41 references.
- The eval mixes are synthetic, from one composer's CC BY music; real productions may behave differently.
- Lyric matching is English and needs a lyric set: the demo uses public-domain songs published before 1929.
How it's builtThe steps, the models and what each one checks
Get an API key
- Call the sample and lyric clearance pre-check API from your own code in minutes.
- Every model answer carries a signed receipt.
- Nothing to install; we run the models.
Run it yourself, on request
- The same open models and app, on Any CPU for the audio matching and lyric spans; Qwen3.8-27B (1× RTX 5090 32 GB or larger) for the lyric labels.
- Data never leaves your machines, and there are no Decosa charges.
- One prompt for Claude Code or Codex assembles the whole stack.
- Early access: the container images are not public yet and the source needs access; the prompt says how to ask.
Samples, re-played melodies and lifted lyric lines found before release, each with its time in the track, declared or not, and a clear, replace or remove call, in one signed record.
Upload a track, its lyrics and the list of samples the artist declared. Code matches the audio against your own catalog, tolerant of pitch shifts to about two semitones, tempo changes to about 14%, filtering and loops, and names the reference and the times in both. Melody references catch re-played interpolations. Lyrics are matched word for word and line by line against a lyric set, and an open model labels near-duplicate lines as lifted, re-worded or a stock phrase, one receipted call per batch. The result is a clearance checklist (what, where, how sure, declared or not, and whether to clear, replace or remove) and a signed record of what was checked against which catalog. It is triage for the people who clear samples, not legal advice.
- Deployment
- Hosted or self-host
- Regulatory
- Triage, not legal advice; checked 25 Sep 2026. In the US a sample usually needs two licences: the sound recording (the master, 17 U.S.C. 114, usually from the label) and the musical work in it (from its publishers). An interpolation re-records the music, so it needs the composition licence only; the compulsory mechanical licence does not cover changing a song's melody or fundamental character (17 U.S.C. 115(a)(2)), so interpolations are negotiated. Whether a very short sample needs a licence is unsettled: Bridgeport Music v. Dimension Films, 410 F.3d 792 (6th Cir. 2005) held there is no de minimis defence for sampling a sound recording ("get a license or do not sample"); VMG Salsoul v. Ciccone, 824 F.3d 871 (9th Cir. 2016) held there is (a 0.23-second horn hit in "Vogue"). The Supreme Court has not resolved the split as far as we found, so the checklist never treats a short sample as safe. In the EU, Pelham v Hütter (CJEU C-476/17, 29 Jul 2019) held that even a very short audio fragment is a reproduction unless it is changed so it is unrecognisable to the ear. Public domain in the US: sound recordings published before 1923 since 1 Jan 2022 (Music Modernization Act, 17 U.S.C. 1401), later ones 100 years after publication (recordings from 1925 on 1 Jan 2026); compositions and lyrics published in 1930 or earlier as of 1 Jan 2026 (the demo lyric set stops at 1928). Creative Commons: BY allows sampling with credit; NC forbids a commercial release and ND forbids adaptations. AcoustID (the public Chromaprint service) is free for non-commercial use and paid for commercial use; this product does not call it. Model licences: Apache-2.0 (Qwen3.8-27B, all-MiniLM-L6-v2).
Text description
The track, its lyrics and the declared list go to decosa-api, which runs on your own machine. ffmpeg decodes the audio; code finds log-frequency peak pairs and looks them up in the catalog index under a grid of pitch shifts and tempo changes, verifies each candidate peak by peak, and matches melody shingles against composition references. Lyrics are matched word for word, then line by line with character trigrams and all-MiniLM-L6-v2 embeddings (Apache-2.0, CPU); Qwen3.8-27B (Apache-2.0) labels near-duplicate lines lift, variant, stock or different. Declared versus detected rules set each item's status and its clear, replace or remove call. Outputs: the checklist with timestamps and a signed record with hashes, the catalog fingerprint, items and receipt ids but no audio or lyrics. On the hosted route each model call gets a receipt that our gateway countersigns.
At a glance
- Data retention
- The audio and lyrics are held in memory for the request; the run (checklist and record, no audio) for one hour, for the token or key that made it. Nothing is written to disk; logs carry counts only.
- What leaves the box
- Self-hosted: nothing (the lyric labels go to your own model server). Hosted demo: the audio is matched on Decosa's server; only near-duplicate lyric line pairs go to the model through our gateway.
- Your catalog
- A folder of audio files and a catalog.json (title, artist, rights per recording); the index builds on first start. Melody references (a rendering of each composition) enable the interpolation check. Bring your own lyric set, or use the public-domain one.
- Cost per track
- A fraction of a cent in model time at the gateway's list price for the planted demo (one label call); the audio matching is CPU time only.
- Output
- A checklist (CSV or Markdown): each item's kind, reference and rights, times in the track and in the reference, confidence, declared status, and clear, replace or remove with the reason and how to clear it; declared samples not in the catalog; and a signed record.
Pick the tier for the quality you need
Same app at every tier. What changes is the models, the hardware they need, and whether receipts are signed. Scores are measured with the source named, or marked not measured.
- In the hosted demo
Lite
code only, any CPU
Audio matching, exact lyric spans and trigram near-duplicates with no model and no GPU (judge_lyrics: false). Re-worded lyric lines are not labelled; stock phrases are not dismissed by a model.
- Models
- decosa-api clearance module (decosa_api/verticals/clearance)
- Hardware
- Any CPU
- Quality evidence
- Planted samples and melodies found / precision / clean tracks flagged (test split, 108 plants in CC BY music, 30 clean tracks)62 of 108 (57%) / 0.87 / 3 of 30decosa-api docs/evals/sample-clearance.md, 2026-09-25 (thresholds set on the dev split; test scored twice, before and after one dev change, both reported)
- High-confidence items only: found / precision / clean tracks flagged35 of 108 / 1.00 / 0 of 30decosa-api docs/evals/sample-clearance.md, 2026-09-25
- By transform (test): pitch ±1-2 semitones / tempo ±5-10% / low-pass / high-pass / 2 s loops / interpolations14 of 24 / 16 of 24 / 5 of 6 / 6 of 6 / 2 of 6 / 12 of 24decosa-api docs/evals/sample-clearance.md, 2026-09-25
- Lyric lines, code only (test): exact / one or two words changed / heavy paraphrase / clean songs flagged8 of 8 / 12 of 12 / 0 of 8 / 0 of 15decosa-api docs/evals/sample-clearance.md, 2026-09-25 (with embeddings; without them, trigrams alone)
- Latency
- measured: seconds per track on a few CPU threads; no model call.
- Verification
- Proof: partialNo model calls, so no receipts; the record is signed by the instance.
- In the hosted demo
Standard
adds lyric labels by Qwen3.8-27B (hosted demo)
Everything in Lite, plus MiniLM embeddings on CPU and the model's lift, variant or stock label for each near-duplicate lyric line, with a receipt per call.
- Models
- decosa-api clearance module (decosa_api/verticals/clearance)
- all-MiniLM-L6-v2 (ONNX)
- Qwen3.8-27B (NVFP4)
- Hardware
- Any CPU plus 1x RTX PRO 6000 96 GB (measured) or 1x RTX 5090 32 GB (estimate) for the model
- Quality evidence
- Lyric lines with the model's labels (test): exact / one or two words changed / heavy paraphrase / false items / clean songs flagged8 of 8 / 12 of 12 / 1 of 8 / 1 / 0 of 15decosa-api docs/evals/sample-clearance.md, 2026-09-25; 12 model calls, 515 generated tokens for 30 songs
- Audio (same matcher as Lite)62 of 108 found, precision 0.87decosa-api docs/evals/sample-clearance.md, 2026-09-25
- Latency
- measured on our server through the shared gateway: seconds for the planted demo track with one label call; a fraction of a cent per run at the gateway's list price.
- Verification
- Proof: strongHosted: every label call has its own gateway-signed receipt, listed in the signed record.
Every model in the stack
| Model | Tiers | Params · VRAM | Verification | Details |
|---|---|---|---|---|
Audio matcher: log-frequency landmarks with pitch and tempo search, peak-by-peak verification, melody shingles for composition references; lyric spans; declared vs detected; the signed record (no model; CPU)decosa-api clearance module (decosa_api/verticals/clearance) 0 GBProof: partial | LiteStandard | 0 GB | Proof: partial | |
| ||||
Lyric-line embeddings: re-worded lines that share few characters with the originalall-MiniLM-L6-v2 (ONNX)sentence-transformers/all-MiniLM-L6-v2 on Hugging Face (opens in a new tab) 22.7M · 0 GBNo proof yet | Standard | 22.7M · 0 GB | No proof yet | |
| ||||
Model: labels each near-duplicate lyric line lift, variant, stock phrase or differentQwen3.8-27B (NVFP4)nvidia/Qwen3.8-27B-NVFP4 on Hugging Face (opens in a new tab) 27.8B · 20 GBProof: strongIn the hosted demo | Standard | 27.8B · 20 GB | Proof: strongIn the hosted demo | |
| ||||
How well does it find planted borrowings?
Slices of 35 CC BY recordings were pitched, stretched, filtered or looped and mixed 3-12 dB under 73 other tracks, melodies were re-played on other instruments, and public-domain lyric lines were copied or re-worded into new songs. Thresholds were set on a dev split; these are the test split.
- Samples and melodies found (108 plants)
- 57% (62)precision 0.87; 3 of 30 clean tracks got a medium-confidence flag
- High-confidence items
- 35 found, all correct0 of 30 clean tracks flagged
- Samples mixed at -3 / -6 / -9 / -12 dB
- 71% / 57% / 57% / 43%
- Lyric lines: exact / small changes / heavy paraphrase
- 8/8 · 12/12 · 1/8no clean song flagged
- Chromaprint alone, same samples
- 4 of 84and 616 chance matches: built for whole recordings
Where it fails
Quiet slices and short loops, where too few of the reference's spectral peaks survive the mix, and pitch-plus-tempo changes that fall between the search grid points. Three of the nine false items on test were tracks from one series by the same composer that may share material.
What this does not show
Synthetic mixes of one composer's CC BY music are not real productions with compression and effects, and the catalog is 41 references. No real-world recall is claimed.
Source: decosa-api docs/evals/sample-clearance.md, 2026-09-25
Tools, services and hardware
Tools
- Kevin MacLeod recordings (incompetech.com) (opens in a new tab)CC BY 4.0 ("Kevin MacLeod (incompetech.com), Licensed under Creative Commons: By Attribution 4.0")
The demo catalog (35 recordings) and the eval's host tracks (73 more); the list with each Wikimedia Commons page is decosa-api docs/evals/sample-clearance/tracks.json.
- Synthetic melodies (decosa-api scripts/clearance_melody.py)CC0 (ours)
Six composition references for the interpolation check, and their re-played plants.
- English Wikisource, Category:Song lyrics (opens in a new tab)Public domain in the US (songs published before 1929)
The lyric reference set: 156 songs, 5,435 lines.
- FFmpeg (opens in a new tab)LGPL-2.1 or later (GPL builds with some options); run as a separate program
Decodes uploads; its chromaprint muxer (libchromaprint, LGPL-2.1) gives the eval's Chromaprint baseline.
- scripts/clearance_eval.py and scripts/clearance_lyrics_eval.pyApache-2.0
Plant samples, melodies and lyric lines into CC and synthetic material, score recall, precision and false alarms on clean tracks, dev and test splits.
- POST /record/verifyApache-2.0
Checks the signed record and names the first entry that was changed. The console also verifies it in your browser.
Services
- decosa-api:8445
${DECOSA_REGISTRY}/decosa-api:<tag>GET /clearance/info, /clearance/catalog, /clearance/samples; POST /clearance/check (SSE or JSON); GET /clearance/runs/{id}/export?format=csv|md|record. Holds the audio and lyrics in memory for the request and the run for one hour; logs counts only. Needs ffmpeg (in the image) and a catalog folder (DECOSA_CLEARANCE_CATALOG).
- vLLM:8114
vllm/vllm-openai@sha256:c2914767605584b6d8f45686b82de173ecc99e781897aa3d0a66dacd72c51ae1Qwen3.8-27B NVFP4 behind our gateway (hosted) or called directly (self-host), for the lyric labels only.
Hardware
- Any CPU (audio matching, lyric spans and embeddings) Fits
Measured on our server: a 75 s track against the 41-reference demo catalog takes 2-6 s with a few threads while the machine was busy; building the catalog index takes about 10 s for 41 references. The test server held about 1 GB of memory after runs (the embedding model and the lyric set included). The index grows about 25 KB per minute of reference audio (the demo index is 2.8 MB for about 115 minutes).
- 1x RTX 5090 32 GB Fits
For the lyric labels, Qwen3.8-27B NVFP4 needs about 20 GB of weights plus a small KV cache (short prompts). Estimate: same model and prompts as the measured card, not run here on a 5090.
- 1x RTX PRO 6000 Blackwell 96 GB Fits
Measured on our server: the eval, the hosted demo and the self-host check ran on this card, shared with other services the whole time.
Latency per lane
- The planted demo track (75 s audio, 12 lyric lines), hosted gateway route6.7 s
Measuredmeasured on our server 2026-09-25: 6.6, 6.7 and 9.9 s over three runs through our gateway under other load (one label call)
- The clean demo track (60 s, 8 lines)2.2 s
Measuredmeasured on our server 2026-09-25, one run, no model call needed
- Audio matching alone, per eval track (75 s), 16 tracks at once on a shared 32-core box25.0 s
Measuredmeasured on our server 2026-09-25: median over 126 dev tracks while other jobs ran
Notes
- It knows only the catalog you give it. The hosted demo catalog is 35 CC BY recordings and six synthetic melodies; a clean result there says nothing about the rest of recorded music.
- Quiet samples are the hard case: mixed 9-12 dB under the track, about half are found; at -3 dB, about seven in ten. Short loops (1-2.5 s) were found about a third of the time.
- Chromaprint, the fingerprint behind AcoustID, is built to name whole recordings. In our mixes it found 4 of 84 planted samples and made 616 chance matches, so it is not used to flag anything.
- The actions are rules, the same every run: a sample that carries the track (looped, or 4 s or more) is clear; a short incidental one is replace; an interpolation is clear (the composition); a lifted line is clear, a re-worded line replace. Rights decide how to clear: licence (all rights reserved), credit (CC BY) or nothing to license (CC0, public domain). The demo turns on "treat every reference as all rights reserved" to show the full path.
- Heavy paraphrases of a lyric line are out of reach by design: flagging on meaning alone would flag every love song.
- Not included yet: a bulk loader for large catalogs (one folder and one command today), lyric sets in other languages, and a learned audio embedding for short loops (the strong open ones we found, such as MERT, are licensed for non-commercial use only).
Run this exact stack on your machine
Paste into Claude Code / Codex to assemble this stack locally. The prompt checks your GPU, pulls the pinned models, writes the compose file and runs a smoke test.
# Assemble the Decosa sample and lyric clearance pre-check on this machine
You are setting up a pre-release clearance check for a label, library or producer. It takes a track (audio), its
lyrics and the list of samples the artist declared, and returns a checklist: every sample (even pitched, stretched,
filtered or looped), re-played melody and lifted lyric line it finds in our own catalog, with its time in the track
and in the reference, how sure it is, whether it was declared (and with a clearance document), and whether to clear,
replace or remove it. It seals the result in a record signed by this box's own key. Work step by step, show me each
command before you run anything with `sudo`, and stop to ask if a check fails.
## Step 0: set up with a coding agent, rehearse on mock data, then go private
This prompt is for a coding agent running on the machine that will host the service. We recommend Claude Code with
Claude Opus 5.5; any capable coding agent works. Work in this order:
1. Set up on mock data only. During the whole setup you (the agent) work with the synthetic sample bundle below and
nothing else. Do not ask me for real data, and do not open, read, list or copy files that hold real data, even to
"test with something realistic".
2. Rehearse. When the steps below are done and the service is healthy, fetch the mock-data bundle for this tool,
https://decosa.ai/samples/sample-clearance.zip (649 KB, 10 checks, synthetic or openly licensed: see `licence` in expected.json),
show me what is in it, and run the rehearsal against the local API:
`docker compose exec api python scripts/rehearse.py sample-clearance` (the api image carries the same bundle under /app/rehearsal/sample-clearance/;
with no key set, the script asks the local API for a short demo token). From a decosa-api checkout instead:
`python scripts/rehearse.py sample-clearance --bundle sample-clearance.zip --base-url http://127.0.0.1:<PORT>`.
It sends the mock inputs to the local API and prints PASS or FAIL for each expected property (for example: "the undeclared Fork and Spoon slice is flagged", "the Fork and Spoon slice is placed near 0:30", "the declared Dirt Rhodes loop is found and documented"). Show me
the full output. Every check must pass. If one fails, fix the install and run it again; never edit `expected.json`
to make a check pass.
3. Stop there. Once the rehearsal passes, tell me, and I will run my own data against the local API myself, on this
machine.
For the person running this: a coding agent that runs in the cloud sees everything in its context, including files it
reads, command output and anything pasted into the chat. Keep real data out of the chat and out of anything the agent
can read. Switch to your own data only after the rehearsal has passed and the agent's work is done.
## 0. Ground rules and licences
- Audio matching is CPU code in decosa-api (AGPL-3.0-or-later, numpy), with ffmpeg to decode uploads. Lyric-line embeddings:
all-MiniLM-L6-v2 (Apache-2.0) on CPU. Model for the lyric labels: Qwen3.8-27B (Apache-2.0). No paid service and no
public fingerprint API is called (AcoustID is paid for commercial use; we do not use it).
- Unreleased masters are confidential. Bind every port to 127.0.0.1.
The service keeps audio and lyrics in memory for the request and the run for one hour, writes nothing to disk and
logs counts only; keep it that way.
- It is triage for the people who clear samples, not legal advice (US courts disagree on short samples: Bridgeport v.
Dimension Films, 6th Cir. 2005, against VMG Salsoul v. Ciccone, 9th Cir. 2016). Say so wherever you show results.
## 1. Check the machine
1. CPU and disk: the matcher needs a few cores and about 1 GB of memory for a small catalog; plan 25 KB of index per
minute of catalog audio, plus the audio itself.
2. `nvidia-smi` (optional): the lyric labels need Qwen3.8-27B on one GPU with at least 32 GB. Without a GPU, run with
`judge_lyrics: false`: audio and exact or near-duplicate lyric lines still work, only the model's labels are off.
3. `docker --version` and `docker compose version`. If Docker (or, for the model, the NVIDIA container toolkit) is
missing, install it from the official repositories after asking me.
## 2. Images and weights
- `${DECOSA_REGISTRY}/decosa-api:<tag>` (**publishing soon**). If the pull fails, build from source:
`git clone <decosa-api source: on request at https://decosa.ai/contact?topic=self-host>` (access required), check out a release that contains
`decosa_api/verticals/clearance/`, and run `docker build -f docker/api/Dockerfile -t decosa-api:local .`
(the image includes ffmpeg and the `clearance` extra: numpy, onnxruntime, tokenizers).
- `vllm/vllm-openai:v0.29.0` for the model; weights `nvidia/Qwen3.8-27B-NVFP4` (or `Qwen/Qwen3.8-27B-FP8`).
## 3. docker-compose.yml
Write this in `~/decosa/clearance/`:
```yaml
name: decosa-clearance
services:
llm:
image: vllm/vllm-openai:v0.29.0
command: ["--model", "nvidia/Qwen3.8-27B-NVFP4", "--served-model-name", "qwen3.8-27b", "--max-model-len", "16384"]
ports: ["127.0.0.1:8114:8000"]
volumes: ["~/.cache/huggingface:/root/.cache/huggingface"]
deploy: { resources: { reservations: { devices: [{ driver: nvidia, count: 1, capabilities: [gpu] }] } } }
healthcheck: { test: ["CMD", "curl", "-fs", "http://localhost:8000/v1/models"], interval: 30s, retries: 20 }
api:
image: ${DECOSA_REGISTRY}/decosa-api:<tag> # or decosa-api:local
ports: ["127.0.0.1:8445:8445"]
environment:
DECOSA_HOST: 0.0.0.0
DECOSA_PORT: "8445"
DECOSA_DATA_DIR: /data
DECOSA_LLM_ROUTE: direct
DECOSA_LLM_URL: http://llm:8000/v1
DECOSA_LLM_MODEL: qwen3.8-27b
DECOSA_CLEARANCE_CATALOG: /data/clearance/catalog # catalog.json + audio + the index built from them
DECOSA_CLEARANCE_EMBED_DIR: /data/clearance/minilm # all-MiniLM-L6-v2 files
volumes: ["decosa-data:/data"] # a named volume: the image runs as uid 10001, so a root-owned bind mount fails
depends_on: { llm: { condition: service_healthy } }
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8445/healthz', timeout=4)"]
interval: 30s
retries: 10
volumes:
decosa-data: {}
```
Start it: `docker compose up -d`. On first start the api service creates this box's Ed25519 key in the volume under
`attest/` (mode 0600); back the volume up and never print the key.
## 4. The catalog and the embedding model
1. Embedding files (about 90 MB, from huggingface.co at a pinned revision, no key):
`docker compose exec api python -m decosa_api.verticals.clearance.embed fetch /data/clearance/minilm`
2. The demo catalog (35 Kevin MacLeod recordings, CC BY 4.0, from incompetech.com, about 180 MB, and six synthetic
melodies): `docker compose exec api python scripts/clearance_catalog.py demo /data/clearance/catalog`
3. Your own catalog instead: put the audio in the volume and write `/data/clearance/catalog/catalog.json` as
`{"name": "...", "recordings": [{"id": "r1", "title": "...", "artist": "...", "file": "audio/r1.flac", "kind": "recording", "rights": "reserved"}]}`
(`kind: "composition"` for a rendering of a melody; `rights`: reserved, cc-by, cc0 or public-domain; optional
`"lyrics": [{"title", "author", "year", "rights", "lines": [...]}]`). Build the index:
`docker compose exec api python -m decosa_api.verticals.clearance.catalog build /data/clearance/catalog`
4. `docker compose restart api`, then `curl -s localhost:8445/clearance/info | jq '.catalog'` shows `state: "ready"`,
the recording and melody counts, and `lyric_embeddings: "ready"`.
## 5. Smoke test
1. Token: `T=$(curl -s -XPOST localhost:8445/demo/session -H 'content-type: application/json' -d '{"vertical":"sample-clearance"}' | jq -r .token)`.
2. `curl -s -XPOST localhost:8445/clearance/check -H "authorization: Bearer $T" -H 'content-type: application/json' -d '{"sample":"planted","stream":false}' > run.json`
3. `jq '.report.checklist[] | {id, kind, title: .ref.title, where: [.where[] | (.start_s // .line)], status, action}' run.json`.
Expect: "Dirt Rhodes" (a 2 s loop pitched up 2 semitones, near 0:09) declared with a document; "Fork and Spoon"
(near 0:30) and "Synthetic melody 02" (an interpolation near 0:45-0:57) not declared; lyric lines 5 ("By the Light
of the Silvery Moon", 1909) and 8 (re-worded from "Danny Boy", 1913). "Night Train Breaks" is in
`.report.declared_not_found`. Receipts: `attested` (your own key).
4. `jq '{record: .report.record}' run.json | curl -s -XPOST localhost:8445/record/verify -H 'content-type: application/json' -d @-`
must say `ok: true`. Change one `action` in the record's entries and verify again: it must fail.
5. `{"sample":"clean","stream":false}` must return an empty checklist.
6. Time it and tell me. On our RTX PRO 6000 box, shared with other work, the planted sample took about 7 s through the
hosted gateway.
## 6. Point your intake at the local API
Send each release to `POST /clearance/check` with `{"audio_b64", "lyrics", "declared", "title"}` (base64 audio up to
20 MB; declared as a list or as lines `Title - Artist | sample | document`). Put undeclared high-confidence items in
front of the clearance person first, then declared items without a document. Keep the CSV checklist and the signed
record (`/clearance/runs/{id}/export?format=csv|record`) with the release. For the site, set
`NEXT_PUBLIC_DECOSA_API=http://127.0.0.1:8445` in `.env.local`. Contract: `API_CONTRACT.md`, section "Sample and lyric
clearance pre-check".
Off, and it should stay off on a box that holds unreleased masters: joining serves other people's requests on this
GPU. Only on a separate machine, and only with my explicit yes, follow the provider guide at `/provide` on the site.Rules and regulations it checks againstDated, linked to the primary source; not legal advice
Regulation watch
Loading the watch status…
3 laws, rules and guidance pages cited; 3 watched nightly at the primary source. A change marks this page for a human re-check; nothing is edited automatically. What we cite and how it is watched
Technical detailsModels, where it runs, labels
In short
Last reviewed
- What it is
- Samples, re-played melodies and lifted lyric lines found before release, each with its time in the track, declared or not, and a clear, replace or remove call, in one signed record.
- Who it's for
- Teams in music and legal.
- Where it runs
- Self-host with your own catalog; the hosted demo uses a CC BY demo catalog
- Key numbers
- 62 of 108 (57%) Audio plants found, medium and high confidence (test split, n = 108)
- 0.87 (9 false items) Audio precision, medium and high confidence (test split)
- 35 of 108 (32%), precision 1.00 Audio plants found, high confidence only (precision) (test split, n = 108)
- 6.7 s Median end-to-end run, hosted (QA sweep 2026-09-25)
- Models
- Audio matching in code (no model); Qwen3.8-27B labels near-duplicate lyric lines
- Where
- Self-host with your own catalog; the hosted demo uses a CC BY demo catalog
- Checks
- Receipt per lyric-label call; signed record of what was checked, against which catalog
- Output
- Structured data · Signed record or verdict
- Data
- Confidential business data
- Hardware
- 1× 96 GB GPU
- Licence
- Permissive (Apache-2.0, MIT)
- Part of
- Decosa Studio: Studio checks
- Runs in
- Decosa hosted · Self-host
- Built from
- Typed judgment · Signed record
Questions people ask
What does the pre-check find?
Samples matched against your own catalog, tolerant of pitch shifts to about two semitones, tempo changes to about 14%, filtering and loops; re-played melodies (interpolations) when melody references are loaded; and lyric lines lifted word for word or re-worded. Each item has its time in the track and in the reference.
How accurate is it?
On synthetic test mixes it found 62 of 108 planted borrowings at medium and high confidence (precision 0.87), and 35 of 108 at high confidence with no false items. Quiet samples and short loops are missed most. No real-world recall is claimed.
Does a short sample need clearance?
It is unsettled in the US: Bridgeport v. Dimension Films (6th Cir. 2005) found no de minimis defence for sound recordings, while VMG Salsoul v. Ciccone (9th Cir. 2016) found one. The checklist never treats a short sample as safe. It is triage, not legal advice.
Sample or interpolation: what needs clearing?
A sample usually needs the sound recording licence and the musical work licence; an interpolation re-records the music, so it needs the composition licence only, and it is negotiated rather than compulsory.
Why not just use a fingerprint service?
Chromaprint, the fingerprint behind AcoustID, is built to name whole recordings. In our mixes it found 4 of 84 planted samples and made 616 chance matches, so it is not used to flag anything.
Does unreleased audio leave my building?
Not when self-hosted: the index is built from your own files and matching runs on CPU. On the hosted demo the audio is matched on Decosa's server and only near-duplicate lyric line pairs go to the model.
Ask a question or leave feedbackWe read every message and publish useful answers
Ask about Sample and lyric clearance pre-check
We read every message. Questions, comments and our answers show here once we have reviewed and approved them.
Loading questions…