MLX Models by SirSahOl โ Optimized for Apple Silicon
Collection
Curated collection of high-performance MLX model conversions benchmarked and optimized for Apple Silicon (M1/M2/M3/M4 unified memory). โข 94 items โข Updated
How to use SirSahOl/glm-edge-4b-chat-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("SirSahOl/glm-edge-4b-chat-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 SirSahOl/glm-edge-4b-chat-mlx-4bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "SirSahOl/glm-edge-4b-chat-mlx-4bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "SirSahOl/glm-edge-4b-chat-mlx-4bit"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8080/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SirSahOl/glm-edge-4b-chat-mlx-4bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'This repository contains a 4-bit quantized MLX format compilation of Zhipu AI's GLM-Edge-4B-Chat model. It is optimized for hardware-accelerated local inference on Apple Silicon using the Apple MLX framework.
You can run this model directly using the mlx_lm package.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("SirSahOl/glm-edge-4b-chat-mlx-4bit")
response = generate(model, tokenizer, prompt="Write a Python script to fetch stock prices.", verbose=True)
print(response)
To prevent runway loops and ensure correct conversational turn-taking, you must configure the custom stop strings in your LM Studio preset or inference settings.
Ensure that the following sequences are bound to the inference settings:
<|user|><|observation|><|endoftext|>~/.cache/huggingface/hub/local_models/SirSahOl/.<|user|>, <|observation|>, and <|endoftext|> as strict stop boundaries.4-bit
Base model
zai-org/glm-edge-4b-chat