Customization Configs Resource#
- class nemo_microservices.resources.customization.ConfigsResource(client: NeMoMicroservices)#
Bases:
SyncAPIResource
- property with_raw_response: 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: 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
- create(
- *,
- max_seq_length: int,
- training_options: Iterable[CustomizationTrainingOptionParam],
- chat_prompt_template: str | NotGiven = NOT_GIVEN,
- custom_fields: Dict[str, str] | NotGiven = NOT_GIVEN,
- dataset_schemas: Iterable[object] | NotGiven = NOT_GIVEN,
- description: str | NotGiven = NOT_GIVEN,
- name: str | NotGiven = NOT_GIVEN,
- namespace: str | NotGiven = NOT_GIVEN,
- ownership: Ownership | NotGiven = NOT_GIVEN,
- pod_spec: TrainingPodSpecParam | NotGiven = NOT_GIVEN,
- project: str | NotGiven = NOT_GIVEN,
- prompt_template: str | NotGiven = NOT_GIVEN,
- target: config_create_params.Target | NotGiven = NOT_GIVEN,
- training_precision: ModelPrecision | 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,
Create a new customization config.
- Parameters:
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
custom_fields – A set of custom fields that the user can define and use for various purposes.
dataset_schemas – Descriptions of the expected formats of the datasets uploaded.
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’
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
- retrieve(
- config_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,
Get Customization Config
- 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(
- config_name: str,
- *,
- namespace: str,
- add_training_options: Iterable[CustomizationTrainingOptionParam] | NotGiven = NOT_GIVEN,
- chat_prompt_template: str | NotGiven = NOT_GIVEN,
- custom_fields: Dict[str, str] | NotGiven = NOT_GIVEN,
- dataset_schemas: Iterable[object] | NotGiven = NOT_GIVEN,
- description: str | NotGiven = NOT_GIVEN,
- max_seq_length: int | NotGiven = NOT_GIVEN,
- ownership: Ownership | NotGiven = NOT_GIVEN,
- pod_spec: TrainingPodSpecParam | NotGiven = NOT_GIVEN,
- project: str | NotGiven = NOT_GIVEN,
- prompt_template: str | NotGiven = NOT_GIVEN,
- remove_training_options: Iterable[CustomizationTrainingOptionRemovalParam] | NotGiven = NOT_GIVEN,
- training_options: Iterable[CustomizationTrainingOptionParam] | NotGiven = NOT_GIVEN,
- training_precision: ModelPrecision | 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,
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:
If training_options is provided, matching existing options are updated field-by-field
If add_training_options is provided, new options are appended to the list
If remove_training_options is provided, matching options are deleted
All other existing training options remain unchanged
- Parameters:
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
custom_fields – A set of custom fields that the user can define and use for various purposes.
dataset_schemas – Descriptions of the expected formats of the datasets uploaded.
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’
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
- list(
- *,
- filter: CustomizationConfigFilterParam | NotGiven = NOT_GIVEN,
- page: int | NotGiven = NOT_GIVEN,
- page_size: int | NotGiven = NOT_GIVEN,
- sort: CustomizationConfigSortField | 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,
List available customization configs.
- Parameters:
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
- delete(
- config_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,
Delete Customization Config
- 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.AsyncConfigsResource(client: AsyncNeMoMicroservices)#
Bases:
AsyncAPIResource
- property with_raw_response: 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: 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
- async create(
- *,
- max_seq_length: int,
- training_options: Iterable[CustomizationTrainingOptionParam],
- chat_prompt_template: str | NotGiven = NOT_GIVEN,
- custom_fields: Dict[str, str] | NotGiven = NOT_GIVEN,
- dataset_schemas: Iterable[object] | NotGiven = NOT_GIVEN,
- description: str | NotGiven = NOT_GIVEN,
- name: str | NotGiven = NOT_GIVEN,
- namespace: str | NotGiven = NOT_GIVEN,
- ownership: Ownership | NotGiven = NOT_GIVEN,
- pod_spec: TrainingPodSpecParam | NotGiven = NOT_GIVEN,
- project: str | NotGiven = NOT_GIVEN,
- prompt_template: str | NotGiven = NOT_GIVEN,
- target: config_create_params.Target | NotGiven = NOT_GIVEN,
- training_precision: ModelPrecision | 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,
Create a new customization config.
- Parameters:
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
custom_fields – A set of custom fields that the user can define and use for various purposes.
dataset_schemas – Descriptions of the expected formats of the datasets uploaded.
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’
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 retrieve(
- config_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,
Get Customization Config
- 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(
- config_name: str,
- *,
- namespace: str,
- add_training_options: Iterable[CustomizationTrainingOptionParam] | NotGiven = NOT_GIVEN,
- chat_prompt_template: str | NotGiven = NOT_GIVEN,
- custom_fields: Dict[str, str] | NotGiven = NOT_GIVEN,
- dataset_schemas: Iterable[object] | NotGiven = NOT_GIVEN,
- description: str | NotGiven = NOT_GIVEN,
- max_seq_length: int | NotGiven = NOT_GIVEN,
- ownership: Ownership | NotGiven = NOT_GIVEN,
- pod_spec: TrainingPodSpecParam | NotGiven = NOT_GIVEN,
- project: str | NotGiven = NOT_GIVEN,
- prompt_template: str | NotGiven = NOT_GIVEN,
- remove_training_options: Iterable[CustomizationTrainingOptionRemovalParam] | NotGiven = NOT_GIVEN,
- training_options: Iterable[CustomizationTrainingOptionParam] | NotGiven = NOT_GIVEN,
- training_precision: ModelPrecision | 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,
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:
If training_options is provided, matching existing options are updated field-by-field
If add_training_options is provided, new options are appended to the list
If remove_training_options is provided, matching options are deleted
All other existing training options remain unchanged
- Parameters:
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
custom_fields – A set of custom fields that the user can define and use for various purposes.
dataset_schemas – Descriptions of the expected formats of the datasets uploaded.
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’
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
- list(
- *,
- filter: CustomizationConfigFilterParam | NotGiven = NOT_GIVEN,
- page: int | NotGiven = NOT_GIVEN,
- page_size: int | NotGiven = NOT_GIVEN,
- sort: CustomizationConfigSortField | 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,
List available customization configs.
- Parameters:
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 delete(
- config_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,
Delete Customization Config
- 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],