nvidia-nat-openpipe-art 1.4.0a20260116__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nat/meta/pypi.md ADDED
@@ -0,0 +1,23 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
+ SPDX-License-Identifier: Apache-2.0
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ -->
17
+
18
+ ![NVIDIA NeMo Agent Toolkit](https://media.githubusercontent.com/media/NVIDIA/NeMo-Agent-Toolkit/refs/heads/main/docs/source/_static/banner.png "NeMo Agent toolkit banner image")
19
+
20
+ # NVIDIA NeMo Agent Toolkit Subpackage
21
+ This is a subpackage for OpenPipe ART integration in NeMo Agent toolkit.
22
+
23
+ For more information about the NVIDIA NeMo Agent toolkit, please visit the [NeMo Agent toolkit GitHub Repo](https://github.com/NVIDIA/NeMo-Agent-Toolkit).
File without changes
@@ -0,0 +1,77 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import art
17
+ from pydantic import BaseModel
18
+ from pydantic import Field
19
+
20
+ from nat.data_models.finetuning import TrainerAdapterConfig
21
+ from nat.data_models.finetuning import TrainerConfig
22
+ from nat.data_models.finetuning import TrajectoryBuilderConfig
23
+
24
+
25
+ class ARTTrajectoryBuilderConfig(TrajectoryBuilderConfig, name="openpipe_art_traj_builder"):
26
+ """
27
+ Configuration for the OpenPipe ART Trajectory Builder.
28
+ """
29
+ num_generations: int = Field(default=2,
30
+ description="Number of trajectory generations per example in eval dataset",
31
+ ge=1)
32
+
33
+
34
+ class ARTBackendConfig(BaseModel):
35
+ """
36
+ Base configuration for the ART backend.
37
+ """
38
+ ip: str = Field(description="IP Address of Remote Backend")
39
+
40
+ port: int = Field(description="Port for Remote Backend")
41
+
42
+ name: str = Field(default="trainer_run", description="Name of the Trainer run.")
43
+
44
+ project: str = Field(default="trainer_project", description="Project name for the Trainer run.")
45
+
46
+ base_model: str = Field(
47
+ description="Base model to use for the training. This is the model that will be fine-tuned.",
48
+ default="Qwen/Qwen2.5-7B-Instruct")
49
+
50
+ api_key: str = Field(description="API key for authenticating with the ART backend.", default="default")
51
+
52
+ delete_old_checkpoints: bool = Field(description="Whether to delete old checkpoints after a training epoch",
53
+ default=False)
54
+
55
+ init_args: art.dev.InitArgs | None = Field(description="Initialization args for Remote Backend", default=None)
56
+
57
+ engine_args: art.dev.EngineArgs | None = Field(description="Engine args for Remote Backend", default=None)
58
+
59
+ torchtune_args: art.dev.TorchtuneArgs | None = Field(description="Torchtune args for Remote Backend", default=None)
60
+
61
+ server_config: art.dev.OpenAIServerConfig | None = Field(description="Server args for Remote Backend", default=None)
62
+
63
+
64
+ class ARTTrainerAdapterConfig(TrainerAdapterConfig, name="openpipe_art_trainer_adapter"):
65
+ """
66
+ Configuration for the ART Trainer run
67
+ """
68
+
69
+ backend: ARTBackendConfig = Field(description="Configuration for the ART backend.")
70
+ training: art.dev.TrainerArgs | None = Field(description="Training args for Remote Backend", default=None)
71
+
72
+
73
+ class ARTTrainerConfig(TrainerConfig, name="openpipe_art_trainer"):
74
+ """
75
+ Configuration for the ART Trainer run
76
+ """
77
+ pass
@@ -0,0 +1,71 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from nat.builder.builder import Builder
17
+ from nat.cli.register_workflow import register_trainer
18
+ from nat.cli.register_workflow import register_trainer_adapter
19
+ from nat.cli.register_workflow import register_trajectory_builder
20
+
21
+ from .config import ARTTrainerAdapterConfig
22
+ from .config import ARTTrainerConfig
23
+ from .config import ARTTrajectoryBuilderConfig
24
+ from .trainer import ARTTrainer
25
+ from .trainer_adapter import ARTTrainerAdapter
26
+ from .trajectory_builder import ARTTrajectoryBuilder
27
+
28
+
29
+ @register_trajectory_builder(config_type=ARTTrajectoryBuilderConfig)
30
+ async def register_art_trajectory_builder(config: ARTTrajectoryBuilderConfig, builder: Builder):
31
+ """
32
+ Register the ART trajectory builder.
33
+
34
+ Args:
35
+ config: TrajectoryBuilderConfig object
36
+ builder: Builder instance
37
+
38
+ Returns:
39
+ ARTTrajectoryBuilder instance
40
+ """
41
+ yield ARTTrajectoryBuilder(trajectory_builder_config=config)
42
+
43
+
44
+ @register_trainer_adapter(config_type=ARTTrainerAdapterConfig)
45
+ async def register_art_trainer_adapter(config: ARTTrainerAdapterConfig, builder: Builder):
46
+ """
47
+ Register the ART trainer adapter.
48
+
49
+ Args:
50
+ config: TrainerAdapterConfig object
51
+ builder: Builder instance
52
+
53
+ Returns:
54
+ ARTTrainerAdapter instance
55
+ """
56
+ yield ARTTrainerAdapter(adapter_config=config)
57
+
58
+
59
+ @register_trainer(config_type=ARTTrainerConfig)
60
+ async def register_art_trainer(config: ARTTrainerConfig, builder: Builder):
61
+ """
62
+ Register the ART trainer.
63
+
64
+ Args:
65
+ config: TrainerConfig object
66
+ builder: Builder instance
67
+
68
+ Returns:
69
+ ARTTrainer instance
70
+ """
71
+ yield ARTTrainer(trainer_config=config)