hub_model_resource
Concrete ModelResourceProtocol backed by the Bitfount Hub.
This module provides HubModelResource, a lightweight adapter that
satisfies ModelResourceProtocol by downloading model code (and
optionally weights) from the Bitfount Hub at inference time.
Classes
HubModelResource
class HubModelResource(hub: BitfountHub, project_id: str | None = None):Loads models from the Bitfount Hub for inference.
Implements ModelResourceProtocol.
Arguments
hub: An authenticatedBitfountHubinstance.project_id: The project ID gating model access (may beNonefor publicly accessible models).
Methods
load_model
def load_model( self, model_ref: ModelInferenceConfig, *, datastructure: DataStructure, schema: BitfountSchema, batch_size: int | None,) ‑> ModelProtocol:Download and instantiate a model from the Hub.
Arguments
model_ref: TheModelInferenceConfigidentifying the model (itsmodel_ref,model_versionandmodel_username).datastructure: DataStructure for model initialisation.schema: BitfountSchema for model initialisation.batch_size: Batch size hint (passed to model constructor if supported).
Returns An instantiated model ready for inference.