Coverage for src / lilbee / modelhub / model_manager / types.py: 100%

17 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-05-15 20:55 +0000

1"""Public value types for model lifecycle management.""" 

2 

3from dataclasses import dataclass 

4from enum import Enum 

5 

6from lilbee.catalog.types import ModelTask 

7from lilbee.providers.backend_names import BackendName 

8 

9 

10class ModelNotFoundError(RuntimeError): 

11 """Raised when a model ref is not found in any source or the catalog. 

12 

13 Subclasses RuntimeError so pre-existing `except RuntimeError` call 

14 sites still catch it. 

15 """ 

16 

17 

18@dataclass 

19class RemoteModel: 

20 """A model from the SDK backend with inferred task classification.""" 

21 

22 name: str 

23 task: ModelTask 

24 family: str 

25 parameter_size: str 

26 provider: str = BackendName.REMOTE 

27 

28 

29class ValidationResult(Enum): 

30 """Outcome of validating a persisted model ref against current state.""" 

31 

32 OK = "ok" 

33 NOT_INSTALLED = "not_installed" # Local ref but no GGUF on disk. 

34 NO_KEY = "no_key" # API ref but no provider key configured. 

35 UNKNOWN = "unknown" # Ref string is malformed or its provider is unknown.