Retrieve

Provides coroutine-based access to retrieve stored model assets, invocation inputs, and invocation outputs from the Norman persistence layer.

The Retrieve class allows direct download of stored binary content via iterator-based responses for efficient streaming.

get_invocation_input(token, account_id, model_id, invocation_id, input_id) async

Coroutine

Retrieve a specific invocation input file.

This method streams input data that was used in a particular model invocation, enabling efficient file-based access for audits or reprocessing.

Parameters

  • token (Sensitive[str]) — Authentication token authorizing the request.

  • account_id (str) — ID of the account that owns the invocation.

  • model_id (str) — ID of the model associated with the invocation.

  • invocation_id (str) — Unique identifier of the invocation.

  • input_id (str) — Unique identifier of the invocation input to retrieve.

Response Structure

  • response (AsyncIterator[bytes]) — Asynchronous byte stream yielding the input file data.


Example Usage:

stream = await Retrieve().get_invocation_input(
    token=my_token,
    account_id="acc_123",
    model_id="mod_456",
    invocation_id="inv_789",
    input_id="input_001"
)

async with aiofiles.open("input.png", "wb") as f:
    async for chunk in stream:
        await f.write(chunk)


get_invocation_output(token, account_id, model_id, invocation_id, output_id) async

Coroutine

Retrieve a specific invocation output file.

This method streams the raw output data generated by a model invocation, enabling efficient access to large binary results such as images or logs.


Parameters

  • token (Sensitive[str]) — Authentication token authorizing the request.

  • account_id (str) — ID of the account that owns the invocation.

  • model_id (str) — ID of the model that produced the output.

  • invocation_id (str) — Unique identifier of the invocation.

  • output_id (str) — Unique identifier of the output to retrieve.


Response Structure

  • response (AsyncIterator[bytes]) — Asynchronous byte stream yielding the invocation output data.


Example Usage:

retrieve_service = Retrieve()
stream = await retrieve_service.get_invocation_output(
    token=my_token,
    account_id="acc_123",
    model_id="mod_456",
    invocation_id="inv_789",
    output_id="output_image"
)

with open("output.png", "wb") as f:
    async for chunk in stream:
        f.write(chunk)


get_model_asset(token, account_id, model_id, asset_id) async

Coroutine

Retrieve a specific model asset from Norman storage.

This method streams the raw asset data (e.g., model weights, tokenizer, etc.) associated with a given account and model.


Parameters

  • token (Sensitive[str]) — Authentication token authorizing the request.

  • account_id (str) — The unique identifier of the account that owns the model.

  • model_id (str) — The unique identifier of the model to which the asset belongs.

  • asset_id (str) — The unique identifier of the asset file to retrieve.


Response Structure

  • response (AsyncIterator[bytes]) — Asynchronous byte stream yielding the asset data in chunks.


Example Usage:

retrieve_service = Retrieve()
stream = await retrieve_service.get_model_asset(
    token=my_token,
    account_id="acc_123",
    model_id="mod_456",
    asset_id="weights"
)

# Stream the file and write locally
with open("weights.bin", "wb") as f:
    async for chunk in stream:
        f.write(chunk)

·

©

2026

·

©

2026