Skip to main content

Methods

Apply tags to an artifact version.

Parameters

artifact_version_id
str
required
ID of the artifact version to apply tags to
tags
typing.Sequence[str]
required
List of tags to apply to the artifact version
force
typing.Optional[bool]
Whether to overwrite existing tags if they conflict

Returns

EmptyResponse
EmptyResponse
🔗 EmptyResponseEmpty response indicating successful tag application

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.apply_tags(
    artifact_version_id="value",
    tags="value",
    force="value",
)
Get an artifact version by its ID.

Parameters

id
str
required

Returns

GetArtifactVersionResponse
GetArtifactVersionResponse
🔗 GetArtifactVersionResponseThe artifact version data

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.get(
    id="id_value",
)
Delete an artifact version by its ID.

Parameters

id
str
required

Returns

EmptyResponse
EmptyResponse
🔗 EmptyResponseEmpty response indicating successful deletion

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.delete(
    id="id_value",
)
List artifact versions with optional filtering by tag, FQN, artifact ID, ML Repo, name, version, run IDs, or run steps.

Parameters

tag
typing.Optional[str]
Tag to filter artifact versions by
fqn
typing.Optional[str]
Fully qualified name to filter artifact versions by (format: ’://’ or ’://:’)
artifact_id
typing.Optional[str]
ID of the artifact to filter versions by
ml_repo_id
typing.Optional[str]
ID of the ML Repo to filter artifact versions by
name
typing.Optional[str]
Name of the artifact to filter versions by
version
typing.Optional[int]
Version number (positive integer) or ‘latest’ to filter by specific version
run_ids
typing.Optional[typing.Union[str, typing.Sequence[str]]]
List of run IDs to filter artifact versions by
run_steps
typing.Optional[typing.Union[int, typing.Sequence[int]]]
List of run step numbers to filter artifact versions by
offset
typing.Optional[int]
Number of artifact versions to skip for pagination
limit
typing.Optional[int]
Maximum number of artifact versions to return
include_internal_metadata
typing.Optional[bool]
Whether to include internal metadata in the response

Returns

SyncPager[ArtifactVersion, ListArtifactVersionsResponse]
SyncPager[ArtifactVersion, ListArtifactVersionsResponse]
🔗 ListArtifactVersionsResponseList of artifact versions matching the query with pagination information

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.list(
    tag="value",
    fqn="value",
    artifact_id="value",
    ml_repo_id="value",
    name="value",
    version="value",
    run_ids="value",
    run_steps="value",
    offset=10,
    limit=10,
    include_internal_metadata="value",
)

# Iterate through results
for item in response:
    print(item.name)

# Or paginate page by page
for page in response.iter_pages():
    for item in page:
        print(item.name)
Get pre-signed URLs for reading or writing files in an artifact version.

Parameters

id
str
required
ID of the artifact version to get signed URLs for
paths
typing.Sequence[str]
required
List of relative file paths within the artifact version to get signed URLs for
operation
Operation
required
🔗 OperationOperation type for the signed URL (e.g., ‘READ’ or ‘WRITE’)

Returns

GetSignedUrLsResponse
GetSignedUrLsResponse
🔗 GetSignedUrLsResponseList of signed URLs for the requested file paths

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.get_signed_urls(
    id="id_value",
    paths="value",
    operation="value",
)
Create a multipart upload for large files in an artifact version.

Parameters

id
str
required
ID of the artifact version to upload files to
path
str
required
Relative path within the artifact version where the file should be uploaded
num_parts
int
required
Number of parts to split the upload into for multipart upload

Returns

MultiPartUploadResponse
MultiPartUploadResponse
🔗 MultiPartUploadResponseMultipart upload information including signed URLs for each part

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.create_multi_part_upload(
    id="id_value",
    path="value",
    num_parts="value",
)
Stage an artifact version for upload, returning storage location and version ID.

Parameters

manifest
StageArtifactRequestManifest
required
🔗 StageArtifactRequestManifestManifest containing metadata for the artifact to be staged (model or generic artifact)

Returns

StageArtifactResponse
StageArtifactResponse
🔗 StageArtifactResponseStaging information including version ID, storage root, and artifact ID

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.stage(
    manifest={"key": "value"},
)
List files and directories in an artifact version.

Parameters

id
str
required
ID of the artifact version to list files from
path
typing.Optional[str]
Relative path within the artifact version to list files from (defaults to root)
limit
typing.Optional[int]
Maximum number of files/directories to return
page_token
typing.Optional[str]
Token to retrieve the next page of results

Returns

SyncPager[FileInfo, ListFilesResponse]
SyncPager[FileInfo, ListFilesResponse]
🔗 ListFilesResponseList of files and directories with pagination information

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.list_files(
    id="id_value",
    path="value",
    limit=10,
    page_token="value",
)
Mark a staged artifact version as failed.

Parameters

id
str
required
ID of the staged artifact version to mark as failed

Returns

EmptyResponse
EmptyResponse
🔗 EmptyResponseEmpty response indicating successful failure marking

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.mark_stage_failure(
    id="id_value",
)
Get Artifact Version by FQN.

Parameters

fqn
str
required
FQN of the artifact version

Returns

GetArtifactVersionResponse
GetArtifactVersionResponse
🔗 GetArtifactVersionResponseArtifact version details

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.artifact_versions.get_by_fqn(
    fqn="value",
)