본문 바로가기
C.W.K.
Stream
Lesson 04 of 05 · published

GGUF와 MLX 형식

~22 min · gguf, mlx, formats

Level 0Downloader
0 XP0/41 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

GGUF — universal local 형식

GGUF는 llama.cpp 프로젝트에서 나온 single-file 형식이야. .gguf 파일 하나에 weight, tokenizer, metadata가 다 들어가. Local inference de facto 표준인 이유:

  • CUDA (NVIDIA), ROCm/Vulkan (AMD), Metal (Apple Silicon), CPU AVX path 전부 지원.
  • 40+ 모델 아키텍처 지원 (Llama, Qwen, Gemma, Mistral, Phi, DeepSeek 등).
  • Open 모델 대부분 공개 하루 안에 community GGUF 나와.
  • Ollama 내부도 모델을 GGUF blob으로 저장해.

MLX — Apple native 형식

MLX는 Apple의 머신러닝 framework. 모델은 safetensors 파일들 + config.json 디렉토리로 저장돼. Quantization은 fine group quantization을 써서 64 weight마다 scale/bias 하나를 공유하고, kernel은 Apple GPU 전용으로 짜여 있어.

  • Apple Silicon을 보고 만들었고 거기서 제일 빠르지만, 거기서만 도는 건 아니야. pip install mlx[cuda12] (또는 cuda13)로 Linux + NVIDIA용 CUDA 백엔드를 깔 수 있고, mlx[cpu]는 GPU 없는 Linux용이야. AMD/ROCm path는 정말로 없어.
  • HuggingFace의 mlx-community org에 미리 변환된 모델이 3,000개 넘게 올라와 있어.
  • Apple 하드웨어에선 decode throughput은 MLX가 앞서고, prefill latency는 GGUF가 앞서.
  • Ollama도 Apple Silicon용 MLX 엔진이 있어. v0.19에서 preview로 나왔지. 근데 조용히 갈아끼우는 게 아니라 모델별로 켜는 방식이야. MLX로 빌드된 태그(gemma4:31b-mlx, qwen3.5:35b-a3b-coding-nvfp4)를 받아야 하고, preview는 unified memory 32 GB 넘는 Mac을 요구했어. 그냥 태그는 여전히 GGUF야. ollama show gemma4:31b는 format: gguf라고 찍고 -mlx 쪽은 safetensors라고 찍어. 그러니까 형식은 아직 네가 고르는 거야.

다른 형식들

  • Safetensors — full-precision weight를 위한 HuggingFace 표준. vLLM이나 TGI 같은 서버 쪽 engine은 이걸 그대로 읽어. Ollama랑 llama.cpp는 GGUF로 변환해야 하고, MLX는 또 자기 디렉토리 구조를 원해.
  • GGML — GGUF의 전신이야. 2026에 GGML 파일은 받지 마, 이미 deprecated됐어.
  • ONNX — cross-framework runtime 형식. Classical ML에선 흔하고, LLM local-inference 세계에선 잘 안 보여.

Code

이미 받아둔 GGUF 들여다보기·bash
# Ollama는 GGUF blob을 ~/.ollama/models 아래 저장
ls ~/.ollama/models/blobs/ | head

# 설치된 모델 metadata 보기 (architecture, quantization, template)
ollama show qwen2.5:7b
ollama show qwen2.5:7b --modelfile
MLX 형식 모델 직접 실행·bash
# mlx-lm으로 mlx-community HF org의 MLX-format 모델 실행.
# Apple silicon:
pip install -U mlx mlx-lm
# Linux + NVIDIA: pip install -U 'mlx[cuda12]' mlx-lm
# Linux, CPU만: pip install -U 'mlx[cpu]' mlx-lm
mlx_lm.generate \
  --model mlx-community/Qwen2.5-7B-Instruct-4bit \
  --prompt "Explain GGUF in 3 sentences." 

External links

Exercise

ollama show <어떤 모델> 돌려서 model family, parameter size, quantization, prompt template 식별해. 같은 모델에 ollama show --modelfile 돌려서 SYSTEM이랑 TEMPLATE 필드를 노트에 복사해. 나중에 Modelfile 쓸 때 둘 다 필요해.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인 — 댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.