Agent-rc
Collection
Agent research, tool calling and ReAct • 3 items • Updated
How to use beyoru/Qwen3-4B-I-1209 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="beyoru/Qwen3-4B-I-1209")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("beyoru/Qwen3-4B-I-1209")
model = AutoModelForCausalLM.from_pretrained("beyoru/Qwen3-4B-I-1209")
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]:]))How to use beyoru/Qwen3-4B-I-1209 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "beyoru/Qwen3-4B-I-1209"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "beyoru/Qwen3-4B-I-1209",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/beyoru/Qwen3-4B-I-1209
How to use beyoru/Qwen3-4B-I-1209 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "beyoru/Qwen3-4B-I-1209" \
--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": "beyoru/Qwen3-4B-I-1209",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "beyoru/Qwen3-4B-I-1209" \
--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": "beyoru/Qwen3-4B-I-1209",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use beyoru/Qwen3-4B-I-1209 with Docker Model Runner:
docker model run hf.co/beyoru/Qwen3-4B-I-1209
Fine-tuned variant of Qwen3-4B-Instruct-2507, optimized for tool-use and function call generation via reinforcement learning with composite reward signals.
| Base Model | Qwen/Qwen3-4B-Instruct-2507 |
| Training Method | GRPO (Group Relative Policy Optimization) |
| Specialization | Tool-use, function calling |
| License | Apache 2.0 |
The model is trained with three complementary reward functions:
| Parameter | Value |
|---|---|
| Optimizer | AdamW |
| Learning rate | 5e-6 |
| Scheduler | Cosine with min LR (min_lr_rate=0.1) |
| Generations per prompt | 4 |
| Model | Overall Accuracy |
|---|---|
| Qwen3-4B-I-1209 (this model) | 0.7233 |
| Qwen3-4B-Instruct-2507 (base) | 0.6350 |
| Salesforce/Llama-xLAM-2-8b-fc-r | 0.5792 |
Additional benchmark results will be added as evaluation continues.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("beyoru/Qwen3-4B-I-1209")
tokenizer = AutoTokenizer.from_pretrained("beyoru/Qwen3-4B-I-1209")
Feedback on model quality, edge cases, and real-world performance is welcome. Open an issue or reach out via the links below.
@misc{qwen3-4b-i-1209,
title = {Qwen3-4B-I-1209: Fine-tuned Qwen3-4B-Instruct with GRPO for Tool-Use and Function Calling},
author = {Beyoru},
year = {2025},
howpublished = {\url{https://huggingface.co/beyoru/Qwen3-4B-I-1209}}
}
Unable to build the model tree, the base model loops to the model itself. Learn more.