Docker worker (Linux)
Docker worker for AI Supervisor: installing it on a Linux server from scratch, NVIDIA GPU, connecting it to MikoPBX, checking that it works, updating and removing it.
The Docker worker is a container that analyzes calls locally with AI on your Linux server. It takes jobs from the queue of the Local AI Supervisor module, analyzes the transcript with a local language model, detects emotions in the call recording and sends the result back to the PBX. Transcripts and recordings never leave your network.
The Docker worker is an alternative to the AI Supervisor Worker application for macOS. Both share the same analysis logic: prompts, result schema, linking of findings to transcript lines and quality criteria are identical, so the result does not depend on which worker took the job.
The image is published on Docker Hub: excla1m/mikopbx-ai-supervisor-worker. The latest tag always points to the latest stable version.
How it works
The worker runs as two containers from one compose.yaml file:
ai-supervisor-worker
excla1m/mikopbx-ai-supervisor-worker
Connection to MikoPBX, job queue, prompts, validation of the model output, voice emotion analysis (SenseVoice, on the CPU)
ai-supervisor-ollama
ollama/ollama
The local language model. If the server has an NVIDIA GPU, the model runs on it
The worker does not pick calls and does not keep a server-side queue: the module in MikoPBX decides which calls are analyzed, with which model and which components.
Requirements
OS
64-bit Linux (x86_64 or arm64)
Ubuntu Server 24.04 LTS or Debian 12
CPU
4 cores with AVX2
6-8 cores
Memory
8 GB
16 GB
GPU
optional
NVIDIA with 8 GB of video memory or more, Turing or newer
Disk
40 GB
60 GB
Docker
Docker Engine with the Compose plugin 2.24 or newer
latest stable version
MikoPBX
Local AI Supervisor module with worker API v2 support
latest module version
Network
outbound HTTPS to MikoPBX, Docker Hub, registry.ollama.ai and huggingface.co
same
Models
The model is selected in MikoPBX: Settings → AI analysis. Every job comes with its own model profile, and the worker downloads the model into Ollama if it is not there yet.
Qwen3.5 4B Q4 (recommended)
qwen3.5:4b
3.3 GB
4-6 GB
Everyday call analysis, fast
Qwen3.5 9B Q4 (higher quality)
qwen3.5:9b
6.6 GB
8-12 GB
Complex and long conversations; needs a 12 GB GPU
For voice emotion analysis the worker downloads the SenseVoice Small model (ONNX, about 240 MB) into the models volume on the first such job and verifies the checksum of every file.
Step 1. Preparing the server
Install Docker Engine and the Compose plugin:
Check the installation and the CPU:
Check access to MikoPBX and Docker Hub:
Step 2. NVIDIA GPU (optional)
Skip this step if there is no GPU: the model will run on the CPU.
Install the NVIDIA driver 550 or newer. On Ubuntu:
Check that the driver sees the card:
Install the NVIDIA Container Toolkit so that Docker can pass the GPU to containers:
Check the GPU inside a container:
The command must show your GPU, for example:
Step 3. Preparing MikoPBX
Open Modules → Local AI Supervisor → Settings → Workers.
Click Generate API key.
Copy the key: it is shown only once and is no longer available after the page is reloaded.
In Settings → AI analysis, check the selected model (see Models).
If the module is being set up for the first time, the key can be created in the setup wizard on the Local worker step: click Generate API key; the macOS application does not need to be downloaded.
Step 4. The compose.yaml file
Create the worker directory and the compose.yaml file:
name: ai-supervisor-worker
Fixes the volume names (ai-supervisor-worker_data and others) regardless of the directory name.
restart: unless-stopped
The worker and Ollama start together with Docker after a server reboot.
volumes
data - settings, UID and worker status; models - the SenseVoice model; ollama - language models.
read_only, cap_drop, no-new-privileges
The worker cannot write anywhere except its volumes and /tmp and runs unprivileged as uid 10001.
stop_grace_period: 90s
Time for the current job to finish or return to the queue when the worker stops.
OLLAMA_NUM_PARALLEL: "1"
The worker analyzes one call at a time, so Ollama does not split memory between requests.
OLLAMA_KEEP_ALIVE: "30m"
The model stays loaded between jobs instead of being read from disk for every call.
deploy.resources... (ollama service)
Passes the NVIDIA GPU to the Ollama container. The worker itself does not need the GPU.
The Ollama port is not published: only the worker talks to it over the internal Docker network.
Step 5. Pulling the images
Docker picks the server architecture (x86_64 or arm64) itself. The worker image takes about 1 GB on disk, the Ollama image about 9 GB.
Step 6. Connecting to MikoPBX (setup)
Run the setup wizard:
The wizard asks for:
MikoPBX address -
https://<mikopbx-address>without a path.Whether to verify the MikoPBX certificate - no by default (see TLS).
Worker key - the key from step 3; input is hidden.
Worker name - how it is shown in the Workers section.
Local model address - keep
http://ollama:11434/v1.Model to prepare - the model the worker downloads before the first job. Use the model of the profile selected in MikoPBX:
qwen3.5:4borqwen3.5:9b.
The wizard then checks the connection and saves the settings to the data volume (/data/config.json, mode 600). Example:
On the first installation the model is not in Ollama yet, so the last check prints Reachable: Local runtime is reachable, but model "qwen3.5:4b" is not installed yet. instead - this is expected: the model is downloaded after the start.
Step 7. Starting
On the first start the worker registers in MikoPBX and downloads the model into Ollama (qwen3.5:4b - 3.3 GB, a few minutes), then starts taking jobs:
Checking that it works
In MikoPBX, the worker appears in Settings → Workers with the Online status and its IP address.
The
statuscommand shows the state and the job counter:The
checkcommand checks the key, the model and the voice analysis runtime without running jobs:With a GPU, check that the whole model is loaded into it:
A value such as
13%/87% CPU/GPUmeans the model did not fit into the video memory and part of the work runs on the CPU. Choose a smaller model profile or reduce the context size in MikoPBX.The log shows call analysis jobs and voice emotion jobs. On the first voice job the worker downloads the SenseVoice model:
The call card shows the summary, the scores and, if the component is enabled, the voice emotions.
On a GPU, a call is usually analyzed with qwen3.5:4b in 30-60 seconds, and voice emotions take 5-20 seconds.
Management
State
docker compose exec worker ai-supervisor-worker status
Check connection, key and model
docker compose exec worker ai-supervisor-worker check
Worker log
docker compose logs -f --tail 100 worker
Loaded models
docker compose exec ollama ollama ps
Stop
docker compose stop
Start
docker compose start
Restart
docker compose restart
Change settings
docker compose run --rm worker setup, then docker compose up -d
Version
docker compose exec worker ai-supervisor-worker version
Run all commands in /opt/mikopbx-ai-supervisor-worker. On stop, the current job finishes or returns to the MikoPBX queue; new calls wait in the queue.
Updating
Pull the new image versions and recreate the containers. Models and settings are kept in volumes.
To pin a specific version, use a tag such as excla1m/mikopbx-ai-supervisor-worker:<version>-cpu in the image line, for example 0.1.7-cpu. The list of versions is on the Tags tab on Docker Hub.
Removing
Then delete this worker's access key in MikoPBX in the Workers section. Without -v the volumes are kept, and the models do not need to be downloaded again after reinstalling.
Configuration with .env
Instead of setup, settings can be set in an .env file next to compose.yaml. A non-empty environment variable always wins over the value saved by the wizard.
PBX_URL
-
MikoPBX address: https://host[:port], no path
WORKER_TOKEN / WORKER_TOKEN_FILE
-
Worker key as a string or a path to a file inside the container
WORKER_NAME
Docker AI worker
Name in the Workers section
WORKER_UID
generated automatically
Stable identity; a key is bound to one UID
PBX_TLS_VERIFY
false
true rejects an untrusted MikoPBX certificate
PBX_CA_FILE
-
Extra CA (PEM or DER) when TLS verification is on
AI_BASE_URL
http://ollama:11434/v1
Local model address: Ollama or an OpenAI-compatible server
AI_MODEL
qwen3.5:4b
Model the worker downloads before the first job. The analysis model is selected in MikoPBX
AI_TIMEOUT
300
Limit for one model request, seconds (the MikoPBX profile may override it)
POLL_INTERVAL
15
Pause between queue polls when idle, seconds
HEARTBEAT_INTERVAL
60
Job lease renewal interval, seconds
API_TIMEOUT
30
Limit for one MikoPBX request, seconds
ACOUSTIC_TIMEOUT
60
Limit for voice emotion analysis of one call, seconds
ONNX_THREADS
0
CPU threads for voice analysis, 0 - all cores
LOG_LEVEL
INFO
DEBUG, INFO, WARNING, ERROR
Model on another server
If the language model already runs on another server (Ollama, vLLM, LM Studio or another OpenAI-compatible server), the Ollama container is not needed:
Remove the
ollamaservice, thedepends_online and theollamavolume fromcompose.yaml.Set the server address in
.env:AI_BASE_URL=http://<server-address>:11434/v1.Restart the worker:
docker compose up -d.
The model for each job is still selected in MikoPBX, so it must be available on that server.
TLS
Certificate verification is off by default: the worker accepts any MikoPBX certificate (self-signed, issued for another name, a PBX reached by IP), and the traffic is still encrypted. This matches AI Supervisor Worker for macOS.
To reject untrusted certificates, turn verification on in setup or set PBX_TLS_VERIFY=true. The system CA store is used; for your own certificate authority, pass the file with PBX_CA_FILE and mount it into the container.
Troubleshooting
status: update required (module or worker)
The module and worker versions are not compatible. Update Local AI Supervisor or the worker image. The worker re-checks every 15 minutes.
status: the PBX rejected the worker key
The key was deleted, mistyped or is already bound to another worker. Generate a new key in Workers and run setup again.
status: PBX unreachable, waiting to retry
No connection to MikoPBX. Check curl -skI https://<mikopbx-address> from the server. The worker retries with a growing interval up to 30 minutes.
could not select device driver "nvidia" on start
The NVIDIA Container Toolkit is not installed or Docker was not restarted after configuring it. Repeat step 2.
ollama ps shows 100% CPU although there is a GPU
The Ollama container did not get the GPU: check the deploy block in compose.yaml and docker run --rm --gpus all ubuntu nvidia-smi.
ollama ps shows CPU/GPU, analysis is slow
The model does not fit into the video memory. Select the Qwen3.5 4B Q4 profile or reduce the context size in MikoPBX.
Jobs end with a timeout
The model is too slow, usually on a CPU without a GPU. Use a GPU or a server with a faster CPU.
The model is not downloaded
No access to registry.ollama.ai. Allow outbound HTTPS for the server or proxy.
The SenseVoice model is not downloaded
No access to huggingface.co. Allow outbound HTTPS for the server or proxy.
docker pull fails with connection reset or a timeout
No access to Docker Hub. Allow outbound HTTPS to registry-1.docker.io and production.cloudfront.docker.com or configure a registry mirror.
TLS error on connect
Certificate verification is on and the MikoPBX certificate is untrusted. Turn verification off or pass your CA.
The container is unhealthy
The worker loop has not reported for 10 minutes. Check docker compose logs --tail 200 worker.
Data and security
Language models
ai-supervisor-worker_ollama volume
SenseVoice model
ai-supervisor-worker_models volume (/models)
Settings and key
ai-supervisor-worker_data volume, /data/config.json with mode 600
Worker UID
ai-supervisor-worker_data volume, /data/worker_uid
Logs
Docker log and a file in /data/logs
Temporary recordings
ai-supervisor-worker_data volume, deleted after the job
The worker connects to MikoPBX with outbound HTTPS requests only, receives transcripts and recordings only for the jobs assigned to it and does not keep them after processing. The language model runs inside your network and does not send data to external services. The worker key grants access only to the AI Supervisor module API.
Last updated
Was this helpful?

