AISBF Logo AISBF

AI Service Broker Framework — AI Should Be Free

CoderAI documentation · Docker / OCI deployment

Install CoderAI with the provided Docker / OCI image

Run CoderAI as a container with persistent config, model, and cache volumes. The repository ships Dockerfile.oci plus helper scripts for building and running the image with Docker or Podman.

What the image contains

The CoderAI repository includes packaging/linux/Dockerfile.oci, build-oci.sh, the lower-level run-oci.sh helper, and packaging/linux/README-RUN.txt. When installed through the Docker / OCI installer, the user-facing run command is coderai-docker. The OCI image exposes one public port, 8776, and keeps mutable state outside the image in mounted volumes.

Published routes

  • http://HOST:8776/ — CoderAI server, OpenAI-compatible API, admin UI.
  • http://HOST:8776/editor/ — bundled video editor from tools/video_editor.py.
  • http://HOST:8776/videogen/ — bundled VideoGen Studio from tools/videogen.py.
  • http://HOST:8776/township/ — bundled Township Fighters demo from tools/gen_township_fighters.py.

Persistent volumes

  • /config — app config, auth, users, tokens.
  • /models — model registry and model data paths.
  • /cache — Hugging Face, diffusers, runtime caches, and generated tool outputs.
First login: after boot, open http://127.0.0.1:8776/admin. The app creates initial admin / admin credentials; change them immediately before exposing the service beyond localhost.

Bundled tools inside the image

The Docker / OCI image starts the main CoderAI server plus the three demo/example applications from the repository’s tools/ directory: video_editor.py, videogen.py, and gen_township_fighters.py. nginx fronts all of them on the single published port 8776.

Video editor — /editor/

tools/video_editor.py is a browser editor for uploaded or server-side videos. It can generate TTS narration through CoderAI, place audio on a timeline, add music, speed up selected regions, and render with ffmpeg.

VideoGen Studio — /videogen/

tools/videogen.py manages character and environment profiles, then assembles multi-clip short movies with generated video, speech/lip-sync, music, and sound effects.

Township Fighters — /township/

tools/gen_township_fighters.py is an example app for creating MMA-style fighter-match videos: generate fighters, environments, fight clips, progress updates, and output media.

In the container, generated outputs live under cache-backed paths such as /cache/videogen_output and /cache/township_output, so keep the /cache volume persistent and large.

Download the ready-to-use install bundle

The AISBF website document root includes coderai-docker-dist.tar, a bundle containing everything needed to run CoderAI from a prebuilt all-in-one Docker image. The container serves the CoderAI server, OpenAI-compatible API, admin UI, video editor, VideoGen Studio, and Township Fighters demo behind one nginx port.

Bundle contents

  • install.sh — loads the Docker image and installs the runner.
  • coderai-docker — run wrapper installed to your PATH by install.sh.
  • coderai-dist.tar.gz — gzip-compressed docker save image.
  • README.txt / README.md — bundle documentation.

Download and install

curl -L -o coderai-docker-dist.tar https://aisbf.cloud/coderai-docker-dist.tar
tar -xf coderai-docker-dist.tar
cd coderai-docker-dist
./install.sh
coderai-docker --nvidia --detach

Use coderai-docker --vulkan for AMD/Intel Vulkan hosts or coderai-docker --cpu for a smoke test. Keep persistent /config, /models, and /cache volumes as shown below.

Build the OCI image from the repository

If you have a prebuilt image from your registry, skip this section and use that image tag in the run commands. To build locally from the Nexlab repository:

git clone git@git.nexlab.net:nexlab/coderai.git
cd coderai
./build-oci.sh -t coderai:local

The build script defaults to coderai:local when no tag is provided. It builds from pinned Linux packaging inputs, native wheels, and the repository’s OCI Dockerfile.

Build from an existing venv

./build.sh all
source venv_all/bin/activate
./build-oci.sh --from-venv -t coderai:venv

Useful when you already tested a local virtualenv and want to package that runtime.

Build from a specific venv

./build-oci.sh --venv ./venv_all -t coderai:venv

The packaging script can also include local helper binaries or directories with --include-local-bin and --include-local-dir.

Quick run with the installed command

After installing the Docker / OCI package, use coderai-docker. It is the installer-provided wrapper around the OCI runtime helper: it creates persistent config/model/cache directories, publishes host port 8776, and sets the container server host to 0.0.0.0.

# NVIDIA CUDA host
coderai-docker --nvidia

# AMD / Intel Vulkan host
coderai-docker --vulkan

# CPU-only smoke run
coderai-docker --cpu

Use -d or --detach to run in the background, -p 9876 or --port 9876 to change the host port, and --podman to use Podman instead of Docker. If you are working directly inside a source checkout, ./run-oci.sh is the lower-level equivalent.

coderai-docker --nvidia --detach --port 8776 --data-dir /srv/coderai

Manual docker run

If you prefer explicit container commands, create state directories first and run the container as your own UID/GID so bind-mounted files are not owned by root.

mkdir -p coderai-config coderai-models coderai-cache
sudo chown -R "$(id -u):$(id -g)" coderai-config coderai-models coderai-cache

docker run --gpus all --ipc=host -p 8776:8776   --user "$(id -u):$(id -g)"   -v "$PWD/coderai-config:/config"   -v "$PWD/coderai-models:/models"   -v "$PWD/coderai-cache:/cache"   coderai:local

NVIDIA

Install a compatible host NVIDIA driver and NVIDIA Container Toolkit, then use --gpus all. The image includes CUDA runtime packages, but not your host kernel driver.

AMD / Intel Vulkan

Replace --gpus all with --device /dev/dri. The host still needs working Vulkan drivers.

docker run --device /dev/dri --ipc=host -p 8776:8776 ... coderai:local

CPU only

Drop the GPU flag entirely. This is useful for API/admin smoke tests, but heavy media generation will be slow.

External storage for models and cache

/models and /cache are the big-data paths. Put them on NVMe, a fast SAN, or a large mounted disk while keeping the in-container paths unchanged.

sudo mkdir -p /srv/coderai/config /mnt/bigstorage/coderai/models /mnt/bigstorage/coderai/cache
sudo chown -R "$(id -u):$(id -g)" /srv/coderai/config   /mnt/bigstorage/coderai/models /mnt/bigstorage/coderai/cache

docker run --gpus all --ipc=host -p 8776:8776   --user "$(id -u):$(id -g)"   -v /srv/coderai/config:/config   -v /mnt/bigstorage/coderai/models:/models   -v /mnt/bigstorage/coderai/cache:/cache   coderai:local

The launcher sets HF_HOME under /cache/huggingface and writes generated tool outputs under cache paths, so the cache mount should be large. NFS/CIFS can work as a model library, but mmap-heavy weights and spill files are much faster on local NVMe or fast block storage.

Use existing local CoderAI config

The run helper can test the image against an existing ~/.coderai config without rebuilding. By default it copies JSON config files into a temporary directory so the image can rewrite host/port safely without mutating your real local config.

coderai-docker --nvidia --local   --map /AI/guffcache   --map /AI/huggingface   --map /AI/offloads
  • --config-dir PATH mounts an existing config directory at /config/coderai.
  • --local is shorthand for --config-dir ~/.coderai.
  • --inplace-config mounts the config directly; use it only if you accept host/port rewrites.
  • --map HOST[:CONT] bind-mounts data paths so absolute paths in models.json still resolve inside the container.

Verify the container

curl -fsS http://127.0.0.1:8776/ -o /tmp/coderai-home.html
curl -fsS http://127.0.0.1:8776/v1/models | jq
# open the admin UI
xdg-open http://127.0.0.1:8776/admin

For logs, use docker logs coderai or coderai-docker debug/file logging options:

coderai-docker --nvidia --debug --log-file /cache/logs/coderai.log
# the helper prints the host path to tail

Connect the container to AISBF broker mode

Broker mode works from the container the same way it works from a source install: put broker settings in the mounted config directory, keep /config persistent, and let the container dial outward to AISBF over WSS. This is the path for selling access to local models without opening inbound firewall ports.

{
  "broker": {
    "enabled": true,
    "url": "wss://aisbf.cloud/ws/provider/YOUR_PROVIDER_ID",
    "provider_id": "YOUR_PROVIDER_ID",
    "client_id": "YOUR_CLIENT_ID",
    "username": "YOUR_USERNAME",
    "registration_token": "YOUR_REGISTRATION_TOKEN"
  }
}

See the AISBF broker guide and the AISBF market page for the provider-selling flow.

Security and operations notes

  • Do not expose 8776 publicly until admin credentials and API tokens are changed.
  • Prefer a reverse proxy with TLS and large upload/timeouts if CoderAI is reachable over a network.
  • Keep /config private; it contains auth state and generated secrets.
  • Use --user "$(id -u):$(id -g)", rootless Docker, Podman, or user namespace remapping for safer host file ownership.
  • Use local NVMe for active weights and cache when performance matters.