Backend
Compute backend.
A backend's job is to materialise a model + training resources and hand them to whichever algorithm runs. The Algorithm protocol is intentionally NOT parameterised by Backend: instead, the registry routes (recipe.kind, backend.kind) to a specific Algorithm implementation.
Attributes
attributenamestrFunctions
funcprepare(self, *, model, run_dir) -> dict[str, Any]Return a dict of backend-specific handles attached to ctx.extras.
e.g. for TinkerBackend: {'service_client': ..., 'training_client': ..., 'tokenizer': ..., 'model_name': ...}.
paramselfparammodeldict[str, Any]paramrun_dirstrReturns
dict[str, typing.Any]functeardown(self, handles) -> Noneparamselfparamhandlesdict[str, Any]Returns
None