Skip to content

feat: expose v2 CUDA constraints (gpu.allowedCudaVersions / gpu.minCudaVersion) - #85

Open
brodykellish wants to merge 2 commits into
mainfrom
feat/v2-cuda-constraints
Open

feat: expose v2 CUDA constraints (gpu.allowedCudaVersions / gpu.minCudaVersion)#85
brodykellish wants to merge 2 commits into
mainfrom
feat/v2-cuda-constraints

Conversation

@brodykellish

Copy link
Copy Markdown
Contributor

What rphttp2 2.9.0 changed on the wire

The CUDA host constraints (allowedCudaVersions, minCudaVersion) moved from the top level of pod/endpoint bodies into the gpu block (pre-2.9.0 servers 422 the nested spelling as an unknown property; 2.9.0 servers 422 the old top-level spelling). Serverless gained a gpu.minCudaVersion floor. On PATCH /v2/serverless, gpu.pools became optional (a CUDA-only patch need not resend the pool list), and sending pools now replaces the GPU selection wholesale — clearing excludedTypes.

The MCP server needed nothing to survive 2.9.0 (it never sent or read the affected fields over REST); this PR adopts the new schema.

What this adds

  • allowedCudaVersions / minCudaVersion params on create-pod, create-endpoint, and update-endpoint, emitted under gpu.*. Client-side validation names the failure instead of relaying a raw 422/400: major.minor grammar (a bare "12" is rejected with the fix in the message), set-XOR-floor exclusivity, GPU-pods-only. Update supports the spec's clear sentinels ([] clears the set, "" clears the floor).
  • Pools-less gpu PATCH: a CUDA-only (or count-only — previously silently dropped) endpoint update no longer resends gpuPoolIds.
  • Exclusion-wipe warning: when update-endpoint sends gpuPoolIds and the endpoint carries excludedTypes (set via console or set-endpoint-gpus), the reply carries a _warning naming the cleared exclusions.
  • list-gpu-types gains the spec's minCudaVersion availability filter (bare major legal here — it only widens a read).
  • Vendored spec refreshed; the parity gate flagged nine new unmapped operations (account SSH keys, Instant Clusters, public template catalog) — allowlisted as explicit to-dos, not silently.
  • v1 mode rejects the new params with a clean 501 pointing at RUNPOD_REST_VERSION=v2 (the templateId precedent).

Do not release/deploy this MCP version until prod api.runpod.io runs rphttp2 2.9.0 — pre-2.9.0 servers 422 the gpu-nested fields as unknown properties.

28 new tests (14 mapper, 14 handler); suite 733 tests, 725 pass / 8 pre-existing env-gated skips; tsc + eslint + prettier clean on touched files.

…daVersion)

rphttp2 2.9.0 nests the CUDA host constraints under the gpu block (they were
top-level pre-release and are unrepresentable on CPU workloads), gives
serverless a minCudaVersion floor, makes gpu.pools optional on PATCH so a
CUDA-only update need not resend the pool list, and makes a pools update
replace the GPU selection wholesale (clearing excludedTypes).

Adopt all of it: CUDA params on create-pod / create-endpoint /
update-endpoint mapped under gpu.*, client-side validation (major.minor
grammar, set-XOR-floor) so callers get named errors instead of raw 422s,
pools-less gpu PATCH support (also unlocks a count-only patch, previously
silently dropped), a _warning when a gpuPoolIds update clears exclusions
pinned via console/set-endpoint-gpus, the minCudaVersion availability
filter on list-gpu-types, and the refreshed vendored spec (new unmapped
ops — ssh-keys, clusters, public template catalog — allowlisted as to-dos
in the parity gate).
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
runpod-mcp Ignored Ignored Preview Aug 20, 2026 8:19pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the Runpod MCP server’s v2 REST integration to adopt rphttp2 2.9.0’s schema changes for CUDA host constraints, moving allowedCudaVersions / minCudaVersion under gpu.* and extending validation + update behavior accordingly.

Changes:

  • Add v2 CUDA constraint params to create-pod, create-endpoint, and update-endpoint, including client-side validation and v1-mode 501s.
  • Allow pools-less GPU PATCHes for Serverless endpoint updates (CUDA-only / count-only), and emit a warning when a pools update clears existing excludedTypes.
  • Extend list-gpu-types with the v2 minCudaVersion availability filter, and refresh the vendored v2 OpenAPI fixture + parity allowlist.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/_shared/mappers.ts Maps new CUDA constraint params into v2 request bodies under gpu.* and adds shared validation helper.
src/tools/pods.ts Exposes CUDA constraint params for pod create and validates v2-only / GPU-only behavior.
src/tools/endpoints.ts Exposes CUDA constraint params for endpoint create/update, supports pools-less GPU PATCH, and adds exclusion-wipe warning behavior.
src/tools/catalog.ts Adds v2 minCudaVersion availability filter support to list-gpu-types with validation.
tests/mappers.test.ts Adds mapper-level tests for CUDA nesting and validation behavior.
tests/handlers.test.ts Adds handler-level tests for v2 wire shape, validation failures, warnings, and v1 rejections.
tests/spec-parity.test.ts Allowlists newly introduced spec operations that are intentionally not yet exposed as MCP tools.
tests/fixtures/v2-openapi.yaml Updates vendored v2 spec snapshot (including new CUDA fields, clusters/account/template catalog additions, etc.).
tests/fixtures/v2-create-pod.json Updates create-pod fixture to include CUDA constraints and expected v2 mapping.
.changeset/v2-cuda-constraints.md Adds a changeset documenting the new user-facing behavior and the rphttp2 2.9.0 dependency.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tools/endpoints.ts
Comment thread src/tools/endpoints.ts
Comment thread src/_shared/mappers.ts
- update-endpoint 400s an explicit gpuPoolIds: [] instead of silently
  dropping it (gpu.pools is minItems 1 upstream and not clearable).
- allowedCudaVersions description no longer references a get-capacity
  product parameter that does not exist.
- Note on V1PodParams that the CUDA fields are v2-only.
@brodykellish
brodykellish requested a lite review from Copilot August 20, 2026 20:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/tools/endpoints.ts:368

  • The update-endpoint tool description’s v2 mutable-fields list is now incomplete: it omits the newly supported gpuPoolIds/gpuCount/allowedCudaVersions/minCudaVersion (and args). This can mislead tool users about what updates are possible; update the description to include these fields.
    "Update a Serverless endpoint's config. On v2 you can change image/disk/env/ports/registry/workers/scaling/networkVolumes/timeout/flashboot; on v1, scaling fields (worker min/max, idle timeout, scaler type/value, name). Only provided fields change. An endpoint's request routing (queue vs load balancer) is fixed at creation and cannot be changed here — recreate the endpoint instead. Note: passing gpuPoolIds replaces the GPU selection wholesale, which clears any GPU-type exclusions set elsewhere (console or set-endpoint-gpus) — the reply carries a _warning when that happens.",

tests/spec-parity.test.ts:140

  • The comment above ALLOWLIST_UNMAPPED_OPS still says "Empty today" even though the allowlist is now non-empty, which makes the parity gate’s intent unclear. Update the comment to reflect that this is a temporary to-do list of intentionally unmapped spec operations.
// Spec operations deliberately NOT exposed as a tool. Empty today — every operation
// in the vendored spec maps to a registered tool. Add an entry (with the reason) if
// an operation ships that we choose not to cover.
// New in the 2.9.0-era spec refresh: whole resources the MCP has no tools for
// yet. A to-do list, not a permanent carve-out — delete an entry when its tool

Comment thread src/tools/catalog.ts
Comment on lines +115 to +120
? `?include=AVAILABILITY&product=${product}${
params.minCudaVersion !== undefined
? `&minCudaVersion=${encodeURIComponent(params.minCudaVersion)}`
: ''
}`
: ''

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we simplify this nested ternary for readability?

Comment thread src/tools/endpoints.ts
Comment on lines +510 to +512
current?.scaling?.type === 'REQUEST_COUNT'
? 'REQUEST_COUNT'
: 'QUEUE_DELAY';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: minor concern around usage of magic strings. Seems like there isnt a project convention, but ideally could be simplified by usaing a const as object pattern?

Comment thread src/_shared/mappers.ts
pools?: string[],
count?: number
params: V2EndpointParams,
mode: 'create' | 'update'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: comment around typing etc below.

Comment thread src/_shared/mappers.ts
function endpointCommonToV2(params: V2EndpointParams): Record<string, unknown> {
function endpointCommonToV2(
params: V2EndpointParams,
mode: 'create' | 'update'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants