Files
leleka/docs/backend-capability-admission.md
T

2.1 KiB

Backend capability admission

The leleka-backend-api contract at API version 2 describes supported models as explicit SupportedModelTuple entries in BackendCapabilities.supported_models. Each entry binds family, architecture and weight format together. Entries do not imply combinations assembled from different entries, and the default empty list supports no models.

supports first validates the descriptor: identifiers must be nonempty and contain no whitespace or control characters, and the artifact digest must use the existing sha256: prefix with exactly 64 hexadecimal characters. It then requires one exact declared tuple. Matching is case-sensitive for tuple identifiers, with no wildcard, alias or family inference.

The public capability layout replaces the version 1 independent lists. BACKEND_API_VERSION advances from 1 to 2, and BackendIdentity::supports_current_api rejects version 1 identities. A backend must migrate its declarations to explicit combinations; generating their Cartesian product would recreate the old admission bug. This is a Rust scaffold contract, not a stable dynamic plugin ABI or serialized protocol. The crate package version remains controlled separately by repository release policy; no backend consumer or production model declaration currently uses this scaffold.

Compatibility declaration is only one load prerequisite. supports does not read or hash model bytes, validate tensors or a tokenizer, check hardware, reserve memory/concurrency, qualify experimental modes, or publish readiness. Backend implementations must perform those checks before loading succeeds. A declared tuple is a backend assertion, not proof that a real model works.

Tests use two synthetic declared tuples and independently enumerate all eight combinations: only the two explicit entries are admitted. They also cover unknown formats, empty capabilities, malformed identifiers even when explicitly advertised, invalid digests, and refusal of obsolete/future API versions. No real family support, inference quality, numerical result or performance claim is introduced.