Text Generation
Transformers
Safetensors
English
qwen3
tool-use
function-calling
agent
reinforcement-learning
conversational
text-generation-inference
Instructions to use ZhexiLu/StateAlign-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ZhexiLu/StateAlign-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ZhexiLu/StateAlign-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ZhexiLu/StateAlign-8B") model = AutoModelForCausalLM.from_pretrained("ZhexiLu/StateAlign-8B", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ZhexiLu/StateAlign-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ZhexiLu/StateAlign-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ZhexiLu/StateAlign-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ZhexiLu/StateAlign-8B
- SGLang
How to use ZhexiLu/StateAlign-8B 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 "ZhexiLu/StateAlign-8B" \ --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": "ZhexiLu/StateAlign-8B", "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 "ZhexiLu/StateAlign-8B" \ --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": "ZhexiLu/StateAlign-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ZhexiLu/StateAlign-8B with Docker Model Runner:
docker model run hf.co/ZhexiLu/StateAlign-8B
Model card: add code link and citation authors
Browse files
README.md
CHANGED
|
@@ -18,6 +18,8 @@ tags:
|
|
| 18 |
StateAlign-8B is a multi-turn tool-use agent trained from [Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) with **StateAlign**, introduced in
|
| 19 |
*StateAlign: Internalizing State-Aware Decision-Making for Reliable Multi-Turn Tool Agents via Reinforcement Learning*.
|
| 20 |
|
|
|
|
|
|
|
| 21 |
A tool agent should decide its next action from the current task state: what information is known or missing, whether the available tools can perform the request, and which parts of the task are already done. StateAlign constructs task states from tool-use trajectories (execute, ask the user, retrieve, decline, stop) and pairs states that differ in one condition. Training combines outcome rewards from interaction with a token-level state-contrastive signal that compares the same generated reasoning and actions under paired states.
|
| 22 |
|
| 23 |
## Results
|
|
@@ -87,10 +89,9 @@ Released under Apache 2.0, following the Qwen3-8B license.
|
|
| 87 |
## Citation
|
| 88 |
|
| 89 |
```bibtex
|
| 90 |
-
@
|
| 91 |
title = {StateAlign: Internalizing State-Aware Decision-Making for Reliable Multi-Turn Tool Agents via Reinforcement Learning},
|
| 92 |
-
author = {
|
| 93 |
-
journal= {arXiv preprint arXiv:TBD},
|
| 94 |
year = {2026}
|
| 95 |
}
|
| 96 |
```
|
|
|
|
| 18 |
StateAlign-8B is a multi-turn tool-use agent trained from [Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) with **StateAlign**, introduced in
|
| 19 |
*StateAlign: Internalizing State-Aware Decision-Making for Reliable Multi-Turn Tool Agents via Reinforcement Learning*.
|
| 20 |
|
| 21 |
+
**Code:** [github.com/ZhexiLu/StateAlign](https://github.com/ZhexiLu/StateAlign) (training code, example data and the BFCL evaluation script).
|
| 22 |
+
|
| 23 |
A tool agent should decide its next action from the current task state: what information is known or missing, whether the available tools can perform the request, and which parts of the task are already done. StateAlign constructs task states from tool-use trajectories (execute, ask the user, retrieve, decline, stop) and pairs states that differ in one condition. Training combines outcome rewards from interaction with a token-level state-contrastive signal that compares the same generated reasoning and actions under paired states.
|
| 24 |
|
| 25 |
## Results
|
|
|
|
| 89 |
## Citation
|
| 90 |
|
| 91 |
```bibtex
|
| 92 |
+
@misc{lu2026statealign,
|
| 93 |
title = {StateAlign: Internalizing State-Aware Decision-Making for Reliable Multi-Turn Tool Agents via Reinforcement Learning},
|
| 94 |
+
author = {Lu, Zhexi and Chaudhury, Subhajit and Pedapati, Tejaswini and Murugesan, Keerthiram and Yu, Lei},
|
|
|
|
| 95 |
year = {2026}
|
| 96 |
}
|
| 97 |
```
|