Instructions to use Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Daniel031203/qwen-4b-thinking-stage2-merged") model = PeftModel.from_pretrained(base_model, "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO") - Transformers
How to use Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO
- SGLang
How to use Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO 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 "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO" \ --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": "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO", "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 "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO" \ --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": "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO with Docker Model Runner:
docker model run hf.co/Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO
Qwen3-4B-Thinking-Agentic-Coding-GSPO
Qwen3-4B, post-trained with GSPO for long-horizon agentic coding. The model learns from multi-turn coding trajectories involving repository inspection, code editing, terminal execution, and test-based verification, with execution-verified terminal rewards assigned at the end of each trajectory.
Model Details
- Foundation model: Qwen/Qwen3-4B-Thinking-2507
- Direct adapter base: Daniel031203/qwen-4b-thinking-stage2-merged
- Post-training framework: AReno
- Training objective: GSPO
- Artifact type: PEFT LoRA adapter
- LoRA configuration: rank 64, alpha 128
Training
The model was post-trained on multi-turn agentic coding trajectories. During each trajectory, the agent can inspect repository contents, search and read source files, apply code changes, execute terminal commands, run tests, and submit a final solution.
A terminal reward is assigned at the end of each trajectory using execution and test outcomes, encouraging the policy to complete coding tasks that are verifiably correct.
Intended Use
This adapter is intended for research and experimentation with:
- Long-horizon coding agents
- Multi-turn repository-level code modification
- Tool-using language models
- Execution-guided reinforcement learning
Usage
This repository contains a PEFT adapter and requires its direct Stage 2 base checkpoint.
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "Daniel031203/qwen-4b-thinking-stage2-merged"
adapter_id = "Daniel031203/Qwen3-4B-Thinking-Agentic-Coding-GSPO"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype="auto",
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
Limitations
- This model is intended for experimental agentic coding workflows and should not be assumed to produce correct or secure code.
- Generated patches and terminal commands should be reviewed and executed in an isolated environment.
- Performance may vary across repositories, programming languages, tool interfaces, and trajectory-length limits.
- Downloads last month
- 41