nemo_microservices.resources.customization.configs#

Module Contents#

Classes#

API#

class nemo_microservices.resources.customization.configs.AsyncConfigsResource(
client: nemo_microservices._client.AsyncNeMoMicroservices,
)#

Bases: nemo_microservices._resource.AsyncAPIResource

Initialization

async create(
*,
max_seq_length: int,
training_options: Iterable[nemo_microservices.types.customization_training_option_param.CustomizationTrainingOptionParam],
chat_prompt_template: str | nemo_microservices._types.Omit = omit,
custom_fields: Dict[str, object] | nemo_microservices._types.Omit = omit,
dataset_schemas: Iterable[Dict[str, object]] | nemo_microservices._types.Omit = omit,
description: str | nemo_microservices._types.Omit = omit,
name: str | nemo_microservices._types.Omit = omit,
namespace: str | nemo_microservices._types.Omit = omit,
ownership: nemo_microservices.types.shared_params.ownership.Ownership | nemo_microservices._types.Omit = omit,
pod_spec: nemo_microservices.types.training_pod_spec_param.TrainingPodSpecParam | nemo_microservices._types.Omit = omit,
project: str | nemo_microservices._types.Omit = omit,
prompt_template: str | nemo_microservices._types.Omit = omit,
target: nemo_microservices.types.customization.config_create_params.Target | nemo_microservices._types.Omit = omit,
training_precision: nemo_microservices.types.shared.model_precision.ModelPrecision | nemo_microservices._types.Omit = omit,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) nemo_microservices.types.customization_config.CustomizationConfig#

Create a new customization config.

Args: max_seq_length: The largest context used for training. Datasets are truncated based on the maximum sequence length.

training_options: Resource configuration for each training option for the model.

chat_prompt_template: Chat Prompt Template to apply to the model to make it compatible with chat datasets, or to train it on a different template for your use case.

      This parameter is only used for the "SFT" and "Distillation" Training Types on non embedding models.

custom_fields: A set of custom fields that the user can define and use for various purposes.

dataset_schemas: JSON Schema used for validating datasets that can be used with the configured finetuning jobs.

description: The description of the entity.

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. This can be missing for namespace entities or in deployments that don’t use namespaces.

ownership: Information about ownership of an entity.

  If the entity is a namespace, the `access_policies` will typically apply to all
  entities inside the namespace.

pod_spec: Additional parameters to ensure these training jobs get run on the appropriate hardware.

project: The URN of the project associated with this entity.

prompt_template: Prompt template used to extract keys from the dataset. E.g. prompt_template=’{input} {output}’, and sample looks like ‘{“input”: “Q: 2x2 A:”, “output”: “4”}’ then the model sees ‘Q: 2x2 A: 4’.

      This parameter is only used for the "SFT" and "Distillation" Training Types on non embeddding models.

target: The target to perform the customization on

training_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

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(
config_name: str,
*,
namespace: str,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) object#

Delete Customization Config

Args: 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: nemo_microservices.types.customization.customization_config_filter_param.CustomizationConfigFilterParam | nemo_microservices._types.Omit = omit,
page: int | nemo_microservices._types.Omit = omit,
page_size: int | nemo_microservices._types.Omit = omit,
sort: nemo_microservices.types.customization.customization_config_sort_field.CustomizationConfigSortField | nemo_microservices._types.Omit = omit,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) nemo_microservices._base_client.AsyncPaginator[nemo_microservices.types.customization_config.CustomizationConfig, nemo_microservices.pagination.AsyncDefaultPagination[nemo_microservices.types.customization_config.CustomizationConfig]]#

List available customization configs.

Args: filter: Filter customization configs 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 retrieve(
config_name: str,
*,
namespace: str,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) nemo_microservices.types.customization_config.CustomizationConfig#

Get Customization Config

Args: 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(
config_name: str,
*,
namespace: str,
add_training_options: Iterable[nemo_microservices.types.customization_training_option_param.CustomizationTrainingOptionParam] | nemo_microservices._types.Omit = omit,
chat_prompt_template: str | nemo_microservices._types.Omit = omit,
custom_fields: Dict[str, object] | nemo_microservices._types.Omit = omit,
dataset_schemas: Iterable[Dict[str, object]] | nemo_microservices._types.Omit = omit,
description: str | nemo_microservices._types.Omit = omit,
max_seq_length: int | nemo_microservices._types.Omit = omit,
ownership: nemo_microservices.types.shared_params.ownership.Ownership | nemo_microservices._types.Omit = omit,
pod_spec: nemo_microservices.types.training_pod_spec_param.TrainingPodSpecParam | nemo_microservices._types.Omit = omit,
project: str | nemo_microservices._types.Omit = omit,
prompt_template: str | nemo_microservices._types.Omit = omit,
remove_training_options: Iterable[nemo_microservices.types.customization.customization_training_option_removal_param.CustomizationTrainingOptionRemovalParam] | nemo_microservices._types.Omit = omit,
training_options: Iterable[nemo_microservices.types.customization_training_option_param.CustomizationTrainingOptionParam] | nemo_microservices._types.Omit = omit,
training_precision: nemo_microservices.types.shared.model_precision.ModelPrecision | nemo_microservices._types.Omit = omit,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) nemo_microservices.types.customization_config.CustomizationConfig#

Update a customization configuration with partial data.

This endpoint supports partial updates with the following behavior:

Override Behavior (Complete Replacement):

  • Top-level fields (e.g., description) - values are completely replaced

  • pod_spec - each field in the pod_spec is replaced if provided. If a field is not provided, it is not removed.

  • dataset_schemas - entire dataset schemas are replaced if provided, no merging is done

Training Options Management: Training options are identified by the combination of training_type and finetuning_type. When updating training options:

  1. If training_options is provided, matching existing options are updated field-by-field

  2. If add_training_options is provided, new options are appended to the list

  3. If remove_training_options is provided, matching options are deleted

  4. All other existing training options remain unchanged

Args: add_training_options: List of training options to add in the existing training options for the config.

chat_prompt_template: Chat Prompt Template to apply to the model to make it compatible with chat datasets, or to train it on a different template for your use case.

      This parameter is only used for the "SFT" and "Distillation" Training Types on non embedding models.

custom_fields: A set of custom fields that the user can define and use for various purposes.

dataset_schemas: JSON Schema used for validating datasets that can be used with the configured finetuning jobs.

description: The description of the entity.

max_seq_length: The largest context used for training. Datasets are truncated based on the maximum sequence length.

ownership: Information about ownership of an entity.

  If the entity is a namespace, the `access_policies` will typically apply to all
  entities inside the namespace.

pod_spec: Additional parameters to ensure these training jobs get run on the appropriate hardware.

project: The URN of the project associated with this entity.

prompt_template: Prompt template used to extract keys from the dataset. E.g. prompt_template=’{input} {output}’, and sample looks like ‘{“input”: “Q: 2x2 A:”, “output”: “4”}’ then the model sees ‘Q: 2x2 A: 4’.

      This parameter is only used for the "SFT" and "Distillation" Training Types on non embeddding models.

remove_training_options: List of training options to remove from the existing training options for the config.

training_options: Resource configuration for each training option for the model.

training_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

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

property with_raw_response: nemo_microservices.resources.customization.configs.AsyncConfigsResourceWithRawResponse#

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: nemo_microservices.resources.customization.configs.AsyncConfigsResourceWithStreamingResponse#

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

class nemo_microservices.resources.customization.configs.AsyncConfigsResourceWithRawResponse(
configs: nemo_microservices.resources.customization.configs.AsyncConfigsResource,
)#

Initialization

class nemo_microservices.resources.customization.configs.AsyncConfigsResourceWithStreamingResponse(
configs: nemo_microservices.resources.customization.configs.AsyncConfigsResource,
)#

Initialization

class nemo_microservices.resources.customization.configs.ConfigsResource(client: nemo_microservices._client.NeMoMicroservices)#

Bases: nemo_microservices._resource.SyncAPIResource

Initialization

create(
*,
max_seq_length: int,
training_options: Iterable[nemo_microservices.types.customization_training_option_param.CustomizationTrainingOptionParam],
chat_prompt_template: str | nemo_microservices._types.Omit = omit,
custom_fields: Dict[str, object] | nemo_microservices._types.Omit = omit,
dataset_schemas: Iterable[Dict[str, object]] | nemo_microservices._types.Omit = omit,
description: str | nemo_microservices._types.Omit = omit,
name: str | nemo_microservices._types.Omit = omit,
namespace: str | nemo_microservices._types.Omit = omit,
ownership: nemo_microservices.types.shared_params.ownership.Ownership | nemo_microservices._types.Omit = omit,
pod_spec: nemo_microservices.types.training_pod_spec_param.TrainingPodSpecParam | nemo_microservices._types.Omit = omit,
project: str | nemo_microservices._types.Omit = omit,
prompt_template: str | nemo_microservices._types.Omit = omit,
target: nemo_microservices.types.customization.config_create_params.Target | nemo_microservices._types.Omit = omit,
training_precision: nemo_microservices.types.shared.model_precision.ModelPrecision | nemo_microservices._types.Omit = omit,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) nemo_microservices.types.customization_config.CustomizationConfig#

Create a new customization config.

Args: max_seq_length: The largest context used for training. Datasets are truncated based on the maximum sequence length.

training_options: Resource configuration for each training option for the model.

chat_prompt_template: Chat Prompt Template to apply to the model to make it compatible with chat datasets, or to train it on a different template for your use case.

      This parameter is only used for the "SFT" and "Distillation" Training Types on non embedding models.

custom_fields: A set of custom fields that the user can define and use for various purposes.

dataset_schemas: JSON Schema used for validating datasets that can be used with the configured finetuning jobs.

description: The description of the entity.

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. This can be missing for namespace entities or in deployments that don’t use namespaces.

ownership: Information about ownership of an entity.

  If the entity is a namespace, the `access_policies` will typically apply to all
  entities inside the namespace.

pod_spec: Additional parameters to ensure these training jobs get run on the appropriate hardware.

project: The URN of the project associated with this entity.

prompt_template: Prompt template used to extract keys from the dataset. E.g. prompt_template=’{input} {output}’, and sample looks like ‘{“input”: “Q: 2x2 A:”, “output”: “4”}’ then the model sees ‘Q: 2x2 A: 4’.

      This parameter is only used for the "SFT" and "Distillation" Training Types on non embeddding models.

target: The target to perform the customization on

training_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

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(
config_name: str,
*,
namespace: str,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) object#

Delete Customization Config

Args: 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: nemo_microservices.types.customization.customization_config_filter_param.CustomizationConfigFilterParam | nemo_microservices._types.Omit = omit,
page: int | nemo_microservices._types.Omit = omit,
page_size: int | nemo_microservices._types.Omit = omit,
sort: nemo_microservices.types.customization.customization_config_sort_field.CustomizationConfigSortField | nemo_microservices._types.Omit = omit,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) nemo_microservices.pagination.SyncDefaultPagination[nemo_microservices.types.customization_config.CustomizationConfig]#

List available customization configs.

Args: filter: Filter customization configs 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

retrieve(
config_name: str,
*,
namespace: str,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) nemo_microservices.types.customization_config.CustomizationConfig#

Get Customization Config

Args: 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(
config_name: str,
*,
namespace: str,
add_training_options: Iterable[nemo_microservices.types.customization_training_option_param.CustomizationTrainingOptionParam] | nemo_microservices._types.Omit = omit,
chat_prompt_template: str | nemo_microservices._types.Omit = omit,
custom_fields: Dict[str, object] | nemo_microservices._types.Omit = omit,
dataset_schemas: Iterable[Dict[str, object]] | nemo_microservices._types.Omit = omit,
description: str | nemo_microservices._types.Omit = omit,
max_seq_length: int | nemo_microservices._types.Omit = omit,
ownership: nemo_microservices.types.shared_params.ownership.Ownership | nemo_microservices._types.Omit = omit,
pod_spec: nemo_microservices.types.training_pod_spec_param.TrainingPodSpecParam | nemo_microservices._types.Omit = omit,
project: str | nemo_microservices._types.Omit = omit,
prompt_template: str | nemo_microservices._types.Omit = omit,
remove_training_options: Iterable[nemo_microservices.types.customization.customization_training_option_removal_param.CustomizationTrainingOptionRemovalParam] | nemo_microservices._types.Omit = omit,
training_options: Iterable[nemo_microservices.types.customization_training_option_param.CustomizationTrainingOptionParam] | nemo_microservices._types.Omit = omit,
training_precision: nemo_microservices.types.shared.model_precision.ModelPrecision | nemo_microservices._types.Omit = omit,
extra_headers: nemo_microservices._types.Headers | None = None,
extra_query: nemo_microservices._types.Query | None = None,
extra_body: nemo_microservices._types.Body | None = None,
timeout: float | httpx.Timeout | None | nemo_microservices._types.NotGiven = not_given,
) nemo_microservices.types.customization_config.CustomizationConfig#

Update a customization configuration with partial data.

This endpoint supports partial updates with the following behavior:

Override Behavior (Complete Replacement):

  • Top-level fields (e.g., description) - values are completely replaced

  • pod_spec - each field in the pod_spec is replaced if provided. If a field is not provided, it is not removed.

  • dataset_schemas - entire dataset schemas are replaced if provided, no merging is done

Training Options Management: Training options are identified by the combination of training_type and finetuning_type. When updating training options:

  1. If training_options is provided, matching existing options are updated field-by-field

  2. If add_training_options is provided, new options are appended to the list

  3. If remove_training_options is provided, matching options are deleted

  4. All other existing training options remain unchanged

Args: add_training_options: List of training options to add in the existing training options for the config.

chat_prompt_template: Chat Prompt Template to apply to the model to make it compatible with chat datasets, or to train it on a different template for your use case.

      This parameter is only used for the "SFT" and "Distillation" Training Types on non embedding models.

custom_fields: A set of custom fields that the user can define and use for various purposes.

dataset_schemas: JSON Schema used for validating datasets that can be used with the configured finetuning jobs.

description: The description of the entity.

max_seq_length: The largest context used for training. Datasets are truncated based on the maximum sequence length.

ownership: Information about ownership of an entity.

  If the entity is a namespace, the `access_policies` will typically apply to all
  entities inside the namespace.

pod_spec: Additional parameters to ensure these training jobs get run on the appropriate hardware.

project: The URN of the project associated with this entity.

prompt_template: Prompt template used to extract keys from the dataset. E.g. prompt_template=’{input} {output}’, and sample looks like ‘{“input”: “Q: 2x2 A:”, “output”: “4”}’ then the model sees ‘Q: 2x2 A: 4’.

      This parameter is only used for the "SFT" and "Distillation" Training Types on non embeddding models.

remove_training_options: List of training options to remove from the existing training options for the config.

training_options: Resource configuration for each training option for the model.

training_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

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

property with_raw_response: nemo_microservices.resources.customization.configs.ConfigsResourceWithRawResponse#

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: nemo_microservices.resources.customization.configs.ConfigsResourceWithStreamingResponse#

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

class nemo_microservices.resources.customization.configs.ConfigsResourceWithRawResponse(
configs: nemo_microservices.resources.customization.configs.ConfigsResource,
)#

Initialization

class nemo_microservices.resources.customization.configs.ConfigsResourceWithStreamingResponse(
configs: nemo_microservices.resources.customization.configs.ConfigsResource,
)#

Initialization