Aviant is a self-hosted speech enhancement server by ai-coustics. It takes noisy audio and produces clean, enhanced speech — running entirely on your infrastructure.
On a Mac, do not use Docker. No container runtime on macOS can reach the Apple GPU, so the image below resolves to an arm64 CPU build that runs roughly 14x slower — slower than realtime. See Running on macOS.
1. Run the server (requires an NVIDIA GPU):
docker run --gpus all -p 8080:8080 --restart unless-stopped \
-v /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:ro \
-e SDK_KEY="YOUR-KEY" \
ghcr.io/ai-coustics/aviant-wgpu:latest --batch-size 1 --model lark-v2--restart unless-stopped matters: if the compute device is lost, the server reports 503 and exits so a supervisor can replace it. Without a restart policy it stays down.
2. Check it's running:
curl http://localhost:8080/health
# {"status":"ok", ...}3. Enhance an audio file:
curl -X POST http://localhost:8080/v1/enhance \
-F audio=@your-audio-file.wav \
-o enhanced.wavFor environments without Vulkan drivers (e.g. Azure NC/ND-series VMs), use the CUDA image instead:
docker run --gpus all -p 8080:8080 --restart unless-stopped \
-e SDK_KEY="YOUR-KEY" \
ghcr.io/ai-coustics/aviant-cuda:latest --batch-size 1 --model lark-v2No Vulkan ICD mount needed. Requires NVIDIA driver >= 560.28.
WGPU image (aviant-wgpu) |
CUDA image (aviant-cuda) |
|
|---|---|---|
| NVIDIA Container Toolkit | required | required |
| Vulkan ICD files | required (mapped via -v) |
not needed |
| Min NVIDIA driver | any recent | >= 560.28 |
| Platforms | linux/amd64, linux/arm64 (CPU) | linux/amd64 only |
--batch-size controls how many frames are processed in parallel on the GPU. Each frame corresponds to ~20 s of audio. Processing time scales linearly with batch size.
| Model | Frame length | VRAM usage | Time per frame (RTX 3090) |
|---|---|---|---|
| Lark v2 | 20s | < 4 GB | ~4.7 s |
| Lark v1 | 20s | < 3 GB | ~2.3 s |
| Finch v1 | 20s | < 3 GB | ~2.3 s |
Note: The first request after startup is slow (~80 s on an RTX 3090) due to Vulkan shader compilation. Use
--warmupor build a pre-warmed image to eliminate this. See Reducing cold start below.
200 with "status":"ok" when the server can serve; 503 with "status":"unavailable" and a reason when it cannot. Use it as both a liveness and a readiness probe — a 503 means restart, not retry.
{
"status": "ok",
"version": "0.7.0",
"model": "lark-v2",
"backend": {
"selected": "wgpu",
"status": {"cpu": "compiled", "wgpu": "selected", "cuda": "not-compiled"}
},
"ffmpeg": {"ffmpeg": true, "ffprobe": true, "loudnorm": true, "deesser": true, "libmp3lame": true},
"queue": {"depth": 0, "capacity": 16}
}not-compiled means this image was built without that backend, which is different from a backend that is present but has no usable device.
Checks the environment and reports every problem in one run, then exits non-zero if the machine could not serve. Run it on a host before deploying, or when opening a support ticket.
Give it the same GPU access, ICD mount and key as the server, or it will report failures caused by the way you invoked the diagnostic rather than by the host:
# WGPU image
docker run --rm --gpus all \
-v /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:ro \
-e SDK_KEY="YOUR-KEY" \
ghcr.io/ai-coustics/aviant-wgpu:latest doctor
# CUDA image (no ICD mount), machine-readable for a support ticket
docker run --rm --gpus all \
-e SDK_KEY="YOUR-KEY" \
ghcr.io/ai-coustics/aviant-cuda:latest doctor --jsonIt verifies ffmpeg and its required filters, the weight file, the licence key (offline, without printing it), temp-directory writability, the GPU adapters, and that a real tensor operation on the selected device returns the right answer.
Because it runs a real tensor operation, dropping --gpus all or the ICD mount makes the GPU checks fail on a perfectly healthy host. Omitting SDK_KEY is only a warning — the licence check is skipped, every other check still runs.
Enhance an audio file synchronously. Returns audio/wav (16-bit PCM, 32 kHz mono).
File upload (multipart/form-data):
curl -X POST http://localhost:8080/v1/enhance \
-H "Authorization: Bearer $SDK_KEY" \
-F audio=@input.wav \
-o enhanced.wavURL mode (application/json):
curl -X POST http://localhost:8080/v1/enhance \
-H "Authorization: Bearer $SDK_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/audio.wav"}' \
-o enhanced.wavThe URL must be http or https, and its host must resolve only to public addresses. Loopback, private, link-local/cloud-metadata and other non-routable addresses are refused with 400. Redirects are not followed and proxy environment variables are ignored. To process a local file, upload it as multipart instead.
Normalize an audio file without enhancement. Applies EBU R128 loudness normalization (-17 LUFS) and resamples to 32 kHz mono. Returns audio/wav. This is the same preprocessing that runs internally before enhancement, useful when you need the normalized audio separately.
Does not use the GPU or run model inference, so responses are fast (roughly 2-4 seconds per minute of audio).
File upload (multipart/form-data):
curl -X POST http://localhost:8080/v1/normalize \
-H "Authorization: Bearer $SDK_KEY" \
-F audio=@input.wav \
-o normalized.wavURL mode (application/json):
curl -X POST http://localhost:8080/v1/normalize \
-H "Authorization: Bearer $SDK_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/audio.wav"}' \
-o normalized.wavThe URL must be http or https, and its host must resolve only to public addresses. Loopback, private, link-local/cloud-metadata and other non-routable addresses are refused with 400. Redirects are not followed and proxy environment variables are ignored. To process a local file, upload it as multipart instead.
Async enhancement via cloud storage. The server downloads from input_url, processes the audio, and uploads the result to output_url. A preprocessed (normalized, 32 kHz) copy of the input is also uploaded alongside the output as {input_filename}_preprocessed.wav.
Supports s3:// and az:// (Azure Blob Storage) URLs. Credentials are read from standard environment variables (AWS_* for S3, AZURE_* for Azure).
curl -X POST http://localhost:8080/v1/enhance/async \
-H "Authorization: Bearer $SDK_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_url": "s3://my-bucket/input.wav",
"output_url": "s3://my-bucket/output.wav"
}'
# Returns 202 Accepted| Status | Meaning | Retry? |
|---|---|---|
400 |
Bad request — an unsupported upload file extension, audio that cannot be decoded, or a URL-mode URL that is not public http(s) |
No, it will fail identically |
401 |
Unauthorized — missing, malformed or invalid SDK key | No |
500 |
Internal server error — processing failed | Maybe |
503 |
The server cannot serve at all — the compute device was lost, or a required ffmpeg capability is missing | After the restart |
On 503 the process exits so your supervisor restarts it.
Pass your SDK key in one of two ways:
| Method | Usage |
|---|---|
| Environment variable | Set SDK_KEY when starting the container (applies to all requests) |
| Bearer token | Pass Authorization: Bearer <key> as a request header |
When both are provided, the header takes precedence. Create SDK keys in the ai-coustics developer portal.
SDK_KEYserves unauthenticated requests. WithSDK_KEYset, a request that carries noAuthorizationheader is served using it — so anything that can reach the port can spend your licence. For any deployment reachable beyond loopback, set--allow-env-key falseand have clients send their own header. This default will change in a future major version.
A malformed header (Basic ..., a bare token, or Bearer with no key) is rejected with 401 rather than falling back to SDK_KEY.
Run --help for the authoritative list.
| Flag | Description | Default |
|---|---|---|
--host |
Address to bind | 127.0.0.1 |
--port |
Port the server listens on | 8080 |
--backend |
Compute backend: wgpu, cuda, cpu |
wgpu |
--model |
Model: lark-v2, lark-v1, finch |
lark-v2 |
--batch-size |
Frames processed in parallel on the GPU | unlimited |
--weights |
Path to a custom .aviant weight file |
auto per model setting |
--allow-env-key |
Serve requests with no Authorization header using the server's own SDK_KEY |
true |
--allow-cpu-fallback |
Fall back to the CPU backend if the GPU cannot compute, instead of refusing to start | off |
--warmup |
Run a dummy inference at startup to compile GPU shaders before serving | off |
--no-warmup |
Disable startup warmup (the default) | — |
--warmup-only |
Run warmup then exit. Used for building pre-warmed images | — |
--host defaults to loopback. A server started by hand serves only the machine it runs on. The published Docker images pass --host 0.0.0.0 in their entrypoint — a container binding loopback would be unreachable through -p — so containers are unaffected.
The server verifies before it accepts traffic, and refuses to start rather than failing every request later:
- ffmpeg:
ffmpeg,ffprobe,loudnorm,deesserand thepcm_s16leencoder must be present. Every missing capability is named at once.libmp3lameis optional - The compute device: a real tensor operation must return the right answer on the selected backend. Pass
--allow-cpu-fallbackto fall back to the CPU (roughly 14x slower) instead
macOS runs the server natively, not in a container. Docker Desktop, Podman, Colima, OrbStack and Apple's container tool all run Linux in a VM, and Apple exposes no GPU compute API to VMs — so a container on a Mac cannot reach Metal at any layer, and falls back to a CPU build measured at roughly 14x slower.
Development target. Not supported for production deployment. Apple GPU compute cannot be tested in CI, so we do not promise support for something we cannot verify on every change.
Measured on an M4 Max, lark-v2, --batch-size 1, 30.6 s of audio:
| Backend | End-to-end wall | vs realtime |
|---|---|---|
| wgpu (Metal) | 21.2 s | 0.69x — faster than realtime |
| cpu (NdArray) | 288.8 s | 9.4x — far slower than realtime |
Native macOS packaging (brew install) is not released yet. If you need to run Aviant on a Mac today, get in touch — do not use the Docker image as a substitute.
The server binds 127.0.0.1 by default. Docker Desktop and OrbStack both proxy host loopback, so a client container reaches it without widening the bind:
services:
your-client:
environment:
# Docker Desktop; use host.orb.internal on OrbStack
AVIANT_URL: http://host.docker.internal:8080Do not pass --host 0.0.0.0 for this. It is not needed on either runtime, and combined with the default --allow-env-key it lets anything on your network spend your licence.
The first inference after startup is slow because GPU kernels are compiled on demand: ~80 s for WGPU/Vulkan on an RTX 3090, 75–120 s for WGPU/Metal on an M4 Max, and longer for CUDA/NVRTC. There are two ways to handle this:
Add --warmup to run a dummy inference during server startup. This compiles all GPU shaders before the server accepts traffic. The container takes longer to start, but user requests are always fast.
docker run --gpus all -p 8080:8080 --restart unless-stopped \
-v /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:ro \
-e SDK_KEY="YOUR-KEY" \
ghcr.io/ai-coustics/aviant-wgpu:latest --batch-size 1 --model lark-v2 --warmupBuild a new image that bakes in the compiled shader cache. This eliminates the cold start on subsequent container boots, which is useful for scale-to-zero deployments where containers restart frequently.
Important: Shaders are specialized per batch size. The warmup must use the same --batch-size as production inference.
The compiled cache lives in a fixed per-user directory, chosen in this order:
AVIANT_CACHE_DIR, if set$XDG_CACHE_HOME/aviant, ifXDG_CACHE_HOMEis set~/Library/Caches/avianton macOS,~/.cache/aviantelsewhere (/root/.cache/aviantin the Docker images)$TMPDIR/aviant-cache, when there is noHOMEor none of the above is writable
aviant doctor prints the path in use and whether it is warm, and the server prints it at startup. A warmed image keeps the server version it was built from, so re-run warmup against each new base image.
# 1. Run warmup on a GPU host (compiles shaders, writes driver caches to disk)
docker run --gpus all \
-v /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:ro \
--name aviant-warmup \
ghcr.io/ai-coustics/aviant-wgpu:latest \
--model lark-v2 --batch-size 1 --warmup-only
# No --restart here: --warmup-only is meant to exit, and a restart policy
# would relaunch it forever. Restart policies belong on serving containers.
# 2. Commit the stopped container as a new image
docker commit aviant-warmup aviant-wgpu-warmed
docker rm aviant-warmup
# 3. Use the warmed image in production
docker run --gpus all -p 8080:8080 --restart unless-stopped \
-v /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:ro \
-e SDK_KEY="YOUR-KEY" \
aviant-wgpu-warmed --batch-size 1 --model lark-v2Convenience scripts are provided for both backends:
# WGPU (Vulkan)
./scripts/warmup-image.sh --base ghcr.io/ai-coustics/aviant-wgpu:latest --model lark-v2 --batch-size 1
# CUDA
./scripts/warmup-cuda.sh --base ghcr.io/ai-coustics/aviant-cuda:latest --model lark-v2 --batch-size 1Re-warm after every upgrade. A warmed image is tied to the version it was built from. In particular, an image warmed with 0.6.x is not warm under 0.7.0: the GPU cache format changed, and the cache moved from root's home to the aviant user's.
Since 0.7.0 the images run as an unprivileged user, aviant (uid/gid 10001), not as root. The binary and weights under /app are read-only. At runtime the server writes only to:
| Path | Purpose |
|---|---|
/tmp |
Per-request working files |
/home/aviant/.cache/aviant |
GPU kernel cache (override with AVIANT_CACHE_DIR) |
-
Read-only mounts such as
-v /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:roare unaffected. -
A writable mount must be writable by uid 10001. For example, to keep the GPU cache across container restarts:
sudo mkdir -p /var/cache/aviant && sudo chown 10001:10001 /var/cache/aviant docker run --gpus all -p 8080:8080 --restart unless-stopped \ -v /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:ro \ -v /var/cache/aviant:/var/cache/aviant -e AVIANT_CACHE_DIR=/var/cache/aviant \ -e SDK_KEY="YOUR-KEY" \ ghcr.io/ai-coustics/aviant-wgpu:latest --batch-size 1 --model lark-v2
If the directory isn't writable, the server still starts, but it keeps the cache inside the container, so it is lost on restart.
-
Kubernetes:
runAsNonRoot: trueworks as-is, because the image declares a numeric user. SetfsGroup: 10001(orrunAsUser/runAsGroup: 10001) on pods that mount writable volumes. -
A different uid (
--user,runAsUser) also works. A uid with no home directory in the image puts the GPU cache in/tmp, so setAVIANT_CACHE_DIRto a writable path to keep warm starts.
- Input: most audio formats and sample rates (ffmpeg-based decoding)
- Output: mono WAV, 16-bit PCM, 32 kHz
- Concurrency: the server accepts concurrent requests and queues them in front of the inference engine
Azure NC/ND-series VMs have NVIDIA GPUs with CUDA but typically no Vulkan drivers. Use the CUDA image:
- Create an NC-series VM (e.g. NC4as_T4_v3) or AKS GPU node pool
- Install NVIDIA Container Toolkit
- Verify GPU access:
nvidia-smishould show driver >= 560.28 - Run the CUDA image:
docker run --gpus all -p 8080:8080 --restart unless-stopped \
-e SDK_KEY="YOUR-KEY" \
ghcr.io/ai-coustics/aviant-cuda:latest --warmup --batch-size 1 --model lark-v2| Symptom | Cause | Fix |
|---|---|---|
CUDA driver initialization failed |
Driver too old or missing | Update to NVIDIA driver >= 560.28 |
No CUDA devices found |
Container can't see GPU | Add --gpus all to docker run |
NVRTC compilation error |
Missing CUDA headers | Use the official aviant-cuda image (headers are baked in) |
| Slow first request | Kernel compilation (expected) | Use --warmup flag or pre-warm with warmup-cuda.sh |
- Processing very long files (1 h @ 32 kHz mono, ~230 MB) may exhaust host memory.
--batch-sizedoes not control this: the pipeline computes the STFT for every frame before batching begins, so host memory scales with the length of the input. Split inputs longer than ~10 minutes - Processing many small files concurrently may exhaust disk I/O (file-based pipeline)
- The inference queue holds 16 requests; beyond that, requests wait. Watch
queue.depthin/health - The server authenticates and sends usage telemetry to the ai-coustics backend. Contact us to discuss air-gapped deployments