Text Generation
Transformers
Safetensors
English
Chinese
qwen3
reinforcement-learning
agentic-reasoning
math-reasoning
tool-use
conversational
text-generation-inference
Instructions to use rstar2-reproduce/rStar2-Agent-14B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rstar2-reproduce/rStar2-Agent-14B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rstar2-reproduce/rStar2-Agent-14B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("rstar2-reproduce/rStar2-Agent-14B") model = AutoModelForMultimodalLM.from_pretrained("rstar2-reproduce/rStar2-Agent-14B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rstar2-reproduce/rStar2-Agent-14B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rstar2-reproduce/rStar2-Agent-14B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rstar2-reproduce/rStar2-Agent-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rstar2-reproduce/rStar2-Agent-14B
- SGLang
How to use rstar2-reproduce/rStar2-Agent-14B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "rstar2-reproduce/rStar2-Agent-14B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rstar2-reproduce/rStar2-Agent-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "rstar2-reproduce/rStar2-Agent-14B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rstar2-reproduce/rStar2-Agent-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rstar2-reproduce/rStar2-Agent-14B with Docker Model Runner:
docker model run hf.co/rstar2-reproduce/rStar2-Agent-14B
Improve model card: Add `library_name` and prominent links to paper and GitHub (#1)
Browse files- Improve model card: Add `library_name` and prominent links to paper and GitHub (39ccc9a5d5256323f6e16b701a973d1a6caf1df7)
Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>
README.md
CHANGED
|
@@ -1,24 +1,29 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
license: mit
|
|
|
|
| 3 |
tags:
|
| 4 |
- reinforcement-learning
|
| 5 |
- agentic-reasoning
|
| 6 |
- math-reasoning
|
| 7 |
- tool-use
|
| 8 |
-
|
| 9 |
-
- en
|
| 10 |
-
- zh
|
| 11 |
-
pipeline_tag: text-generation
|
| 12 |
---
|
|
|
|
| 13 |
# rStar2-Agent-14B: Advanced Agentic Reasoning Model
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
## Model Description
|
| 16 |
|
| 17 |
This is a reproduced version of rStar2-Agent, a 14B parameter math reasoning model that achieves performance comparable to 67B DeepSeek-R1 through pure agentic reinforcement learning. The model excels at planning, reasoning, and autonomously using coding tools to efficiently explore, verify, and reflect for complex problem-solving.
|
| 18 |
|
| 19 |
## Usage
|
| 20 |
|
| 21 |
-
This is an example usage. To reproduce the math evaluation results in technical report, please refer to [@microsoft/rstar](https://github.com/microsoft/
|
| 22 |
|
| 23 |
### 1. Start SGLang Server
|
| 24 |
|
|
@@ -56,7 +61,11 @@ tools = [
|
|
| 56 |
"type": "function",
|
| 57 |
"function": {
|
| 58 |
"name": "execute_python_code_with_standard_io",
|
| 59 |
-
"description": "Execute Python code with standard input and capture standard output.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
"parameters": {
|
| 61 |
"type": "object",
|
| 62 |
"properties": {
|
|
@@ -144,7 +153,8 @@ while True:
|
|
| 144 |
for tool_call in response.choices[0].message.tool_calls:
|
| 145 |
function_args = json.loads(tool_call.function.arguments)
|
| 146 |
|
| 147 |
-
print(f">>> Executing Code:
|
|
|
|
| 148 |
input_text = function_args.get('input', '')
|
| 149 |
print(f">>> With Input: {input_text if input_text else '(no input)'}")
|
| 150 |
|
|
@@ -186,4 +196,4 @@ If you use this model in your research, please cite:
|
|
| 186 |
|
| 187 |
## License
|
| 188 |
|
| 189 |
-
This model is released under the MIT License.
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- zh
|
| 5 |
license: mit
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
tags:
|
| 8 |
- reinforcement-learning
|
| 9 |
- agentic-reasoning
|
| 10 |
- math-reasoning
|
| 11 |
- tool-use
|
| 12 |
+
library_name: transformers
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
+
|
| 15 |
# rStar2-Agent-14B: Advanced Agentic Reasoning Model
|
| 16 |
|
| 17 |
+
This model is part of the research presented in the paper [rStar2-Agent: Agentic Reasoning Technical Report](https://huggingface.co/papers/2508.20722).
|
| 18 |
+
Find the official code and training recipes on the [GitHub repository](https://github.com/microsoft/rStar).
|
| 19 |
+
|
| 20 |
## Model Description
|
| 21 |
|
| 22 |
This is a reproduced version of rStar2-Agent, a 14B parameter math reasoning model that achieves performance comparable to 67B DeepSeek-R1 through pure agentic reinforcement learning. The model excels at planning, reasoning, and autonomously using coding tools to efficiently explore, verify, and reflect for complex problem-solving.
|
| 23 |
|
| 24 |
## Usage
|
| 25 |
|
| 26 |
+
This is an example usage. To reproduce the math evaluation results in technical report, please refer to [@microsoft/rstar](https://github.com/microsoft/rStar).
|
| 27 |
|
| 28 |
### 1. Start SGLang Server
|
| 29 |
|
|
|
|
| 61 |
"type": "function",
|
| 62 |
"function": {
|
| 63 |
"name": "execute_python_code_with_standard_io",
|
| 64 |
+
"description": "Execute Python code with standard input and capture standard output.
|
| 65 |
+
This function takes a Python code string and an input string, provides the input string
|
| 66 |
+
through standard input (stdin) to the code, and captures and returns any output produced
|
| 67 |
+
through standard output (stdout). If the executed code raises an exception, the error
|
| 68 |
+
message will be captured and returned instead.",
|
| 69 |
"parameters": {
|
| 70 |
"type": "object",
|
| 71 |
"properties": {
|
|
|
|
| 153 |
for tool_call in response.choices[0].message.tool_calls:
|
| 154 |
function_args = json.loads(tool_call.function.arguments)
|
| 155 |
|
| 156 |
+
print(f">>> Executing Code:
|
| 157 |
+
{function_args['code']}")
|
| 158 |
input_text = function_args.get('input', '')
|
| 159 |
print(f">>> With Input: {input_text if input_text else '(no input)'}")
|
| 160 |
|
|
|
|
| 196 |
|
| 197 |
## License
|
| 198 |
|
| 199 |
+
This model is released under the MIT License.
|