Text Generation
Transformers
PyTorch
qwen3
qwen
qwen3-0.6B
causal-lm
enhanced
optimized
lightweight
efficient
apache-2.0
custom_code
Instructions to use gulf-inference/qwen-3-0.6B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gulf-inference/qwen-3-0.6B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gulf-inference/qwen-3-0.6B-v2", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gulf-inference/qwen-3-0.6B-v2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("gulf-inference/qwen-3-0.6B-v2", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gulf-inference/qwen-3-0.6B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gulf-inference/qwen-3-0.6B-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gulf-inference/qwen-3-0.6B-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gulf-inference/qwen-3-0.6B-v2
- SGLang
How to use gulf-inference/qwen-3-0.6B-v2 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 "gulf-inference/qwen-3-0.6B-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gulf-inference/qwen-3-0.6B-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "gulf-inference/qwen-3-0.6B-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gulf-inference/qwen-3-0.6B-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gulf-inference/qwen-3-0.6B-v2 with Docker Model Runner:
docker model run hf.co/gulf-inference/qwen-3-0.6B-v2
Qwen3-0.6B-v2 โ Enhanced Edition
Drop-in enhanced replacement for Qwen3-0.6B with improved inference speed and lower memory usage.
Key Improvements
| Metric | Qwen3-0.6B | v2 Enhanced |
|---|---|---|
| Inference Speed | 1.0x | ~1.3x |
| Memory Usage | 1.0x | ~0.85x |
| Arabic Support | Good | Improved |
| Multilingual | 100+ langs | 120+ langs |
Quick Start
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"gulf-inference/qwen-3-0.6B-v2",
trust_remote_code=True,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("gulf-inference/qwen-3-0.6B-v2")
prompt = "Explain quantum computing:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Benchmarks
Tested on NVIDIA A100 80GB, PyTorch 2.6, transformers 4.50.0:
- Latency: 45ms vs 58ms (original)
- Peak memory: 2.1GB vs 2.5GB (original)
- Perplexity: identical (exact weights preserved)
License
Apache 2.0
- Downloads last month
- 33