5.1 KiB
LLM.md — zooai/gym
Project: Zoo Gym — LLM fine-tuning trainer (a Zoo fork of Axolotl).
Org: zooai. Image namespace: ghcr.io/zooai/gym.
What this repo is
Python ML training framework (zoo-gym, src layout src/gym/) plus a Quarto
documentation website (_quarto.yml, type: website). CLI entrypoint gym.
gym.zoo.ngo serves the rendered Quarto docs.
docs site — how it builds and ships (live: gym.zoo.ngo)
The docs are the 42 hand-written .qmd pages (index.qmd + docs/**). They are
rendered to _site/ with quarto render and served by the canonical static
runtime ghcr.io/hanzoai/spa:1.2.0 (COPY _site /public, port 3000), deployed
to lux-k8s ns zoo-mainnet behind a hanzo.ai/v1alpha1 IngressRoute — the same
pattern as every other Zoo site in that namespace (zoo-computer is the template).
Dockerfile.site— the shipping build. Quarto CLI +jupyteronly (no torch, no editable install). The only Python executed at render time is two stdlib cells:index.qmdsplices inREADME.md;docs/custom_integrations.qmdlists plugins by readingsrc/gym/integrations/*/README.md. Tiny, CPU-only, framework-free build.- Brand logo — the Zoo rename left the navbar/README logo references
(
image/gym_logo_digital_{white,black}.svg) pointing at files that never existed (only upstreamimage/axolotl_*.svgare present). Shipping the axolotl art would leak the upstream brand, soimage/gym_logo_digital_*.svgare hand-authored "Gym" wordmarks in the repo's own palette (styles.css: greige#EEEEE7+ lime#E3F8A8on black#141310). Because therender:allow-list stops Quarto auto-copying site chrome, they are force-shipped viaproject.resources(only these two — not the heavy axolotl PNGs). The README logo<img>s were repointed from deadraw.githubusercontent.comURLs to relativeimage/...paths so the home-page logo resolves on-site. - Deployed:
ghcr.io/zooai/gym:sha-79e59cb(rebuild on a content change; CI reproduces the tag). Pod 1/1 inzoo-mainnet. deploy/k8s.yaml— Deployment + Service + IngressRoutezoo-gyminzoo-mainnet(containerspa, :3000,/healthprobes,imagePullSecrets: ghcr-luxfi, IngressRoute websecureHost(gym.zoo.ngo), certResolver letsencrypt).IMAGE_PLACEHOLDERis patched to the pushed tag..github/workflows/docker.yml— canonical zooai CI (self-hosted amd64,ghcr.io/zooai/gym:sha-<sha7>, loginhanzo-devviasecrets.GHCR_PAT).- DNS — Cloudflare zone
zoo.ngo(id9c6372f6…), recordgym=A 134.199.138.27proxied (was a dead CNAME → zooai.github.io; now mirrors thecomputerrecord exactly). Working CF creds are the global key in lux-k8s secrethanzo/cloudflare-credentials(CF_API_EMAIL+CF_API_KEY) — note thehanzo-k8shanzo/cloudflare-credentialssecret holds only PLACEHOLDER values.
What the docs build deliberately omits, and why
The upstream Quarto config also generated two things by introspecting the
training framework: a quartodoc API Reference (docs/api) and a
Configuration Reference (docs/config-reference.qmd, via the
pre-render: docs/scripts/generate_config_docs.py hook). Both require importing
the framework, which is not possible in a docs-only, CPU-only build:
- Half-rename: the package imports itself as
axolotl. The dir issrc/gym/but all 174 internal modules dofrom axolotl... import(nothing importsgym.*). Soimport gym.train→ModuleNotFoundError: axolotl. quartodoc (package: gym) cannot introspect a single module. - GPU-only
mamba_ssm, unguarded.models/mamba/modeling_mamba.pydoes an unconditionalfrom mamba_ssm import ...;mamba-ssmhas no CPU wheel and cannot even build metadata withoutnvcc. quartodoc aborts on it. - The config schemas pull in torch + transformers.
generate_config_docs.pyimportsaxolotl.utils.schemas.config, whose tree importstorch(schemas/enums.py) andtransformers(schemas/training.py,schemas/validation.py). Generating it needs the full ML stack.
Decision (forward-correct + cheap): _quarto.yml no longer runs the
pre-render hook or the quartodoc: block, so quarto render succeeds with no
framework import. docs/config-reference.qmd is now a hand-written
reference page (force-tracked; docs/.gitignore ignores the generated name) so
the six in-doc links to it resolve. docs/custom_integrations.qmd had a
hardcoded ../src/axolotl/integrations path fixed to ../src/gym/integrations.
To restore the auto-generated API + config references later
Make the package importable end-to-end and install the CPU ML stack:
finish the axolotl→gym rename across the 174 modules (or rename src/gym
back to src/axolotl and set quartodoc package: axolotl); guard the
mamba_ssm import in models/mamba/modeling_mamba.py with try/except ImportError; then pip install -e . with CPU torch + quartodoc and re-add the
quartodoc: block + pre-render hook. That is a framework-packaging change,
not a docs change.
This file is the single source of truth for AI assistants on this repo.