furiosa.registry.client.transport package

Submodules

furiosa.registry.client.transport.base module

class furiosa.registry.client.transport.base.Transport

Bases: abc.ABC

Base transport class to read/download from various registry sources.

property cache_directory: str

Cache directory to save downloaded files.

abstract async download(uri: str) str

Download a registry directory into local destination.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

read

Dispatch methods based on type signature

See also

Dispatcher

furiosa.registry.client.transport.file module

class furiosa.registry.client.transport.file.FileTransport

Bases: furiosa.registry.client.transport.base.Transport

Transport for local file path.

This transport check specified URI has valid local file scheme (e.g. file://).

async download(uri: str) str

Download a registry directory into local destination.

FileTransport download is just to copy local directory into the cache.

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

read

Dispatch methods based on type signature

See also

Dispatcher

scheme = 'file://'

furiosa.registry.client.transport.github module

class furiosa.registry.client.transport.github.GithubTransport(headers: Dict = {}, params: Dict = {})

Bases: furiosa.registry.client.transport.http.HTTPTransport

Transport for Github repository.

This transport check specified URI has valid Github repository URL. (e.g. https://github.com/)

async download(uri: str)

Download a registry directory into local destination.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

parse(uri: str) Tuple[str, str, str]

Parse URI following Github repository scheme.

e.g. https://github.com/furiosa-ai/furiosa-models:main to (furiosa-ai, furiosa-models, main)

read

Dispatch methods based on type signature

See also

Dispatcher

schemes = ('https://github.com/', 'http://github.com/')

furiosa.registry.client.transport.http module

class furiosa.registry.client.transport.http.HTTPTransport(headers: Dict = {}, params: Dict = {})

Bases: furiosa.registry.client.transport.base.Transport

Transport for HTTP.

This transport check specified URI has valid http scheme (e.g. https://, http://)

async download(uri: str) str

Download a registry directory into local destination.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

read

Dispatch methods based on type signature

See also

Dispatcher

schemes = ('https://', 'http://')

furiosa.registry.client.transport.s3 module

class furiosa.registry.client.transport.s3.S3Transport

Bases: furiosa.registry.client.transport.base.Transport

Transport for S3.

This transport check specified URI has valid S3 scheme (e.g. s3://).

async download(uri: str) str

Download a registry directory into local destination.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

static parse(uri: str) Tuple[str, str]

Parse URI to network location and path.

read

Dispatch methods based on type signature

See also

Dispatcher

scheme = 's3://'

Module contents

FuriosaAI registry transport

class furiosa.registry.client.transport.FileTransport

Bases: furiosa.registry.client.transport.base.Transport

Transport for local file path.

This transport check specified URI has valid local file scheme (e.g. file://).

async download(uri: str) str

Download a registry directory into local destination.

FileTransport download is just to copy local directory into the cache.

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

read

Dispatch methods based on type signature

See also

Dispatcher

scheme = 'file://'
class furiosa.registry.client.transport.GithubTransport(headers: Dict = {}, params: Dict = {})

Bases: furiosa.registry.client.transport.http.HTTPTransport

Transport for Github repository.

This transport check specified URI has valid Github repository URL. (e.g. https://github.com/)

async download(uri: str)

Download a registry directory into local destination.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

parse(uri: str) Tuple[str, str, str]

Parse URI following Github repository scheme.

e.g. https://github.com/furiosa-ai/furiosa-models:main to (furiosa-ai, furiosa-models, main)

read

Dispatch methods based on type signature

See also

Dispatcher

schemes = ('https://github.com/', 'http://github.com/')
class furiosa.registry.client.transport.HTTPTransport(headers: Dict = {}, params: Dict = {})

Bases: furiosa.registry.client.transport.base.Transport

Transport for HTTP.

This transport check specified URI has valid http scheme (e.g. https://, http://)

async download(uri: str) str

Download a registry directory into local destination.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

read

Dispatch methods based on type signature

See also

Dispatcher

schemes = ('https://', 'http://')
class furiosa.registry.client.transport.S3Transport

Bases: furiosa.registry.client.transport.base.Transport

Transport for S3.

This transport check specified URI has valid S3 scheme (e.g. s3://).

async download(uri: str) str

Download a registry directory into local destination.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

static parse(uri: str) Tuple[str, str]

Parse URI to network location and path.

read

Dispatch methods based on type signature

See also

Dispatcher

scheme = 's3://'
class furiosa.registry.client.transport.Transport

Bases: abc.ABC

Base transport class to read/download from various registry sources.

property cache_directory: str

Cache directory to save downloaded files.

abstract async download(uri: str) str

Download a registry directory into local destination.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

static is_supported(uri: str) bool

Decide whether this transport supports the specified URI.

Parameters

uri (str) – Registry URI to locate the models.

Returns

This transport supports the URI or not.

Return type

bool

read

Dispatch methods based on type signature

See also

Dispatcher

async furiosa.registry.client.transport.download(uri: str) str

Download a registry directory into local destination with a transport which supports the URI.

Parameters

uri (str) – Registry URI to download the data.

Returns

Destination directory name. This directory will be located in cache directory.

Return type

str

Raises

TransportNotFound – If all the available transports are not supporting the URI.

furiosa.registry.client.transport.is_relative(path: str) bool

Is this path relative path?

If all the available transports are not supporting the path, we assume that it’s a relative path. You should find the path from the registry URI if it’s a relative path.

furiosa.registry.client.transport.supported(uri: str) Iterator[furiosa.registry.client.transport.base.Transport]

Supported transport for the URI.