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

Merged
HA
2d ago
+950-6585

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