# pi coding agent 0.73.1 + Qwen3.8-Flash-Next UD-IQ4_XS (Unsloth Dynamic v3.1) on Unsloth's llama.cpp b11985, one RTX 5090.
# The agent version of qwen38-flash-next-unsloth-v31-5090 (m64_516ff942b134): the same base image and the same
# llama.cpp prebuild, weights and server flags, with pi and its gateway added.
# nvidia/cuda:13.3.1-runtime-ubuntu24.04, pinned by digest: the CUDA 13.3 runtime and cuBLAS the prebuilt
# llama.cpp links against, plus GCC's OpenMP runtime (libgomp.so.1).
FROM node@sha256:48e4b67d85f87bd551df43704e24d252f56cc5f8e9718841aace50f19948f0f9 AS node

FROM nvidia/cuda@sha256:63da350831208559df18c7b8f3e0d5d1c984eaa815cdde690aacd6606cd0cb11

# libgomp1 as in m64_516ff942b134, then the agent's tools (git, ripgrep, jq, a C toolchain...).
RUN apt-get update && apt-get install -y --no-install-recommends libgomp1=14.2.0-4ubuntu2~24.04.1 \
      ca-certificates git ripgrep jq curl procps less file unzip xz-utils build-essential python3 python3-venv \
    && rm -rf /var/lib/apt/lists/*

# Node 22.23.2 from node:22-bookworm-slim, then pi 0.73.1 (the version agent-checkup-benchmark's harness uses).
COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
    && ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
    && npm install -g @mariozechner/pi-coding-agent@0.73.1 && npm cache clean --force
ENV PI_OFFLINE=1 PI_TELEMETRY=0

# Gateway deps (opencode-basalt-5090's pins, Python 3.12).
RUN python3 -m venv /opt/gateway && /opt/gateway/bin/pip install --no-cache-dir \
      fastapi==0.115.14 uvicorn==0.32.1 httpx==0.28.1 \
      starlette==0.46.2 pydantic==2.14.1 pydantic_core==2.50.1 annotated-types==0.8.0 \
      typing_extensions==4.16.0 typing-inspection==0.4.4 anyio==4.15.1 idna==3.20 \
      certifi==2026.10.23 httpcore==1.0.9 h11==0.16.0 click==8.5.0
