Add an upstream GPU tool (e.g. a trainer like ai-toolkit) to the stack as a pinned Docker service with a template config, wrapper script, just recipe and docs. Use when integrating a third-party repo that needs the shared GPU.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Pin Upstream Gpu Tool?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/williamblair333-pin-upstream-gpu-tool)
---
name: pin-upstream-gpu-tool
description: Add an upstream GPU tool (e.g. a trainer like ai-toolkit) to the stack as a pinned Docker service with a template config, wrapper script, just recipe and docs. Use when integrating a third-party repo that needs the shared GPU.
---
# Pin and wrap an upstream GPU tool
## When to use
- You're adding a third-party GitHub project to the stack as a Docker service.
- The tool needs the GPU, which other services such as ComfyUI also use.
- You want a reproducible build pinned to a known upstream commit.
## Steps
1. **Pick a pinned commit.**
- Choose a recent, settled upstream commit and note its date and age.
- Fetch the **full SHA** from upstream with `git ls-remote` or the commit page.
- Never reconstruct or guess any part of a SHA. Guessed tails do happen.
2. **Read upstream before writing anything.**
- Read upstream's Dockerfile, its compose file and its requirements.
- Base `docker/<tool>/` on these files. Don't invent your own.
3. **Run the pre-mortem before any push or PR step the hooks gate.**
- Hooks gate these steps. Use the pre-mortem skill's script, never a manual token.
4. **Write the template config from upstream code.**
- Take key names from upstream source, such as the config module (e.g. `config_modules.py`).
- Also check the UI defaults and examples for the target model.
- Don't take key names from memory or third-party blogs.
5. **Check for existing helpers before you write new ones.**
- Search the repo for scripts that look related, such as `scripts/gpu-mode.sh`.
- Read what each one actually does before you reuse or duplicate it.
- If it does a different job, write a small focused helper and say why.
6. **Write the wrapper and the recipe.**
- Put the wrapper in `scripts/<tool>.sh`. Keep logic in the script, not the justfile.
- Add a GPU busy-check: refuse to start while another service holds the GPU.
- Add a one-line `just` recipe that calls the wrapper.
7. **Validate before the build.**
- Run `shellcheck scripts/<tool>.sh` and make sure it's clean.
- Run `docker compose -f docker/<tool>/compose.yml config` and make sure it validates.
- Test the refusal path by running the wrapper while ComfyUI or another GPU holder is up. Confirm it refuses.
8. **Build in the background.**
- Large images take a while. A torch CUDA image plus deps is about 15 GB.
- Start the build in the background and stream its log. Don't capture it in a variable.
- Use the wait for side work, such as replying to other project sessions or writing docs.
9. **Update the docs.**
- Find the matching section in `docs/STACK.md` (e.g. image generation) with jdocmunch.
- Add the tool there, then add a `CHANGELOG.md` entry.
- **Hold the HANDOFF update until the build result is known.** Don't record success before it happens.
10. **Finish.**
- When the build completes, report the outcome as it happened. Then smoke-test via the recipe.
- Next, update HANDOFF and open the PR. Merge origin/main first.
- Return to `main` at the end.