Text Generation
MLX
Safetensors
English
Chinese
gemma3_text
Taiwan
R.O.C
zhtw
SLM
Gemma-3
gemma3
conversational
Eval Results (legacy)
4-bit precision
Instructions to use SpockH/gemma-3-4B-T1-it-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use SpockH/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("SpockH/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) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use SpockH/gemma-3-4B-T1-it-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 "SpockH/gemma-3-4B-T1-it-mlx-4bit"
Configure the model in Pi
# 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": "SpockH/gemma-3-4B-T1-it-mlx-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use SpockH/gemma-3-4B-T1-it-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 "SpockH/gemma-3-4B-T1-it-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 SpockH/gemma-3-4B-T1-it-mlx-4bit
Run Hermes
hermes
- MLX LM
How to use SpockH/gemma-3-4B-T1-it-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 "SpockH/gemma-3-4B-T1-it-mlx-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "SpockH/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": "SpockH/gemma-3-4B-T1-it-mlx-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
metadata
license: gemma
language:
- en
- zh
base_model: twinkle-ai/gemma-3-4B-T1-it
library_name: mlx
tags:
- Taiwan
- R.O.C
- zhtw
- SLM
- Gemma-3
- gemma3
- mlx
datasets:
- lianghsun/tw-reasoning-instruct
- lianghsun/tw-contract-review-chat
- minyichen/tw-instruct-R1-200k
- minyichen/tw_mm_R1
- minyichen/LongPaper_multitask_zh_tw_R1
- nvidia/Nemotron-Instruction-Following-Chat-v1
metrics:
- accuracy
pipeline_tag: text-generation
model-index:
- name: gemma-3-4B-T1-it
results:
- task:
type: question-answering
name: Single Choice Question
dataset:
name: tmmlu+
type: ikala/tmmluplus
config: all
split: test
revision: c0e8ae955997300d5dbf0e382bf0ba5115f85e8c
metrics:
- type: accuracy
value: 47.44
name: single choice
- task:
type: question-answering
name: Single Choice Question
dataset:
name: mmlu
type: cais/mmlu
config: all
split: test
revision: c30699e
metrics:
- type: accuracy
value: 59.13
name: single choice
- task:
type: question-answering
name: Single Choice Question
dataset:
name: tw-legal-benchmark-v1
type: lianghsun/tw-legal-benchmark-v1
config: all
split: test
revision: 66c3a5f
metrics:
- type: accuracy
value: 44.18
name: single choice
SpockH/gemma-3-4B-T1-it-mlx-4bit
This model SpockH/gemma-3-4B-T1-it-mlx-4bit was converted to MLX format from twinkle-ai/gemma-3-4B-T1-it using mlx-lm version 0.29.1.
Use with mlx
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("SpockH/gemma-3-4B-T1-it-mlx-4bit")
prompt = "hello"
if tokenizer.chat_template is not None:
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, verbose=True)