-
Notifications
You must be signed in to change notification settings - Fork 123
feat: Prime Intellect verifiers integration #573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
2926282
verifiers draft
cmunley1 b84abab
get tokenids and logps
cmunley1 1f6154b
testing more envs
cmunley1 f71a2b1
readme
cmunley1 6057187
remove stuff
cmunley1 28d273c
prompt from datset not idx
cmunley1 b559bb7
training
cmunley1 efbed85
simplify
cmunley1 08329cf
copyright; request params; pydantic; local cache; dedup create dataset
cmunley1 6ed3af8
lint!
cmunley1 03a6745
tests
cmunley1 d32ba0c
remove resources server
cmunley1 b7e991e
restore pyproject
cmunley1 845b8a9
remove transitions, simplify openai client
cmunley1 f9c8578
ruff
cmunley1 ef01a64
abs import
cmunley1 61fdbe8
readme
cmunley1 a96c14e
add readme
cmunley1 3598057
readme
cmunley1 e077371
cfg rename, readme
cmunley1 61acb8f
add docs
cmunley1 58b8402
docs fixes
cmunley1 008d5a3
remove docs in favor of docs on pr 617
cmunley1 aa2300d
readme
cmunley1 c0efda7
shorten readme
cmunley1 28f2112
readme
cmunley1 f1fe0b3
Merge branch 'main' into cmunley1/verifiers
cmunley1 0397165
patch verifiers for mluti turn
cmunley1 be19102
Merge branch 'main' into cmunley1/verifiers
cmunley1 77ba5ff
doc
cmunley1 5de9f1c
readme
cmunley1 3fac067
pre commit
cmunley1 a8a4a11
pin verifiers
cmunley1 febb5e3
Merge branch 'main' of https://github.com/NVIDIA-NeMo/Gym into cmunle…
bxyu-nvidia 72eeac6
try fix secret
bxyu-nvidia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| # Description | ||
|
|
||
| This agent enables running Prime Intellect [verifiers](https://github.com/PrimeIntellect-ai/verifiers) environments, including many in Prime Intellect's [Environments Hub](https://app.primeintellect.ai/dashboard/environments?ex_sort=by_sections) in NeMo Gym. | ||
|
|
||
| ## Install Gym | ||
|
|
||
| ``` | ||
| git clone https://github.com/NVIDIA-NeMo/Gym | ||
| cd Gym | ||
| uv venv | ||
| source .venv/bin/activate | ||
| uv sync | ||
| ``` | ||
|
|
||
| ## Test acereason-math example | ||
|
|
||
| First set `env.yaml` for a local model: | ||
| ``` | ||
| policy_base_url: "http://localhost:8000/v1" | ||
| policy_api_key: <> | ||
| policy_model_name: "Qwen/Qwen3-4B-Instruct-2507" | ||
| ``` | ||
|
|
||
| Next, serve the model. | ||
|
|
||
| Make sure to serve the model with longer context length than the generation length in your agent config (e.g. acereason-math.yaml) | ||
|
|
||
| ``` | ||
| uv pip install vllm | ||
| vllm serve Qwen/Qwen3-4B-Instruct-2507 --max-model-len 32768 --reasoning-parser qwen3 --enable-auto-tool-choice --tool-call-parser hermes | ||
| ``` | ||
|
|
||
|
|
||
| Now launch NeMo Gym servers: | ||
| ``` | ||
| uv sync | ||
| ng_run "+config_paths=[responses_api_agents/verifiers_agent/configs/verifiers_acereason-math.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" | ||
| ``` | ||
|
|
||
| Collect rollouts | ||
| ``` | ||
| ng_collect_rollouts \ | ||
| +agent_name=verifiers_agent \ | ||
| +input_jsonl_fpath=responses_api_agents/verifiers_agent/data/acereason-math-example.jsonl \ | ||
| +output_jsonl_fpath=responses_api_agents/verifiers_agent/data/acereason-math-example-rollouts.jsonl \ | ||
| +limit=5 | ||
| ``` | ||
|
|
||
| View a rollout in the terminal | ||
| ``` | ||
| tail -n 1 responses_api_agents/verifiers_agent/data/acereason-math-example-rollouts.jsonl | jq | less | ||
| ``` | ||
|
|
||
|
|
||
| ## Testing new prime environments from environments hub | ||
|
|
||
| Some examples: `primeintellect/acereason-math`, `primeintellect/ascii-tree` and `primeintellect/alphabet-sort`. | ||
|
|
||
| ### Install an environment | ||
|
|
||
| ``` | ||
| uv add verifiers | ||
| uv add tool prime | ||
| prime env install primeintellect/ascii-tree | ||
| ``` | ||
|
|
||
| ### Creating a dataset | ||
|
|
||
| A helper script to make a dataset is in `scripts/create_datset.py`. | ||
|
|
||
| ``` | ||
| python3 scripts/create_dataset.py --env-id primeintellect/ascii-tree --size 5 --output data/ascii-tree-example.jsonl | ||
| ``` | ||
|
|
||
| ### Update agent server requirements | ||
|
|
||
| Update `requirements.txt` to: | ||
| ``` | ||
| -e nemo-gym[dev] @ ../../ | ||
| verifiers==0.1.9.post3 | ||
| --extra-index-url https://hub.primeintellect.ai/primeintellect/simple/ | ||
| ascii-tree | ||
| ``` | ||
| ### Update agent config | ||
| Create `configs/ascii-tree.yaml`, primarily updating env id, and any other env specific args: | ||
| ``` | ||
| verifiers_agent: | ||
| responses_api_agents: | ||
| verifiers_agent: | ||
| entrypoint: app.py | ||
| model_server: | ||
| type: responses_api_models | ||
| name: policy_model | ||
| model_name: "" | ||
| vf_env_id: ascii-tree | ||
| vf_env_args: {} | ||
| group_size: 1 | ||
| max_concurrent_generation: -1 | ||
| max_concurrent_scoring: -1 | ||
| max_tokens: 8192 | ||
| temperature: 1.0 | ||
| top_p: 1.0 | ||
|
|
||
| ``` | ||
|
|
||
| Now launch NeMo Gym servers: | ||
| ``` | ||
| uv sync | ||
| ng_run "+config_paths=[responses_api_agents/verifiers_agent/configs/ascii-tree.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" | ||
| ``` | ||
|
|
||
| Collect rollouts | ||
| ``` | ||
| ng_collect_rollouts \ | ||
| +agent_name=verifiers_agent \ | ||
| +input_jsonl_fpath=responses_api_agents/verifiers_agent/data/ascii-tree-example.jsonl \ | ||
| +output_jsonl_fpath=responses_api_agents/verifiers_agent/data/ascii-tree-example-rollouts.jsonl \ | ||
| +limit=5 | ||
| ``` | ||
|
|
||
|
|
||
| # Licensing information | ||
| Code: Apache 2.0 | ||
| Data: N/A | ||
|
|
||
| Dependencies | ||
| - nemo_gym: Apache 2.0 | ||
| - verifiers: Apache 2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.