Skip to content

Kyojin: open-source engine that runs 100 GB-class open models (GLM-5.3, Qwen3.8, DeepSeek V4.1) on one desktop machine. AMD Strix Halo, NVIDIA RTX and Apple Mac. OpenAI API, built on ExLlamaV3.

Container: single-stage build to halve the disk peak

YanissAmza1b199e2091d
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 9cadb98..7964d17 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -3,11 +3,14 @@
# Follows the README Quickstart: ROCm torch + rocm-sdk-devel from AMD's gfx1151 index, requirements.txt,
# `rocm-sdk init`, tools/strix_halo/env.sh, build.sh. The models are NOT in the image: mount them.
-FROM ubuntu:24.04 AS build
+FROM ubuntu:24.04
SHELL ["/bin/bash", "-c"]
-ENV DEBIAN_FRONTEND=noninteractive PIP_NO_CACHE_DIR=1
+ENV DEBIAN_FRONTEND=noninteractive PIP_NO_CACHE_DIR=1 PYTHONUNBUFFERED=1
+# Single stage on purpose: a second stage would copy the ~14 GB tree again and double the disk peak.
+# g++, libc6-dev, python3-dev stay: the servers compile a few HIP kernels (hipcc) and Triton kernels at start.
RUN apt-get update && apt-get install -y --no-install-recommends \
- python3 python3-venv python3-dev gcc g++ make git ca-certificates \
+ python3 python3-venv python3-dev gcc g++ libc6-dev make git ca-certificates \
+ libnuma1 libatomic1 libgomp1 libdrm2 libelf1 curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt/kyojin
RUN python3 -m venv .venv
@@ -15,7 +18,7 @@ ENV PATH=/opt/kyojin/.venv/bin:$PATH
COPY requirements.txt .
COPY . .
# One layer on purpose: the pip downloads and the unpruned SDK tree never reach an image layer.
-# The SDK (hipcc, headers) stays in the image: the servers compile a few HIP kernels on first start.
+# The SDK (hipcc, headers) stays, pruned of test binaries, profiler data and client samples.
RUN pip install --pre torch rocm-sdk-devel --index-url https://rocm.nightlies.amd.com/v2/gfx1151/ \
&& pip install -r requirements.txt \
&& rocm-sdk init \
@@ -25,15 +28,7 @@ RUN pip install --pre torch rocm-sdk-devel --index-url https://rocm.nightlies.am
&& python -c "import torch, exllamav3_ext" \
&& rm -rf build .rebuild.* .sdk-deps /root/.cache \
&& cd "$EXL3_ROCM_SDK" && rm -rf clients share/rocprofiler-sdk share/hipblaslt share/rocdecode share/rocsparse bin/*gtest* bin/*-test bin/*-bench bin/*-gemm-tune bin/*test*
-
-FROM ubuntu:24.04
-ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1
-RUN apt-get update && apt-get install -y --no-install-recommends python3 g++ libc6-dev python3-dev libnuma1 libatomic1 libgomp1 libdrm2 libelf1 curl ca-certificates \
- && rm -rf /var/lib/apt/lists/*
-COPY --from=build /opt/kyojin /opt/kyojin
-WORKDIR /opt/kyojin
-ENV PATH=/opt/kyojin/.venv/bin:$PATH \
- EXL3_ROCM_SDK=/opt/kyojin/.venv/lib/python3.12/site-packages/_rocm_sdk_devel
+ENV EXL3_ROCM_SDK=/opt/kyojin/.venv/lib/python3.12/site-packages/_rocm_sdk_devel
ENV MODEL_DIR=/models PORT=8000 HOME=/root
EXPOSE 8000
VOLUME ["/models"]