Documentation Index Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
Use this file to discover all available pages before exploring further.
MlFoundry.
Properties
Methods
Returns a list of names of ML Repos accessible by the current user. Returns from truefoundry.ml import get_client
client = get_client()
# Get all ML repos accessible by the current user
ml_repos = client.list_ml_repos()
print ( f 'Found { len (ml_repos) } ML repos:' )
for repo in ml_repos:
print ( f ' - { repo } ' )
Creates an ML Repository. Parameters description
Optional[str]
default: "None"
Returns from truefoundry.ml import get_client
client = get_client()
# Create a new ML repository
client.create_ml_repo(
name = "my-ml-repo" ,
storage_integration_fqn = "your-storage-integration-fqn" ,
description = "My ML repository for experiments"
)
Initialize a run. Parameters run_name
Optional[str]
default: "None"
tags
Optional[Dict[str, Any]]
default: "None"
Returns from truefoundry.ml import get_client
client = get_client()
client.create_run(
ml_repo = "my-ml-repo" ,
run_name = "my-run" ,
tags ={ "key" : "value" },
)
Get an existing run by the run_id. Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.get_run_by_id(
run_id = "run-id-123" ,
)
Get an existing run by fqn. Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.get_run_by_fqn(
run_fqn = "value" ,
)
Get an existing run by run_name. Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.get_run_by_name(
ml_repo = "my-ml-repo" ,
run_name = "my-run" ,
)
The user must have READ access to the ML Repo. Parameters order_by
Sequence[str]
default: "..."
job_run_name
Optional[str]
default: "None"
Returns from truefoundry.ml import get_client
client = get_client()
client.search_runs(
ml_repo = "my-ml-repo" ,
filter_string = "value" ,
run_view_type = "value" ,
order_by = "value" ,
job_run_name = "value" ,
)
# Iterate through results
for item in response:
print (item.name)
Get the model version to download contents or load it in memory Parameters version
Union[str, int]
default: "constants.LATEST_ARTIFACT_OR_MODEL_VERSION"
Returns from truefoundry.ml import get_client
client = get_client()
client.get_model_version(
ml_repo = "my-ml-repo" ,
name = "my-run" ,
version = "value" ,
)
Get the model version to download contents or load it in memory Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.get_model_version_by_fqn(
fqn = "run-id-123" ,
)
Get all the version of a model to download contents or load them in memory Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.list_model_versions(
ml_repo = "my-ml-repo" ,
name = "my-run" ,
)
list_model_versions_by_fqn
List versions for a given model Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.list_model_versions_by_fqn(
model_fqn = "value" ,
)
Get the model version to download contents or load it in memory Parameters artifact_type
Optional[ArtifactType]
default: "ArtifactType.ARTIFACT"
version
Union[str, int]
default: "constants.LATEST_ARTIFACT_OR_MODEL_VERSION"
Returns return
Optional[ArtifactVersion]
from truefoundry.ml import get_client
client = get_client()
client.get_artifact_version(
ml_repo = "my-ml-repo" ,
name = "my-run" ,
artifact_type = "value" ,
version = "value" ,
)
get_artifact_version_by_fqn
Get the artifact version to download contents Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.get_artifact_version_by_fqn(
fqn = "run-id-123" ,
)
Get all the version of na artifact to download contents or load them in memory Parameters artifact_type
Optional[ArtifactType]
default: "ArtifactType.ARTIFACT"
Returns return
Iterator[ArtifactVersion]
from truefoundry.ml import get_client
client = get_client()
client.list_artifact_versions(
ml_repo = "my-ml-repo" ,
name = "my-run" ,
artifact_type = "value" ,
)
list_artifact_versions_by_fqn
List versions for a given artifact Parameters Returns return
Iterator[ArtifactVersion]
from truefoundry.ml import get_client
client = get_client()
client.list_artifact_versions_by_fqn(
artifact_fqn = "value" ,
)
Logs an artifact for the current ml_repo. Parameters artifact_paths
List[Union[Tuple[str], Tuple[str, Optional[str]], ArtifactPath]]
required
description
Optional[str]
default: "None"
metadata
Optional[Dict[str, Any]]
default: "None"
progress
Optional[bool]
default: "None"
Returns return
Optional[ArtifactVersion]
from truefoundry.ml import get_client
client = get_client()
client.log_artifact(
ml_repo = "my-ml-repo" ,
name = "my-run" ,
artifact_paths =[ArtifactPath( "file.txt" )],
description = "value" ,
metadata = "value" ,
progress = "value" ,
)
Serialize and log a versioned model under the current ml_repo. Each logged model generates a new version Parameters model_file_or_folder
Union[str, BlobStorageDirectory]
required
description
Optional[str]
default: "None"
metadata
Optional[Dict[str, Any]]
default: "None"
progress
Optional[bool]
default: "None"
framework
Optional[Union[str, ModelFramework, Any]]
default: "None"
environment
Optional[ModelVersionEnvironment]
default: "None"
Returns from truefoundry.ml import get_client
client = get_client()
client.log_model(
ml_repo = "my-ml-repo" ,
name = "my-run" ,
model_file_or_folder = "model.pkl" ,
description = "value" ,
metadata = "value" ,
progress = "value" ,
framework = "value" ,
environment = "value" ,
)
Create DataDirectory to Upload the files Parameters description
Optional[str]
default: "None"
metadata
Optional[Dict[str, Any]]
default: "None"
Returns from truefoundry.ml import get_client
client = get_client()
client.create_data_directory(
ml_repo = "my-ml-repo" ,
name = "my-run" ,
description = "value" ,
metadata = "value" ,
)
get_data_directory_by_fqn
Get the DataDirectory by DataDirectory FQN Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.get_data_directory_by_fqn(
fqn = "run-id-123" ,
)
Get an existing data_directory by name. Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.get_data_directory(
ml_repo = "my-ml-repo" ,
name = "my-run" ,
)
Get the list of DataDirectory in a ml_repo Parameters Returns from truefoundry.ml import get_client
client = get_client()
client.list_data_directories(
ml_repo = "my-ml-repo" ,
)