Skip to content

Instantly share code, notes, and snippets.

@awni
Last active February 8, 2026 19:15
Show Gist options
  • Select an option

  • Save awni/95112d214b7ff6b3fae30a7bb1ec33a9 to your computer and use it in GitHub Desktop.

Select an option

Save awni/95112d214b7ff6b3fae30a7bb1ec33a9 to your computer and use it in GitHub Desktop.
MLX and MLX LM on DGX Spark

To install mlx-lm

pip install mlx-lm[cuda13]

Run generation:

mlx_lm.generate \
  --model mlx-community/Qwen3-4B-Instruct-2507-mxfp8 \
  --prompt "Tell me a story about Einstein" \
  -m 1024 \
  --quantize-activations

LoRA fine-tune:

mlx_lm.lora \
  --model Qwen/Qwen3-4B-Instruct-2507 \
  --data mlx-community/WikiSQL \
  --train
@GamalZilo
Copy link

Awesome, thanks! Struggled with this until I found your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment