Skip to content

refactor!: retire the serving-class presets, grants and default classes - #2068

Merged
hachall merged 3 commits into
mainfrom
feat/remove-legacy-serving-classes
Oct 21, 2026
Merged

hachall merged 3 commits into
mainfrom
feat/remove-legacy-serving-classes

Conversation

@hachall

@hachall hachall commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Retires the interactive / throughput serving-class presets, per-account class grants and account/overlay default classes. They aren't used: no account holds a grant or a default class, no overlay sets a default class, no model declares presets, and no realtime request has named a class suffix recently. Removing them shrinks the routing path before model class routing (#1908) lands on top of it.

What changes

Onwards

  • serving::resolve returns the overlay's explicit targets (custom) or nothing (standard), plus the self-hosted restriction. Daemon legs still get no targets.
  • Class suffixes are no longer parsed: a realtime alias:interactive is an ordinary (unknown) model name, so it gets a 404 instead of a 403 or a class.
  • PoolSpec.serving_classes, AccountServing.granted / default_class and ServingOverlay.default_class are gone. Stored configs that still carry them load with those fields ignored.
  • onwards_serving_class_requests_total keeps its labels; requested is now always empty.

dwctl

  • The inference middleware no longer strips or interprets realtime class suffixes. Flex, background and batch uploads still discard a model suffix after a shape check, unchanged (now in inference/model_selector.rs).
  • The admin API drops granted_serving_classes and default_serving_class from users and organisations (PATCH ignores them), default_serving_class from overlays, and serving_classes from model responses.
  • Model catalog: serving_classes is accepted only as an empty map, so existing files still load. The writer keeps the column {}.
  • Organisation catalog: default_class is removed. class_pricing accepts standard and custom; rows the catalog owned under the old class names are retired on the next apply.
  • Billing is unchanged: the resolved outcome is still standard, or custom when overlay targets applied.

Dashboard

  • Removes the grant, default-class and preset views; the self-hosted and toleration controls stay.

No migrations. The now-unused columns stay until a later migration drops them.

Compatibility notes

  • Admin API clients that send the removed fields have them ignored; responses no longer include them.
  • Catalog files with a non-empty serving_classes map or an overlay default_class now fail validation with an explicit message.

Testing

  • just lint rust, just lint ts
  • just test rust (4225 tests), just test ts (804 tests)
  • onwards clippy and fmt (no new warnings)
  • .sqlx regenerated against a freshly migrated database; cargo sqlx prepare --check --workspace passes
  • model-provisioning.schema.json regenerated

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

The interactive/throughput presets, per-account class grants and account or
overlay default classes are unused. Removing them now keeps the routing path
small before model class routing lands.

- Onwards resolves only overlay targets (`custom`) or nothing (`standard`)
  and the self-hosted restriction; class suffixes are no longer parsed.
- dwctl no longer strips or interprets realtime class suffixes. Flex,
  background and batch uploads still discard a model suffix after a shape
  check, unchanged.
- The admin API drops the grant and default-class fields; the organisation
  serving view and model overlays keep targets and self_hosted_only.
- The model catalog accepts `serving_classes` only as an empty map. The
  organisation catalog prices `standard` and `custom` only, and retires any
  rows it owned under the old class names.
- The dashboard drops the grant, default-class and preset views.

Stored onwards configuration that still carries the old fields loads with
them ignored. Database columns are left in place for a later migration.
Copilot AI balanced review requested due to automatic review settings October 21, 2026 11:25
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Deploying control-layer with  Cloudflare Pages  Cloudflare Pages

Latest commit: bf23ccf
Status: ✅  Deploy successful!
Preview URL: https://3d301dc4.control-layer.pages.dev
Branch Preview URL: https://feat-remove-legacy-serving-c.control-layer.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 98 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread dwctl/src/api/handlers/serving.rs
Comment thread dashboard/src/components/features/models/manage/ModelPricing.tsx
Assert that a PATCH carrying the retired grant and default-class fields is
accepted, writes neither column and returns neither field. Restrict the
organisation pricing view to the classes billing can select (standard, and
custom when an overlay's targets apply), so a manual price under a retired
class name is no longer shown as if it applied.

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 3 files (changes from recent commits).

Requires human review: Retires unused serving-class presets/grants across serving, APIs and catalogs; approval hinges on unverified claims of zero production usage and the diff is truncated, so human review is required.

View guided diff | Turn on auto-fix | Re-trigger cubic

@hachall
hachall added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit a28e3b3 Oct 21, 2026
27 checks passed
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