Text Generation
Transformers
Safetensors
qwen3
quantized
optimum-quanto
int2
conversational
text-generation-inference
Instructions to use CarlOwOs/Qwen3-0.6B-Base-int2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CarlOwOs/Qwen3-0.6B-Base-int2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CarlOwOs/Qwen3-0.6B-Base-int2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("CarlOwOs/Qwen3-0.6B-Base-int2") model = AutoModelForMultimodalLM.from_pretrained("CarlOwOs/Qwen3-0.6B-Base-int2") 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 CarlOwOs/Qwen3-0.6B-Base-int2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CarlOwOs/Qwen3-0.6B-Base-int2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CarlOwOs/Qwen3-0.6B-Base-int2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CarlOwOs/Qwen3-0.6B-Base-int2
- SGLang
How to use CarlOwOs/Qwen3-0.6B-Base-int2 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 "CarlOwOs/Qwen3-0.6B-Base-int2" \ --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": "CarlOwOs/Qwen3-0.6B-Base-int2", "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 "CarlOwOs/Qwen3-0.6B-Base-int2" \ --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": "CarlOwOs/Qwen3-0.6B-Base-int2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CarlOwOs/Qwen3-0.6B-Base-int2 with Docker Model Runner:
docker model run hf.co/CarlOwOs/Qwen3-0.6B-Base-int2
# Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("CarlOwOs/Qwen3-0.6B-Base-int2")
model = AutoModelForMultimodalLM.from_pretrained("CarlOwOs/Qwen3-0.6B-Base-int2")
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]:]))Quick Links
Qwen3-0.6B-Base Quantized (INT2)
This model is a quantized version of Qwen/Qwen3-0.6B-Base using optimum-quanto with int2 weight quantization.
Model Details
- Base Model: Qwen/Qwen3-0.6B-Base
- Quantization: int2 weights using optimum-quanto
- Library: Transformers + Optimum-Quanto
Usage
You can load and use this quantized model directly:
from transformers import AutoTokenizer, AutoModelForCausalLM
from optimum.quanto import QuantizedModelForCausalLM
# Load tokenizer and model directly
tokenizer = AutoTokenizer.from_pretrained("CarlOwOs/Qwen3-0.6B-Base-int2", trust_remote_code=True)
model = QuantizedModelForCausalLM.from_pretrained("CarlOwOs/Qwen3-0.6B-Base-int2")
# Generate text
inputs = tokenizer("Hello, how are you?", return_tensors="pt")
outputs = model.generate(**inputs, max_length=50, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Alternative Loading Method
# If the direct method doesn't work, try this:
from transformers import AutoTokenizer
from optimum.quanto import QuantizedModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("CarlOwOs/Qwen3-0.6B-Base-int2", trust_remote_code=True)
model = QuantizedModelForCausalLM.from_pretrained("CarlOwOs/Qwen3-0.6B-Base-int2")
# Use the model for inference
inputs = tokenizer("What is the capital of France?", return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_length=100,
do_sample=True,
temperature=0.7,
pad_token_id=tokenizer.eos_token_id
)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_text)
Performance
This quantized model provides significant memory savings compared to the original model:
- Inference Speed: Similar to original model
- Quality: Maintains good performance for most tasks
Technical Details
- Quantization Method: optimum-quanto int2 weight quantization
- Base Model: Qwen/Qwen3-0.6B-Base
- Precision: int2 weights, float16 activations
License
Same as the base model license.
- Downloads last month
- 1
Model tree for CarlOwOs/Qwen3-0.6B-Base-int2
Base model
Qwen/Qwen3-0.6B-Base
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CarlOwOs/Qwen3-0.6B-Base-int2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)