Instructions to use mlx-community/SmolLM3-3B-Base-3bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/SmolLM3-3B-Base-3bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/SmolLM3-3B-Base-3bit") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Transformers.js
How to use mlx-community/SmolLM3-3B-Base-3bit with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'mlx-community/SmolLM3-3B-Base-3bit'); - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- MLX LM
How to use mlx-community/SmolLM3-3B-Base-3bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "mlx-community/SmolLM3-3B-Base-3bit" --prompt "Once upon a time"
| { | |
| "architectures": [ | |
| "SmolLM3ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": null, | |
| "eos_token_id": 128001, | |
| "hidden_act": "silu", | |
| "hidden_size": 2048, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 11008, | |
| "max_position_embeddings": 65536, | |
| "model_type": "smollm3", | |
| "no_rope_layer_interval": 4, | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 36, | |
| "num_key_value_heads": 4, | |
| "pad_token_id": 128004, | |
| "pretraining_tp": 2, | |
| "quantization": { | |
| "group_size": 64, | |
| "bits": 3 | |
| }, | |
| "quantization_config": { | |
| "group_size": 64, | |
| "bits": 3 | |
| }, | |
| "rms_norm_eps": 1e-06, | |
| "rope_scaling": null, | |
| "rope_theta": 5000000.0, | |
| "sliding_window": null, | |
| "tie_word_embeddings": true, | |
| "torch_dtype": "bfloat16", | |
| "transformers.js_config": { | |
| "use_external_data_format": true, | |
| "dtype": "q4", | |
| "kv_cache_dtype": { | |
| "q4f16": "float16", | |
| "fp16": "float16" | |
| } | |
| }, | |
| "transformers_version": "4.53.0.dev0", | |
| "use_cache": true, | |
| "use_sliding_window": false, | |
| "vocab_size": 128256 | |
| } |