Customization Targets Resource#

class nemo_microservices.resources.customization.TargetsResource(client: NeMoMicroservices)#

Bases: SyncAPIResource

property with_raw_response: TargetsResourceWithRawResponse#

This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.

For more information, see https://docs.nvidia.com/nemo/microservices/latest/pysdk/index.html#accessing-raw-response-data-e-g-headers

property with_streaming_response: TargetsResourceWithStreamingResponse#

An alternative to .with_raw_response that doesn’t eagerly read the response body.

For more information, see https://docs.nvidia.com/nemo/microservices/latest/pysdk/index.html#with_streaming_response

create(
*,
num_parameters: int,
precision: ModelPrecision,
base_model: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
hf_endpoint: str | NotGiven = NOT_GIVEN,
model_path: str | NotGiven = NOT_GIVEN,
model_uri: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
namespace: str | NotGiven = NOT_GIVEN,
project: str | NotGiven = NOT_GIVEN,
tokenizer: object | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) CustomizationTarget#

Create a new customization target.

Parameters:
  • num_parameters – Number of parameters used for training the model

  • precision

    Type of model precision.

    ## Values

    • ”int8” - 8-bit integer precision

    • ”bf16” - Brain floating point precision

    • ”fp16” - 16-bit floating point precision

    • ”fp32” - 32-bit floating point precision

    • ”fp8-mixed” - Mixed 8-bit floating point precision available on Hopper and later architectures.

    • ”bf16-mixed” - Mixed Brain floating point precision

  • base_model – Default to being the same as the the configuration entry name, maps to the name in NIM

  • description – The description of the entity.

  • enabled – Enable the model for training jobs

  • hf_endpoint – Configure the Hub base URL. Defaults to NeMo Data Store. Set value as “https://huggingface.co” to download model_uri from HuggingFace.

  • model_path – Path to the model checkpoints to use for training. Absolute path or local path from the models cache

  • model_uri – The URI of the model to download to the model cache at the model_path directory. To download from NGC, specify ngc://org/optional-team/model-name:version. To download from Nemo Data Store, specify hf://namespace/model-name@checkpoint-name

  • name – The name of the entity. Must be unique inside the namespace. If not specified, it will be the same as the automatically generated id.

  • namespace – The namespace of the entity. You can omit this field for namespace entities or in deployments that don’t use namespaces.

  • project – The URN of the project associated with this entity.

  • tokenizer – Overrides for the model tokenizer

  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

retrieve(
target_name: str,
*,
namespace: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) CustomizationTarget#

Get info about a customization target.

Parameters:
  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

update(
target_name: str,
*,
namespace: str,
base_model: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
hf_endpoint: str | NotGiven = NOT_GIVEN,
model_path: str | NotGiven = NOT_GIVEN,
model_uri: str | NotGiven = NOT_GIVEN,
num_parameters: int | NotGiven = NOT_GIVEN,
precision: ModelPrecision | NotGiven = NOT_GIVEN,
project: str | NotGiven = NOT_GIVEN,
tokenizer: object | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) CustomizationTarget#

Update customization target.

Parameters:
  • base_model – Default to being the same as the the configuration entry name, maps to the name in NIM

  • description – The description of the entity.

  • enabled – Enable the model for training jobs

  • hf_endpoint – Configure the Hub base URL. Defaults to NeMo Data Store. Set value as “https://huggingface.co” to download model_uri from HuggingFace.

  • model_path – Path to the model checkpoints to use for training. Absolute path or local path from the models cache

  • model_uri – The URI of the model to download to the model cache at the model_path directory. To download from NGC, specify ngc://org/optional-team/model-name:version. To download from Nemo Data Store, specify hf://namespace/model-name@checkpoint-name

  • num_parameters – Number of parameters used for training the model

  • precision

    Type of model precision.

    ## Values

    • ”int8” - 8-bit integer precision

    • ”bf16” - Brain floating point precision

    • ”fp16” - 16-bit floating point precision

    • ”fp32” - 32-bit floating point precision

    • ”fp8-mixed” - Mixed 8-bit floating point precision available on Hopper and later architectures.

    • ”bf16-mixed” - Mixed Brain floating point precision

  • project – The URN of the project associated with this entity.

  • tokenizer – Overrides for the model tokenizer

  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

list(
*,
filter: CustomizationTargetFilterParam | NotGiven = NOT_GIVEN,
page: int | NotGiven = NOT_GIVEN,
page_size: int | NotGiven = NOT_GIVEN,
sort: GenericSortField | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) SyncDefaultPagination[CustomizationTarget]#

List available customization targets.

Parameters:
  • filter – Filter targets on various criteria.

  • page – Page number.

  • page_size – Page size.

  • sort – The field to sort by. To sort in decreasing order, use - in front of the field name.

  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

delete(
target_name: str,
*,
namespace: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) object#

Delete a customization target and its associated model files.

First checks if any existing customization job is currently using the target. If not, target row is locked, and enabled is set to False, so that it cannot be used for creating a new customization job Once target is disabled, creates a k8s job to remove files from pvc and awaits until the k8s job is completed.

Parameters:
  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

create_from_dict(data: dict[str, object]) object#
class nemo_microservices.resources.customization.AsyncTargetsResource(client: AsyncNeMoMicroservices)#

Bases: AsyncAPIResource

property with_raw_response: AsyncTargetsResourceWithRawResponse#

This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.

For more information, see https://docs.nvidia.com/nemo/microservices/latest/pysdk/index.html#accessing-raw-response-data-e-g-headers

property with_streaming_response: AsyncTargetsResourceWithStreamingResponse#

An alternative to .with_raw_response that doesn’t eagerly read the response body.

For more information, see https://docs.nvidia.com/nemo/microservices/latest/pysdk/index.html#with_streaming_response

async create(
*,
num_parameters: int,
precision: ModelPrecision,
base_model: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
hf_endpoint: str | NotGiven = NOT_GIVEN,
model_path: str | NotGiven = NOT_GIVEN,
model_uri: str | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
namespace: str | NotGiven = NOT_GIVEN,
project: str | NotGiven = NOT_GIVEN,
tokenizer: object | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) CustomizationTarget#

Create a new customization target.

Parameters:
  • num_parameters – Number of parameters used for training the model

  • precision

    Type of model precision.

    ## Values

    • ”int8” - 8-bit integer precision

    • ”bf16” - Brain floating point precision

    • ”fp16” - 16-bit floating point precision

    • ”fp32” - 32-bit floating point precision

    • ”fp8-mixed” - Mixed 8-bit floating point precision available on Hopper and later architectures.

    • ”bf16-mixed” - Mixed Brain floating point precision

  • base_model – Default to being the same as the the configuration entry name, maps to the name in NIM

  • description – The description of the entity.

  • enabled – Enable the model for training jobs

  • hf_endpoint – Configure the Hub base URL. Defaults to NeMo Data Store. Set value as “https://huggingface.co” to download model_uri from HuggingFace.

  • model_path – Path to the model checkpoints to use for training. Absolute path or local path from the models cache

  • model_uri – The URI of the model to download to the model cache at the model_path directory. To download from NGC, specify ngc://org/optional-team/model-name:version. To download from Nemo Data Store, specify hf://namespace/model-name@checkpoint-name

  • name – The name of the entity. Must be unique inside the namespace. If not specified, it will be the same as the automatically generated id.

  • namespace – The namespace of the entity. You can omit this field for namespace entities or in deployments that don’t use namespaces.

  • project – The URN of the project associated with this entity.

  • tokenizer – Overrides for the model tokenizer

  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

async retrieve(
target_name: str,
*,
namespace: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) CustomizationTarget#

Get info about a customization target.

Parameters:
  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

async update(
target_name: str,
*,
namespace: str,
base_model: str | NotGiven = NOT_GIVEN,
description: str | NotGiven = NOT_GIVEN,
enabled: bool | NotGiven = NOT_GIVEN,
hf_endpoint: str | NotGiven = NOT_GIVEN,
model_path: str | NotGiven = NOT_GIVEN,
model_uri: str | NotGiven = NOT_GIVEN,
num_parameters: int | NotGiven = NOT_GIVEN,
precision: ModelPrecision | NotGiven = NOT_GIVEN,
project: str | NotGiven = NOT_GIVEN,
tokenizer: object | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) CustomizationTarget#

Update customization target.

Parameters:
  • base_model – Default to being the same as the the configuration entry name, maps to the name in NIM

  • description – The description of the entity.

  • enabled – Enable the model for training jobs

  • hf_endpoint – Configure the Hub base URL. Defaults to NeMo Data Store. Set value as “https://huggingface.co” to download model_uri from HuggingFace.

  • model_path – Path to the model checkpoints to use for training. Absolute path or local path from the models cache

  • model_uri – The URI of the model to download to the model cache at the model_path directory. To download from NGC, specify ngc://org/optional-team/model-name:version. To download from Nemo Data Store, specify hf://namespace/model-name@checkpoint-name

  • num_parameters – Number of parameters used for training the model

  • precision

    Type of model precision.

    ## Values

    • ”int8” - 8-bit integer precision

    • ”bf16” - Brain floating point precision

    • ”fp16” - 16-bit floating point precision

    • ”fp32” - 32-bit floating point precision

    • ”fp8-mixed” - Mixed 8-bit floating point precision available on Hopper and later architectures.

    • ”bf16-mixed” - Mixed Brain floating point precision

  • project – The URN of the project associated with this entity.

  • tokenizer – Overrides for the model tokenizer

  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

list(
*,
filter: CustomizationTargetFilterParam | NotGiven = NOT_GIVEN,
page: int | NotGiven = NOT_GIVEN,
page_size: int | NotGiven = NOT_GIVEN,
sort: GenericSortField | NotGiven = NOT_GIVEN,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) AsyncPaginator[CustomizationTarget, AsyncDefaultPagination[CustomizationTarget]]#

List available customization targets.

Parameters:
  • filter – Filter targets on various criteria.

  • page – Page number.

  • page_size – Page size.

  • sort – The field to sort by. To sort in decreasing order, use - in front of the field name.

  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

async delete(
target_name: str,
*,
namespace: str,
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) object#

Delete a customization target and its associated model files.

First checks if any existing customization job is currently using the target. If not, target row is locked, and enabled is set to False, so that it cannot be used for creating a new customization job Once target is disabled, creates a k8s job to remove files from pvc and awaits until the k8s job is completed.

Parameters:
  • extra_headers – Send extra headers

  • extra_query – Add additional query parameters to the request

  • extra_body – Add additional JSON properties to the request

  • timeout – Override the client-level default timeout for this request, in seconds

create_from_dict(
data: dict[str, object],
) object#