Text Generation
Transformers
OpenVINO
smollm3
int4
quantization
edge-deployment
optimization
conversational
Instructions to use dev-bjoern/smollm3-int4-ov with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dev-bjoern/smollm3-int4-ov with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dev-bjoern/smollm3-int4-ov") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dev-bjoern/smollm3-int4-ov") model = AutoModelForCausalLM.from_pretrained("dev-bjoern/smollm3-int4-ov") 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 dev-bjoern/smollm3-int4-ov with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dev-bjoern/smollm3-int4-ov" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dev-bjoern/smollm3-int4-ov", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dev-bjoern/smollm3-int4-ov
- SGLang
How to use dev-bjoern/smollm3-int4-ov 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 "dev-bjoern/smollm3-int4-ov" \ --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": "dev-bjoern/smollm3-int4-ov", "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 "dev-bjoern/smollm3-int4-ov" \ --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": "dev-bjoern/smollm3-int4-ov", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dev-bjoern/smollm3-int4-ov with Docker Model Runner:
docker model run hf.co/dev-bjoern/smollm3-int4-ov
Update README.md
Browse files
README.md
CHANGED
|
@@ -30,9 +30,9 @@ This is an INT4 quantized version of [SmolLM3-3B](https://huggingface.co/Hugging
|
|
| 30 |
|
| 31 |
## Model Overview
|
| 32 |
|
| 33 |
-
- **Base Model:** SmolLM3-3B
|
| 34 |
- **Quantization:** INT4 via OpenVINO
|
| 35 |
-
- **Size Reduction:**
|
| 36 |
- **Target Hardware:** CPUs, Intel GPUs, NPUs
|
| 37 |
- **Use Cases:** Local inference, edge deployment, resource-constrained environments
|
| 38 |
|
|
@@ -55,10 +55,13 @@ This is an INT4 quantized version of [SmolLM3-3B](https://huggingface.co/Hugging
|
|
| 55 |
|
| 56 |
> ⚠️ **Note:** This is an experimental quantization. Formal benchmarks pending.
|
| 57 |
|
| 58 |
-
Expected
|
| 59 |
-
-
|
| 60 |
-
-
|
| 61 |
-
-
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
## 🛠️ How to Use
|
| 64 |
|
|
@@ -108,8 +111,8 @@ text = tokenizer.apply_chat_template(
|
|
| 108 |
## ⚡ Optimization Tips
|
| 109 |
|
| 110 |
1. **CPU Inference:** Use OpenVINO runtime for best performance
|
| 111 |
-
2. **Batch Processing:**
|
| 112 |
-
3. **Memory:**
|
| 113 |
|
| 114 |
## 🧪 Experimental Status
|
| 115 |
|
|
|
|
| 30 |
|
| 31 |
## Model Overview
|
| 32 |
|
| 33 |
+
- **Base Model:** SmolLM3-3B
|
| 34 |
- **Quantization:** INT4 via OpenVINO
|
| 35 |
+
- **Size Reduction:** Significant compression achieved
|
| 36 |
- **Target Hardware:** CPUs, Intel GPUs, NPUs
|
| 37 |
- **Use Cases:** Local inference, edge deployment, resource-constrained environments
|
| 38 |
|
|
|
|
| 55 |
|
| 56 |
> ⚠️ **Note:** This is an experimental quantization. Formal benchmarks pending.
|
| 57 |
|
| 58 |
+
Expected benefits of INT4 quantization:
|
| 59 |
+
- Reduced model size
|
| 60 |
+
- Faster CPU inference
|
| 61 |
+
- Lower memory requirements
|
| 62 |
+
- Some quality trade-off
|
| 63 |
+
|
| 64 |
+
Actual metrics will be added after proper benchmarking.
|
| 65 |
|
| 66 |
## 🛠️ How to Use
|
| 67 |
|
|
|
|
| 111 |
## ⚡ Optimization Tips
|
| 112 |
|
| 113 |
1. **CPU Inference:** Use OpenVINO runtime for best performance
|
| 114 |
+
2. **Batch Processing:** Consider batching requests when possible
|
| 115 |
+
3. **Memory:** INT4 significantly reduces memory requirements
|
| 116 |
|
| 117 |
## 🧪 Experimental Status
|
| 118 |
|