feat: install the prime CLI as a uv tool instead of a dependency (#4371)

## Summary

- Remove `prime` (the Prime CLI) from prime-rl's runtime dependencies.
No prime-rl code imports `prime_cli`. The CLI only tied prime-rl's lock
to the CLI's releases, and gave `prime-sandboxes` a second path into the
lock next to `verifiers`.
- `Dockerfile.cuda`: install the CLI as a uv tool in its own venv
(`/opt/uv-tools`, executable in `/usr/local/bin`), pinned by `ARG
PRIME_CLI_VERSION=0.19.2`. The platform keeps running `uv run --no-sync
prime env install '<id>'` unchanged. Since prime CLI 0.8.0, `prime env
install` installs into `$UV_PROJECT_ENVIRONMENT`, `$VIRTUAL_ENV`, or the
`.venv` next to the nearest `pyproject.toml`, so Hub envs still land in
`/app/.venv`.
- `scripts/install.sh`: run `uv tool install prime` for local use. The
docs already tell users to install the CLI this way.
- `uv.lock` drops `prime`, `prime-evals` and `gitignore-parser`.
`pyproject.toml` drops their now-unused `exclude-newer-package` entries.

Source overlays on older images keep working: the entrypoint syncs with
`--inexact`, so the CLI already in those images' `/app/.venv` stays in
place.

## Breaking

- `uv sync` no longer installs the `prime` command into the project
venv, so `uv run prime …` in a prime-rl checkout fails until the CLI is
installed. Migration: run `uv tool install prime`, then call `prime …`
directly.

## Verification

- Local check, `prime==0.19.2` installed with `uv tool install` and
absent from the target project venv: `uv run --no-sync prime env install
primeintellect/gsm8k` installed `gsm8k` into the project `.venv` and not
into the tool venv. A plain `prime env install` from the project root
did the same.
- Hosted e2e: pending (reverse-text from the Hub with `prime train`, on
an image built from this branch).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Packaging and install-path changes only; runtime training code is
untouched, with a documented migration for local CLI usage.
> 
> **Overview**
> **Removes the `prime` CLI from prime-rl’s Python dependencies and
lockfile**, so CLI releases no longer force lock updates and transitive
packages like `prime-evals` and `gitignore-parser` drop out of
`uv.lock`.
> 
> **Docker and local setup now install the CLI separately** via `uv tool
install`: the CUDA image pins `PRIME_CLI_VERSION=0.19.2` into
`/opt/uv-tools` with `prime` on `PATH`, and `scripts/install.sh` runs
the same after `uv sync`. Hub env installs (`prime env install` / `uv
run --no-sync prime env install`) are unchanged in intent—the CLI still
targets the project `.venv`, not the tool venv.
> 
> **Breaking for devs:** `uv sync` no longer puts `prime` in the project
venv, so **`uv run prime …` fails until you run `uv tool install
prime`** and invoke `prime` directly.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
82cac44caaa77bd77c1b2796186e74264068b873. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mika Senghaas
2026-11-02 16:00:43 -08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 5e5e9c7782
commit 9eae92253e
4 changed files with 11 additions and 53 deletions
+8
View File
@@ -225,6 +225,14 @@ RUN userdel -r ubuntu 2>/dev/null || true; \
# Install uv for development use
COPY --from=uv /uv /uvx /usr/local/bin/
# The platform installs Hub environments with `uv run --no-sync prime env install`.
# The CLI gets its own tool venv so its dependencies stay out of prime-rl's lock;
# `prime env install` still installs into the project venv (/app/.venv).
ARG PRIME_CLI_VERSION=0.19.2
RUN UV_TOOL_DIR=/opt/uv-tools UV_TOOL_BIN_DIR=/usr/local/bin \
uv tool install --no-cache --python /usr/bin/python3.12 "prime==${PRIME_CLI_VERSION}" \
&& prime --version
USER appuser
ENV PATH="/usr/local/bin:$PATH"
WORKDIR /app
-3
View File
@@ -16,7 +16,6 @@ dependencies = [
"transformers==5.19.0",
"wandb>=0.26.1",
"wandb-workspaces>=0.4.3",
"prime>=0.19.2",
"prime-runs[train]>=0.1.5",
"pyzmq>=27.1.0",
"aiolimiter>=1.2.1",
@@ -237,12 +236,10 @@ flash_attn_3 = false
# fast-track so first-party releases can land same-day. Only packages that
# appear in `uv tree` need to be listed; the resolver ignores entries for
# packages it never sees.
prime = false
prime-runs = false
prime-traces = false
prime-sandboxes = false
prime-tunnel = false
prime-evals = false
verifiers = false
renderers = false
prime-pydantic-config = false
+3
View File
@@ -137,6 +137,9 @@ main() {
log_info "Syncing virtual environment..."
uv sync --all-extras
log_info "Installing the prime CLI..."
uv tool install prime
log_info "Installing pre-commit hooks..."
uv run pre-commit install
Generated
-50
View File
@@ -30,14 +30,12 @@ prime-tunnel = false
flash-mla = false
flashinfer-python = false
humming-kernels = false
prime-evals = false
deep-gemm = false
torchao = false
instanttensor = false
tokenspeed-mla = false
nixl-cu13 = false
deep-ep = false
prime = false
certifi = false
prime-sandboxes = false
renderers = false
@@ -2184,12 +2182,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/a0/61/5c78b91c3143ed5c14207f463aecfc8f9dbb5092fb2869baf37c273b2705/gitdb-4.0.12-py3-none-any.whl", hash = "sha256:67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf", size = 62794, upload-time = "2025-01-02T07:20:43.624Z" },
]
[[package]]
name = "gitignore-parser"
version = "0.1.13"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/e5/51/e391a1a4238f18d0abb47be479b07af265ad4519022cf51b7da47ef82487/gitignore_parser-0.1.13.tar.gz", hash = "sha256:c7e10c8190accb8ae57fb3711889e73a9c0dbc04d4222b91ace8a4bf64d2f746", size = 5603, upload-time = "2025-08-25T06:33:22.704Z" }
[[package]]
name = "gitpython"
version = "3.1.50"
@@ -5096,46 +5088,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/80/6e/4b28b62ecb6aae56769c34a8ff1d661473ec1e9519e2d5f8b2c150086b26/pre_commit-4.6.0-py2.py3-none-any.whl", hash = "sha256:e2cf246f7299edcabcf15f9b0571fdce06058527f0a06535068a86d38089f29b", size = 226472, upload-time = "2026-04-21T20:31:40.092Z" },
]
[[package]]
name = "prime"
version = "0.19.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "boto3" },
{ name = "build" },
{ name = "cryptography" },
{ name = "gitignore-parser" },
{ name = "httpx" },
{ name = "prime-evals" },
{ name = "prime-sandboxes" },
{ name = "prime-traces" },
{ name = "prime-tunnel" },
{ name = "pydantic" },
{ name = "pyyaml" },
{ name = "rich" },
{ name = "toml" },
{ name = "tomli" },
{ name = "typer" },
]
sdist = { url = "https://files.pythonhosted.org/packages/c5/a1/3b0f0f7a3dc16b8d22dfa1b140fe457906171476456c6f6c744289c79d6c/prime-0.19.2.tar.gz", hash = "sha256:c57101f8c5570ac1ec68e7d6d27a86916b603e3d1c62c4bf2f9ab86a05ef7848", size = 681367, upload-time = "2026-11-02T23:00:11.144Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/d0/6e/707a874988a01126572861065230f843d1a752d604a8c6e3224966a05f13/prime-0.19.2-py3-none-any.whl", hash = "sha256:8e25a0846bd19236d2bd4eff9c84053b96bc603bd5cb590b2be795b8d4fedd6e", size = 354084, upload-time = "2026-11-02T23:00:08.694Z" },
]
[[package]]
name = "prime-evals"
version = "0.2.4"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "httpx" },
{ name = "pydantic" },
{ name = "tenacity" },
]
sdist = { url = "https://files.pythonhosted.org/packages/9c/89/bfbb4aa271669b16e9bc1303d3edeaaace000e5dd29df9ac7ffebf1fb59e/prime_evals-0.2.4.tar.gz", hash = "sha256:759d99e58f587ce8be314a58bdc811106006a74435e981c95c7783045f41cdd0", size = 16575, upload-time = "2026-09-15T17:15:12.452Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b8/95/c3c2ac163f3ae4909e3e4f47f3244441006432e9e78e9a14833466bac769/prime_evals-0.2.4-py3-none-any.whl", hash = "sha256:50641df3bbc63acac9a85595c2ec363260d41bcc78775a227800449c20648f69", size = 14267, upload-time = "2026-09-15T17:15:11.083Z" },
]
[[package]]
name = "prime-kernels"
version = "0.1.0+cu130torch2.13.0"
@@ -5215,7 +5167,6 @@ dependencies = [
{ name = "numpy" },
{ name = "openai" },
{ name = "orjson" },
{ name = "prime" },
{ name = "prime-pydantic-config" },
{ name = "prime-rl-configs" },
{ name = "prime-runs", extra = ["train"] },
@@ -5394,7 +5345,6 @@ requires-dist = [
{ name = "nvidia-ml-py", marker = "sys_platform == 'linux' and extra == 'gpu'", specifier = ">=12.575.51" },
{ name = "openai", specifier = ">=1.106.1" },
{ name = "orjson", specifier = ">=3.11.0" },
{ name = "prime", specifier = ">=0.19.2" },
{ name = "prime-kernels", marker = "platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'kernels'", url = "https://github.com/PrimeIntellect-ai/prime-kernels/releases/download/v0.1.0-b52bd9d/prime_kernels-0.1.0+cu130torch2.13.0-cp312-cp312-linux_aarch64.whl" },
{ name = "prime-kernels", marker = "platform_machine != 'aarch64' and platform_machine != 'x86_64' and sys_platform == 'linux' and extra == 'kernels'" },
{ name = "prime-kernels", marker = "platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'kernels'", url = "https://github.com/PrimeIntellect-ai/prime-kernels/releases/download/v0.1.0-b52bd9d/prime_kernels-0.1.0+cu130torch2.13.0-cp312-cp312-linux_x86_64.whl" },