Skip to content

Instantly share code, notes, and snippets.

@maujim
Created January 22, 2026 22:20
Show Gist options
  • Select an option

  • Save maujim/cbbc8fae1d6fc74ffea82839168dd819 to your computer and use it in GitHub Desktop.

Select an option

Save maujim/cbbc8fae1d6fc74ffea82839168dd819 to your computer and use it in GitHub Desktop.
#!/usr/bin/env -S uv run --script --with git+https://github.com/ml-explore/mlx-lm@1b76e3d580f35bb5a211d0be1ae414854869fded
# Thu 22 Jan 2026 17:19:31 EST
from mlx_lm import load, generate
model, tokenizer = load("huihui-ai/Huihui-GLM-4.7-Flash-abliterated-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)
print(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment