Skip to content

Instantly share code, notes, and snippets.

@awni
Last active January 14, 2026 05:59
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

pip install mlx[cuda13]

Then install mlx-lm:

pip install mlx-lm

Run generation:

mlx_lm.generate --model Qwen/Qwen3-4B-Instruct-2507 --prompt "Tell me a story about Einstein"

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