C.W.K.
Stream
Lesson 05 of 10 · published

Open-source 모델 — Llama, Qwen, Mistral

~14 min · providers, oss

Level 0수련생
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

왜 open-source 중요

  • Cost — 24/7 너의 own hardware로 돌리면 scale에 cheaper.
  • Privacy — 데이터가 너의 environment 안 떠남.
  • Customization — fine-tuning, structured-output post-training, custom tokenizer.
  • Air-gapped deployment — regulated industry.
  • Latency — local inference가 network call보다 훨씬 빠를 수 있어.

알 quirk

  • Capability spread 넓어 — 70B Llama가 7B Mistral이랑 같지 X. 너의 실제 task에 테스트.
  • Tool calling이 application layer에 implement (보통 templated prompt와 parser로), dedicated API 아니야.
  • JSON output enforcement에 constrained decoding (Outlines, jsonformer) 또는 post-validation 필요.
  • Context window가 모델과 quant에 sharply 다양 — 가정 X.
  • Tokenizer가 보통 모델 family별 unique; cost 계산이 FLOP / time 사용, dollar당 토큰 X.

Infrastructure piece

Open-source 의미 너도 own: serving (vLLM, llama.cpp, MLX), GPU/CPU/MPS provisioning, model update, observability. Free model 아니라 추가 system으로 다뤄. cwkPippa의 Ollama vessel이 이 코드베이스의 local-inference 예시.

Code

Ollama 통한 local Llama·python
import ollama

resp = ollama.chat(
    model="llama4",
    messages=[{"role": "user", "content": question}],
    options={"temperature": 0.2, "num_predict": 1024},
    format="json",  # constrained decoding to JSON
)
Apple Silicon에 MLX·python
from mlx_lm import load, generate

model, tokenizer = load("mlx-community/Qwen3-7B-MLX")
out = generate(model, tokenizer, prompt=question, max_tokens=1024)

External links

Exercise

같은 prompt를 closed-source 모델과 너의 own hardware의 비슷한 open-source 모델에 돌려. output, latency, total cost (ops 포함) 비교.

Progress

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

댓글 0

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

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