Text Generation
Transformers
Safetensors
English
Vietnamese
qwen3
function-calling
tool-use
grpo
rl-fine-tuned
conversational
text-generation-inference
Instructions to use contextboxai/Qwen3-1.7B-FC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use contextboxai/Qwen3-1.7B-FC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="contextboxai/Qwen3-1.7B-FC") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("contextboxai/Qwen3-1.7B-FC") model = AutoModelForCausalLM.from_pretrained("contextboxai/Qwen3-1.7B-FC", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use contextboxai/Qwen3-1.7B-FC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "contextboxai/Qwen3-1.7B-FC" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "contextboxai/Qwen3-1.7B-FC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/contextboxai/Qwen3-1.7B-FC
- SGLang
How to use contextboxai/Qwen3-1.7B-FC 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 "contextboxai/Qwen3-1.7B-FC" \ --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": "contextboxai/Qwen3-1.7B-FC", "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 "contextboxai/Qwen3-1.7B-FC" \ --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": "contextboxai/Qwen3-1.7B-FC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use contextboxai/Qwen3-1.7B-FC with Docker Model Runner:
docker model run hf.co/contextboxai/Qwen3-1.7B-FC
Update model card
Browse files
README.md
CHANGED
|
@@ -109,16 +109,19 @@ The model is trained to **refuse appropriately** using diverse negative samples:
|
|
| 109 |
### Two-Stage RLVR Fine-tuning
|
| 110 |
|
| 111 |
|
| 112 |
-
1. **Stage 1**: Accuracy-focused training
|
| 113 |
- Trained from Qwen3-1.7B base
|
| 114 |
-
- Dataset:
|
| 115 |
-
- Reward: Correctness + Format +
|
| 116 |
-
-
|
|
|
|
| 117 |
|
| 118 |
-
2. **Stage 2**: Efficiency optimization
|
| 119 |
-
- Loaded from
|
| 120 |
- Focus: Reduce verbosity, discourage `<think>` tags
|
| 121 |
-
-
|
|
|
|
|
|
|
| 122 |
- **Result**: 36% reduction in response tokens
|
| 123 |
|
| 124 |
### Reward Function Design
|
|
|
|
| 109 |
### Two-Stage RLVR Fine-tuning
|
| 110 |
|
| 111 |
|
| 112 |
+
1. **Stage 1**: Accuracy-focused training (V3)
|
| 113 |
- Trained from Qwen3-1.7B base
|
| 114 |
+
- Dataset: ~40K samples (stage2.parquet)
|
| 115 |
+
- Reward: Correctness (1.0) + Format (0.1) + Efficiency (0.3) + Refusal (0.3)
|
| 116 |
+
- Config: max_steps=5000, LR=5e-7, temp=1.2
|
| 117 |
+
- **Best checkpoint: step 100** (early stopping, highest accuracy)
|
| 118 |
|
| 119 |
+
2. **Stage 2**: Efficiency optimization (V4)
|
| 120 |
+
- Loaded from Stage 1 checkpoint-100
|
| 121 |
- Focus: Reduce verbosity, discourage `<think>` tags
|
| 122 |
+
- Reward weights: Efficiency=1.0, Correctness=0.5, Format=0.1, Refusal=0.3
|
| 123 |
+
- Config: max_steps=3000, LR=2e-7
|
| 124 |
+
- **Selected checkpoint: step 1100**
|
| 125 |
- **Result**: 36% reduction in response tokens
|
| 126 |
|
| 127 |
### Reward Function Design
|