Volumes

Input Volumes

Input volumes are used to specify the data that will be made available to the job during its execution. These can include files, datasets, or other resources that the job needs to access. The following input volume types are supported:

compute_horde_sdk.v1.InputVolume

alias of InlineInputVolume | HuggingfaceInputVolume | HTTPInputVolume

class compute_horde_sdk.v1.HuggingfaceInputVolume

Volume for downloading resources from Huggingface.

By default, it downloads the entire repository and copies its structure. To narrow it down, use the allow_patterns field. If a file is inside a subfolder, it will be placed under the same path in the volume.

repo_id: str

Huggingface repository ID, in the format “namespace/name”.

repo_type: str | None

Set to “dataset” or “space” for a dataset or space, None or “model” for a model.

revision: str | None

Git revision ID: branch name / tag / commit hash.

allow_patterns: str | list[str] | None

If provided, only files matching at least one pattern are downloaded.

class compute_horde_sdk.v1.HTTPInputVolume

Volume for downloading files from the Internet via HTTP.

url: str

The URL to download the file from.

class compute_horde_sdk.v1.InlineInputVolume

Volume for inline base64 encoded files.

contents: str

Base64 encoded contents of the file

Shared HTTP inputs

Opting in shares the file with every submitter on the same native Docker executor host who supplies the same key, including other validators. Any of those submitters can populate the key on a miss. Use this for data intended for that sharing boundary. A hit skips the origin entirely, even if the new job supplies a different URL or the original signature has expired.

Use the existing SDK namespace and specify the exact workload filenames in the job’s input_volumes mapping. For example, a reference image and its companion index can share a directory:

from compute_horde_sdk.v1 import HTTPInputVolume

input_volumes = {
    "/volume/reference/img21.png": HTTPInputVolume(
        url=image_url,
        cache_key="ch17/reference/img21.png",
        cache_ttl_seconds=3600,
    ),
    "/volume/reference/img21.png.idx": HTTPInputVolume(
        url=index_url,
        cache_key="ch17/reference/img21.png.idx",
        cache_ttl_seconds=3600,
    ),
}

Choose an opaque, case-sensitive key for immutable bytes. Change it whenever the bytes change and assign each sidecar its own key. Keep credentials and signed URLs out of keys. The native executor bind-mounts each opted-in file read-only. Ordinary inputs in the same directory remain writable.

A positive integer TTL requires a nonempty string key. Hits preserve the original expiry, and a shorter TTL in a later request limits the acceptable age.

Output Volumes

Output volumes are used to specify where the outputs of the job will be stored. These can include files generated by the job. The following output volume types are supported:

compute_horde_sdk.v1.OutputVolume

alias of HTTPOutputVolume

class compute_horde_sdk.v1.HTTPOutputVolume

Volume for uploading files to the Internet via HTTP.

Supports both HTTP PUT and POST uploads.

  • For PUT uploads, provide the full presigned URL using the url parameter.

  • For POST uploads, also include any required form fields using the form_fields dictionary.

Examples: PUT upload:

HTTPOutputVolume(

http_method=”PUT”, url=”https://<your-presigned-url>”

)

POST upload:
HTTPOutputVolume(

http_method=”POST”, url=”https://<your-presigned-post-url>”, form_fields={

“key”: “example.txt”, “policy”: “<base64-policy>”, “signature”: “<signature>”, “AWSAccessKeyId”: “<access-key-id>”

}

)

Note:

The SDK does not generate presigned URLs for you. Use tools like boto3, or your S3 provider’s SDK to generate the required url and optional form_fields.

http_method: Literal['POST', 'PUT']

HTTP method to use, can be POST or PUT.

url: str

The URL to upload the file to.