klyn.llm.inference.hub.HubClient.download
method
public static download(repository as String, revision as String = "main", cache as Path = null, offline as Boolean = false, token as String = "", verbose as Boolean = true) as HubSnapshot
Description

Downloads or reuses a complete, pinned local snapshot. Files use a bounded 64 KiB transfer buffer. Interrupted .part files resume only after HTTP range validation. LFS SHA-256 is checked before publication; ordinary Git assets have their byte count checked over verified TLS. Complete cache hits check sizes, not all weight digests on every startup. Offline mode performs no network access and requires a completed snapshot.

Parameters
ParameterDescription
repositoryHub identifier such as Qwen/Qwen3.5-9B.
revisionBranch, tag or commit; main by default.
cacheCache root; defaults to ~/.cache/klyn/models/huggingface.
offlineUse only an already-complete cached snapshot.
tokenOptional access token, never forwarded across hosts.
verboseShow byte progress during downloads.
Returns

Complete snapshot with its resolved immutable revision.

Throws
  • IOException for network, integrity or incomplete-cache errors.
  • ValueException for invalid identifiers or oversized metadata.
Example

snapshot = HubClient.download("Qwen/Qwen3.5-9B", offline=true)