Instructions to use LittleBitLLM/littlebit-qwen3-4b-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use LittleBitLLM/littlebit-qwen3-4b-mlx-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("LittleBitLLM/littlebit-qwen3-4b-mlx-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use LittleBitLLM/littlebit-qwen3-4b-mlx-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LittleBitLLM/littlebit-qwen3-4b-mlx-4bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "LittleBitLLM/littlebit-qwen3-4b-mlx-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use LittleBitLLM/littlebit-qwen3-4b-mlx-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "LittleBitLLM/littlebit-qwen3-4b-mlx-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "LittleBitLLM/littlebit-qwen3-4b-mlx-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LittleBitLLM/littlebit-qwen3-4b-mlx-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use LittleBitLLM/littlebit-qwen3-4b-mlx-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LittleBitLLM/littlebit-qwen3-4b-mlx-4bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default LittleBitLLM/littlebit-qwen3-4b-mlx-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LittleBitLLM/littlebit-qwen3-4b-mlx-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "LittleBitLLM/littlebit-qwen3-4b-mlx-4bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "LittleBitLLM/littlebit-qwen3-4b-mlx-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
littlebit-qwen3-4b-mlx-4bit
Qwen3-4B in 4-bit MLX format for Apple Silicon. This is the first LittleBit release: a small, fast model for running locally on a Mac.
What this is: standard MLX 4-bit post-training quantization (group size 64, about 4.5 bits per weight). It is not the sub-1-bit LittleBit-2 method. The sub-1-bit (0.55 bpw) Qwen3 builds are in progress; the training recipe is in LittleBitLLM/littlebit.
Measured on an M1 Max (64 GB)
| Value | |
|---|---|
| Size on disk | 2.1 GB (BF16 original: ~8 GB) |
| Bits per weight | 4.5 |
| Generation speed | ~74 tokens/s |
| Peak memory | 2.4 GB |
These numbers come from one short generation run. We have not run benchmark evals on this build. Expect quality close to the BF16 Qwen3-4B, as is usual for 4-bit group quantization.
Usage
pip install mlx-lm
mlx_lm.generate --model LittleBitLLM/littlebit-qwen3-4b-mlx-4bit --prompt "Explain quantization in two sentences."
from mlx_lm import load, generate
model, tokenizer = load("LittleBitLLM/littlebit-qwen3-4b-mlx-4bit")
messages = [{"role": "user", "content": "Explain quantization in two sentences."}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512))
Qwen3 thinks before it answers by default. Add /no_think to a message for a direct answer.
Build
mlx_lm.convert --hf-path Qwen/Qwen3-4B -q --q-bits 4 --q-group-size 64
License
Apache 2.0, inherited from Qwen3-4B by the Qwen team.
surplus-launcher: 0x9370BE7C8Dd5Ba50920a66D977b9c39b839706A2
- Downloads last month
- 206
4-bit
