Skip to content

chore(spec): sync generated client from upstream openapi.yaml#12

Merged
kunwar-vp merged 1 commit into
mainfrom
spec-sync/auto
May 14, 2026
Merged

chore(spec): sync generated client from upstream openapi.yaml#12
kunwar-vp merged 1 commit into
mainfrom
spec-sync/auto

Conversation

@kunwar-vp
Copy link
Copy Markdown
Collaborator

Summary

Manual PR for the spec-sync/auto branch the nightly spec-sync workflow has been pushing since 2026-04-30. The bot couldn't open the PR itself because of an org-level Actions permission policy (see "Workflow note" below); this PR opens it by hand so the regenerated client can land while the workflow side is fixed separately.

Diff

Regenerated _generated/ from https://cp.graphn.ai/openapi.yaml:

  • src/graphn/_generated/models/custom_model.py: docstring tweak — gpu_memory_utilization no longer mentions vLLM by name (matches the engine-agnostic wording introduced in 0.1.3).
  • src/graphn/_generated/models/custom_model_create.py:
    • huggingface_model_id is now positionally required (no longer | Unset = UNSET) and its docstring documents the rationale.
    • Docstrings for s3_url and s3_role_arn now state that the conditional requirement is enforced server-side (422), not via JSON Schema, for OAS-3.0 tooling compat.

Net change: +22 / −12 across two generated files. No hand-written code touched.

Compatibility

  • Customers using client.custom_models.create(...): unchanged. The hand-written wrapper at src/graphn/custom_models/resource.py has required huggingface_model_id for every weight_source since 0.1.3, and the control plane returns 422 on omission server-side. All existing call sites that pass huggingface_model_id keep working byte-identically.
  • Callers reaching into graphn._generated.models.CustomModelCreate directly: this is a breaking change at the dataclass level (constructor will raise TypeError if huggingface_model_id is omitted). Per AGENTS.md, _generated/ is "overwritten on every spec sync — wrap it in hand-written modules instead of editing it", so this is the documented contract. No public re-exports change.

Workflow note (not in this PR)

spec-sync has been failing every day since 2026-04-28 with GitHub Actions is not permitted to create or approve pull requests. The repo-level toggle (Settings → Actions → General → Workflow permissions) is gated by an org-level policy (The organization does not allow GitHub Actions to create or approve pull requests), which can only be flipped by a voltagepark org admin. Tracking that separately — once it's flipped, the bot will resume opening these PRs on its own.

Test plan

  • Diff inspected — only docstring edits + one field re-ordering, no behavior changes
  • CI green on this PR (test matrix already passes against the regenerated client; this is what spec-sync.yml runs as the gate before opening the PR)
  • Reviewer decides whether this ships as part of 0.1.6 (recommended, given the dataclass-level break) or batched into a future minor

Recommended ordering

Hold this until #11 (graphn 0.1.5, openai constraint relax) merges and ships, then bump to 0.1.6 and merge this with a CHANGELOG entry calling out the _generated.CustomModelCreate.huggingface_model_id requirement change.

@kunwar-vp kunwar-vp merged commit 9b39f57 into main May 14, 2026
7 checks passed
kunwar-vp added a commit that referenced this pull request May 21, 2026
)

Two spec-sync PRs (#12 on 2026-05-14, #15 on 2026-05-16) landed
regenerated _generated/ on main but neither bumped pyproject, so
the new control-plane surface has been sitting in the source tree
unreleased on PyPI for a week. This PR closes the gap: bumps to
0.1.6, ships matching ergonomic wrappers + typed fields on the
hand-curated resource layer, and adds tests so the new surface is
covered, not just compiled.

New high-level surface on client.custom_models (sync + async):

- update(model_id, *, name=..., min_replicas=..., max_replicas=...,
  cooldown_seconds=..., extra=...) issues PATCH /v1/{ws}/custom-models/{id}.
  In-place mutation of the live deployment - no rolling restart, no
  downtime. Empty PATCH is refused client-side with
  ValidationError(code="empty_update") one round-trip earlier than
  the server's 422; an `extra` mapping lets callers PATCH future
  fields without an SDK release.
- supported_architectures() returns a typed SupportedArchitectures
  catalog from GET /v1/{ws}/custom-models/supported-architectures.
  Each ArchitectureInfo carries the capability tags (tool_calling,
  vision, image_input, video_input, streaming, json_mode) the
  architecture exposes. Intended for driving UI architecture/
  capability filters before calling validate().
- create(..., base_model_id=...) wires up the LoRA-import hint.
  Required on weight_source=s3_* to classify the bundle as an
  adapter at create-time; optional on weight_source=huggingface
  where it overrides adapter_config.json::base_model_name_or_path
  from the upstream repo (useful when the recorded base id isn't
  a valid HF id, e.g. a local filesystem path used during training).
- validate(..., model_size_gb=...) lets callers skip the HF
  head-bytes probe by supplying a weight-size hint, useful for
  very large models (405B-class) where the probe stalls validate.

Typed LoRA fields on the existing Pydantic types:

- CustomModel: artifact_type ("base"|"lora"|None), base_model_id,
  lora_adapter_name, lora_rank. artifact_type is None on responses
  from control planes that predate the LoRA work - treat that as
  "base" for compatibility.
- ValidateModelResponse: artifact_type (defaults to "base" on
  fresh responses, None on legacy), detected_base_model_id,
  lora_rank. When artifact_type == "lora", the architectures /
  num_params / estimated_memory_gb / max_context_length fields
  describe the base model resolved from adapter_config.json, not
  the adapter itself.

New public exports: ArchitectureInfo, SupportedArchitectures,
ArtifactType from graphn (and graphn.custom_models).

CustomModelCreate.huggingface_model_id is now required on the
generated attrs dataclass (was str | Unset). The server has
returned 422 for omitted huggingface_model_id on every weight
source since 0.1.3 (voltagepark/takao#1997) and the hand-curated
client.custom_models.create resource raises ValidationError
client-side for S3 imports, so this is the generated type catching
up - callers using the keyword-only ergonomic API are unaffected.

Tests: 57 pass (43 existing + 14 new) covering both transports.
ruff check clean. mypy is clean on every file this PR touches
(pre-existing no-any-return errors in _transport.py and tts.py are
on main and not regressions). The auto-tag job's CHANGELOG check
matches "## [0.1.6] - 2026-05-21" so PyPI publish fires automatically
on merge.
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.

1 participant