nvidia/Nemotron-Instruction-Following-Chat-v1
Viewer • Updated • 288k • 1.08k • 130
How to use Bbson/gemma-3-4B-T1-it-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("Bbson/gemma-3-4B-T1-it-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)How to use Bbson/gemma-3-4B-T1-it-MLX-4bit with Pi:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Bbson/gemma-3-4B-T1-it-MLX-4bit"
# Install Pi:
npm install -g @mariozechner/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
"providers": {
"mlx-lm": {
"baseUrl": "http://localhost:8080/v1",
"api": "openai-completions",
"apiKey": "none",
"models": [
{
"id": "Bbson/gemma-3-4B-T1-it-MLX-4bit"
}
]
}
}
}# Start Pi in your project directory: pi
How to use Bbson/gemma-3-4B-T1-it-MLX-4bit with Hermes Agent:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Bbson/gemma-3-4B-T1-it-MLX-4bit"
# 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 Bbson/gemma-3-4B-T1-it-MLX-4bit
hermes
How to use Bbson/gemma-3-4B-T1-it-MLX-4bit with OpenClaw:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Bbson/gemma-3-4B-T1-it-MLX-4bit"
# 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 "Bbson/gemma-3-4B-T1-it-MLX-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
openclaw agent --local --agent main --message "Hello from Hugging Face"
How to use Bbson/gemma-3-4B-T1-it-MLX-4bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Bbson/gemma-3-4B-T1-it-MLX-4bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "Bbson/gemma-3-4B-T1-it-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": "Bbson/gemma-3-4B-T1-it-MLX-4bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'⚠️ 草稿(task-B02)。上傳前需回填:實測 benchmark 數據、權重大小。
本模型是 Twinkle AI gemma-3-4B-T1-it
(以 google/gemma-3-4b-pt 為底、聚焦繁體中文與台灣人文社會脈絡的指令微調)的
MLX 4-bit 量化版,透過 mlx-lm 轉換,供 Apple Silicon
裝置(iPhone / iPad / Mac)端側推論使用。原模型支援繁體中文與英文,涵蓋法律、教育、對話等台灣情境應用。
from mlx_lm import load, generate
model, tokenizer = load("Bbson/gemma-3-4B-T1-it-MLX-4bit")
prompt = "請用三句話介紹台灣夜市文化,並推薦三樣必吃小吃。"
# system prompt 為選用(原模型無強制慣例)。建議台灣情境定調:
# 你是台灣的 AI 助理,請一律使用繁體中文與台灣用語回答。
# 官方建議 sampling:temperature 0.6, top_p 0.95
print(generate(model, tokenizer, prompt=prompt, max_tokens=256))
| 項目 | 值 |
|---|---|
| 來源 | twinkle-ai/gemma-3-4B-T1-it(官方權重) |
| 方法 | mlx_lm.convert -q --q-bits 4 --q-group-size 64 |
| 位元 | 4-bit |
| 約權重大小 | ~2.5 GB(待實測回填) |
用固定繁中 prompt 集(Little Star docs/benchmark/zh-tw-prompt-set.md)與 GGUF Q4_K_M 版對照,
繁體用字與台灣語境品質 [達標 / 待回填實測]。
| 裝置 | 載入時間 | TTFT | decode t/s | 峰值記憶體 |
|---|---|---|---|---|
| iPhone 17 Pro | 待回填 | 待回填 | 待回填 | 待回填 |
沿用 Gemma 授權條款,並遵循 Twinkle AI 原模型授權。使用前請閱讀 Gemma Terms of Use。
gemma-3-4B-T1-it)4-bit