Text Generation
Transformers
Safetensors
English
qwen3
reinforcement-learning
code
pymethods2test
r2egym
rl
rloo-n
terminus-structured
conversational
text-generation-inference
Instructions to use laion/rl_pymethods2test-r2egym_terminus-structured with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use laion/rl_pymethods2test-r2egym_terminus-structured with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="laion/rl_pymethods2test-r2egym_terminus-structured") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("laion/rl_pymethods2test-r2egym_terminus-structured") model = AutoModelForCausalLM.from_pretrained("laion/rl_pymethods2test-r2egym_terminus-structured") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use laion/rl_pymethods2test-r2egym_terminus-structured with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "laion/rl_pymethods2test-r2egym_terminus-structured" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "laion/rl_pymethods2test-r2egym_terminus-structured", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/laion/rl_pymethods2test-r2egym_terminus-structured
- SGLang
How to use laion/rl_pymethods2test-r2egym_terminus-structured 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 "laion/rl_pymethods2test-r2egym_terminus-structured" \ --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": "laion/rl_pymethods2test-r2egym_terminus-structured", "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 "laion/rl_pymethods2test-r2egym_terminus-structured" \ --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": "laion/rl_pymethods2test-r2egym_terminus-structured", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use laion/rl_pymethods2test-r2egym_terminus-structured with Docker Model Runner:
docker model run hf.co/laion/rl_pymethods2test-r2egym_terminus-structured
rl_pymethods2test-r2egym_terminus-structured
RL-trained Qwen3-8B with structured tool calls (terminus-structured agent).
Training Pipeline
SFT (r2egym+nl2bash+swesmith) → RL mixed dataset (37 steps) → RL full r2egym (55 steps) → RL pymethods2test (156 steps, full epoch)
Key Results
- SWEBench-100 pass@3: 37-42% (depending on eval run)
- Pymethods2test pass@8: 91-97%
- SWEBench in-train eval: up to 14 fully solved at various checkpoints
- Training on test-writing (pymethods) maintains code-editing ability (SWEBench)
Training Details
- Base model: laion/r2egym-nl2bash-stack-bugsseq-fixthink-again
- Agent: terminus-structured (bash, view, edit, create, search tools)
- Algorithm: RLOO-N
- Learning rate: 1e-5
- Context: 32k (24k input + 8k output)
- Framework: BenSkyRL + Harbor (JSC HPC)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("laion/rl_pymethods2test-r2egym_terminus-structured")
tokenizer = AutoTokenizer.from_pretrained("laion/rl_pymethods2test-r2egym_terminus-structured")
- Downloads last month
- 32
Model tree for laion/rl_pymethods2test-r2egym_terminus-structured
Base model
Qwen/Qwen3-8B-Base Finetuned
Qwen/Qwen3-8B