Text Generation
Transformers
Safetensors
English
Chinese
qwen3
chat
function-calling
tool-use
star-method
conversational
text-generation-inference
Instructions to use star-lab/STAR-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use star-lab/STAR-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="star-lab/STAR-4b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("star-lab/STAR-4b") model = AutoModelForCausalLM.from_pretrained("star-lab/STAR-4b") 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 star-lab/STAR-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "star-lab/STAR-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "star-lab/STAR-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/star-lab/STAR-4b
- SGLang
How to use star-lab/STAR-4b 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 "star-lab/STAR-4b" \ --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": "star-lab/STAR-4b", "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 "star-lab/STAR-4b" \ --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": "star-lab/STAR-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use star-lab/STAR-4b with Docker Model Runner:
docker model run hf.co/star-lab/STAR-4b
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,13 +4,12 @@ language:
|
|
| 4 |
- en
|
| 5 |
- zh
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
-
base_model: Qwen/Qwen3-
|
| 8 |
tags:
|
| 9 |
- chat
|
| 10 |
- function-calling
|
| 11 |
- tool-use
|
| 12 |
- star-method
|
| 13 |
-
- sota
|
| 14 |
library_name: transformers
|
| 15 |
---
|
| 16 |
|
|
@@ -18,23 +17,21 @@ library_name: transformers
|
|
| 18 |
|
| 19 |
## Introduction
|
| 20 |
|
| 21 |
-
**STAR-4b** is a highly capable
|
| 22 |
|
| 23 |
-
This model is the result of fine-tuning the `Qwen/Qwen3-
|
| 24 |
|
| 25 |
The key innovations of the STAR framework include:
|
| 26 |
- **Similarity-guided RL (Sim-RL)**: A reinforcement learning mechanism that uses a fine-grained, similarity-based reward signal. This provides a more robust and continuous signal for policy optimization compared to simple binary rewards, which is crucial for complex, multi-solution tasks like function calling.
|
| 27 |
- **Constrained Knowledge Distillation (CKD)**: An advanced training objective that augments top-k forward KL divergence to suppress confidently incorrect predictions. This ensures training stability while preserving the model's exploration capacity, creating a strong foundation for the subsequent RL phase.
|
| 28 |
|
| 29 |
-
Our STAR-4b model significantly outperforms other open models under 1B parameters and even surpasses several larger models, demonstrating the effectiveness of the STAR methodology.
|
| 30 |
-
|
| 31 |
## Model Details
|
| 32 |
|
| 33 |
- **Model Type**: Causal Language Model, fine-tuned for function calling.
|
| 34 |
-
- **Base Model**: `Qwen/Qwen3-
|
| 35 |
- **Training Framework**: STAR (CKD + Sim-RL)
|
| 36 |
- **Architecture**: Transformer with RoPE, SwiGLU, RMSNorm, and Attention QKV bias.
|
| 37 |
-
- **Number of Parameters**: ~
|
| 38 |
- **Context Length**: Supports up to 32,768 tokens.
|
| 39 |
|
| 40 |
## Requirements
|
|
@@ -100,7 +97,7 @@ For local use, applications such as Ollama, LMStudio, MLX-LM, llama.cpp, and KTr
|
|
| 100 |
|
| 101 |
## Evaluation & Performance
|
| 102 |
|
| 103 |
-
STAR-4b has achieved outstanding performance
|
| 104 |
|
| 105 |
- BFCLv3: Achieved 65.24% overall accuracy.
|
| 106 |
- ACEBench: Achieved 74.10% summary score, demonstrating superior generalization and robustness.
|
|
|
|
| 4 |
- en
|
| 5 |
- zh
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
+
base_model: Qwen/Qwen3-4B
|
| 8 |
tags:
|
| 9 |
- chat
|
| 10 |
- function-calling
|
| 11 |
- tool-use
|
| 12 |
- star-method
|
|
|
|
| 13 |
library_name: transformers
|
| 14 |
---
|
| 15 |
|
|
|
|
| 17 |
|
| 18 |
## Introduction
|
| 19 |
|
| 20 |
+
**STAR-4b** is a highly capable 4B parameter language model specialized in function calling.
|
| 21 |
|
| 22 |
+
This model is the result of fine-tuning the `Qwen/Qwen3-4B` base model using the novel **STAR (Similarity-guided Teacher-Assisted Refinement)** framework. STAR is a holistic training curriculum designed to effectively transfer the advanced capabilities of large language models (LLMs) into "super-tiny" models, making them powerful, accessible, and efficient for real-world agentic applications.
|
| 23 |
|
| 24 |
The key innovations of the STAR framework include:
|
| 25 |
- **Similarity-guided RL (Sim-RL)**: A reinforcement learning mechanism that uses a fine-grained, similarity-based reward signal. This provides a more robust and continuous signal for policy optimization compared to simple binary rewards, which is crucial for complex, multi-solution tasks like function calling.
|
| 26 |
- **Constrained Knowledge Distillation (CKD)**: An advanced training objective that augments top-k forward KL divergence to suppress confidently incorrect predictions. This ensures training stability while preserving the model's exploration capacity, creating a strong foundation for the subsequent RL phase.
|
| 27 |
|
|
|
|
|
|
|
| 28 |
## Model Details
|
| 29 |
|
| 30 |
- **Model Type**: Causal Language Model, fine-tuned for function calling.
|
| 31 |
+
- **Base Model**: `Qwen/Qwen3-4B`
|
| 32 |
- **Training Framework**: STAR (CKD + Sim-RL)
|
| 33 |
- **Architecture**: Transformer with RoPE, SwiGLU, RMSNorm, and Attention QKV bias.
|
| 34 |
+
- **Number of Parameters**: ~4B
|
| 35 |
- **Context Length**: Supports up to 32,768 tokens.
|
| 36 |
|
| 37 |
## Requirements
|
|
|
|
| 97 |
|
| 98 |
## Evaluation & Performance
|
| 99 |
|
| 100 |
+
STAR-4b has achieved outstanding performance on renowned function calling benchmarks.
|
| 101 |
|
| 102 |
- BFCLv3: Achieved 65.24% overall accuracy.
|
| 103 |
- ACEBench: Achieved 74.10% summary score, demonstrating superior generalization and robustness.
|