hello

llama4 돌려보기 (llama.cpp)

Share

rtx4090, rtx3090x2 으로 총 72GB 구성된 환경에서 아래 모델을 돌려봄.

방법은 https://docs.unsloth.ai/basics/tutorial-how-to-run-and-fine-tune-llama-4 참고

unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF/Llama-4-Scout-17B-16E-Instruct-UD-IQ2_XXS.gguf
 ./llama.cpp/llama-cli     --model unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF/Llama-4-Scout-17B-16E-Instruct-UD-IQ2_XXS.gguf     --threads 32     --ctx-size 16384     --n-gpu-layers 99       --seed 3407     --prio 3     --temp 0.6     --min-p 0.01     --top-p 0.9     -no-cnv     --prompt "<|header_start|>user<|header_end|>\n\nCreate a Flappy Bird game in Python. You must include these things:\n1. You must use pygame.\n2. The background color should be randomly chosen and is a light shade. Start with a light blue color.\n3. Pressing SPACE multiple times will accelerate the bird.\n4. The bird's shape should be randomly chosen as a square, circle or triangle. The color should be randomly chosen as a dark color.\n5. Place on the bottom some land colored as dark brown or yellow chosen randomly.\n6. Make a score shown on the top right side. Increment if you pass pipes and don't hit them.\n7. Make randomly spaced pipes with enough space. Color them randomly as dark green or light brown or a dark gray shade.\n8. When you lose, show the best score. Make the text inside the screen. Pressing q or Esc will quit the game. Restarting is pressing SPACE again.\nThe final game should be inside a markdown section in Python. Check your code for errors and fix them before the final markdown section.<|eot|><|header_start|>assistant<|header_end|>\n\n"

성능은

llama_perf_sampler_print:    sampling time =      59.52 ms /  1311 runs   (    0.05 ms per token, 22026.58 tokens per second)
llama_perf_context_print:        load time =   14681.95 ms
llama_perf_context_print: prompt eval time =     189.86 ms /   220 tokens (    0.86 ms per token,  1158.75 tokens per second)
llama_perf_context_print:        eval time =   19427.52 ms /  1090 runs   (   17.82 ms per token,    56.11 tokens per second)
llama_perf_context_print:       total time =   19829.90 ms /  1310 tokens
항목 수치
Sampling time 0.05 ms/token (22,026.58 tokens/s)
Prompt eval time 0.86 ms/token (1,158.75 tokens/s)
Eval time 17.82 ms/token (56.11 tokens/s)
Total time 약 19.8초 (1310 tokens)

이정도면 scout을 쓸만할거 같다.

내침김에 openai 서버로 실행시킴

# 로컬에서 이미 llama.cpp (gpu) 버전으로 빌드 했으니 

export LLAMA_CPP_LIB_PATH=/home/euno/git/llama.cpp/build/bin

git clone https://github.com/abetlen/llama-cpp-python.git
cd llama-cpp-python

CMAKE_ARGS="-DLLAMA_BUILD=OFF" pip install .
python3 -m llama_cpp.server \
  --model ./unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF/Llama-4-Scout-17B-16E-Instruct-UD-IQ2_XXS.gguf \
  --host 0.0.0.0 \
  --port 8000 \
  --n_threads 32 \
  --n_ctx 16384 \
  --n_gpu_layers 99 \
  --seed 3407 \
  --chat_format chatml

같은 옵션이라 gpu 사용량은 같다

Agent도 잘 동작할지 테스트 해보니 문제 없다

온도와 전기세를 보니.... cursor 쓰는게 좋을듯 하다


--2025-04-24 추가--

Maverick도 잘 실행이 된다.

llama_perf_sampler_print:    sampling time =      75.18 ms /  1062 runs   (    0.07 ms per token, 14126.85 tokens per second)
llama_perf_context_print:        load time =   99937.80 ms
llama_perf_context_print: prompt eval time =     903.30 ms /    19 tokens (   47.54 ms per token,    21.03 tokens per second)
llama_perf_context_print:        eval time =   29317.80 ms /  1042 runs   (   28.14 ms per token,    35.54 tokens per second)
llama_perf_context_print:       total time =   30531.93 ms /  1061 tokens


비교

unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF/Llama-4-Scout-17B-16E-Instruct-UD-IQ2_XXS.gguf
unsloth/Llama-4-Maverick-17B-128E-Instruct-GGUF/UD-IQ1_S/Llama-4-Maverick-17B-128E-Instruct-UD-IQ1_S-00001-of-00003.gguf

MetricLLaMA4 ScoutLLaMA4 Maverick
Sampling Time (ms)59.5275.18
Sampling Speed (tokens/sec)22026.5814126.85
Load Time (ms)14681.9599937.80
Prompt Eval Time (ms)189.86903.30
Prompt Eval Speed (tokens/sec)1158.7521.03
Eval Time (ms)19427.5229317.80
Eval Speed (tokens/sec)56.1135.54
Total Time (ms)19829.9030531.93
Total Tokens13101061

LLaMA4 Scout vs Maverick - 성능 비교 요약 (시간 기반)

1. Sampling Time

  • Scout: 59.52ms
  • Maverick: 75.18ms
    🔹 Scout가 더 빠름

2. Load Time

  • Scout: 14,681.95ms
  • Maverick: 99,937.80ms
    🔹 Scout가 압도적으로 빠름

3. Prompt Eval Time

  • Scout: 189.86ms
  • Maverick: 903.30ms
    🔹 Scout가 약 5배 빠름

4. Eval Time

  • Scout: 19,427.52ms
  • Maverick: 29,317.80ms
    🔹 Scout가 빠름

5. Total Time

  • Scout: 19,829.90ms
  • Maverick: 30,531.93ms
    🔹 전체 처리 시간에서도 Scout가 우위

Read more

LLM 시대, 프롬프트 엔지니어링보다 '도메인 전문성'이 더 강력한 무기인 이유

최근 AI 도구들이 비약적으로 발전하면서 '프롬프트 엔지니어링'이라는 기술적 기법에 많은 관심이 쏠렸습니다. 하지만 실제 현업에서 LLM을 극한으로 활용해 고도의 결과물을 만들어내는 사람들의 공통점은 정교한 프롬프트 템플릿을 쓰는 능력이 아니라, 해당 분야에 대한 깊은 '도메인 전문성'을 갖추고 있다는 점입니다. 많은 이들이 LLM이 지식의 격차를 줄여준다고

By JHL

AI 코딩 에이전트 도입 시 고려해야 할 보안 제어 프레임워크: 속도와 안전의 균형 잡기

최근 Claude Code나 Kiro와 같은 AI 코딩 에이전트들이 단순한 코드 완성을 넘어, 자연어 프롬프트 하나로 수십 개의 PR을 생성하고 인프라를 수정하는 수준까지 발전했습니다. 하지만 이러한 생산성 향상은 '기계적 속도'라는 트레이드오프를 동반합니다. AI 에이전트는 조직의 보안 리스크나 컴플라이언스를 이해하지 못한 채 오직 '작업 완료'에만 최적화되어

By JHL

AI 벤치마크의 '포화 상태'와 평가 지표의 유효기간: 우리는 무엇을 믿어야 하는가

최근 LLM의 성능이 비약적으로 상승하면서, 역설적으로 우리가 모델의 성능을 측정하는 '자' 자체가 무용지물이 되는 현상이 가속화되고 있습니다. arXiv에 게재된 "When AI Benchmarks Plateau: A Systematic Study of Benchmark Saturation" 연구는 우리가 흔히 신뢰하는 벤치마크 점수가 왜 더 이상 모델 간의 변별력을 제공하지 못하는지, 그리고 이른바 '

By JHL

AI 에이전트 시대의 엔드포인트 보안: 실행 권한을 넘어 '행위 거버넌스'로

DevOps.com을 통해 Airlock Digital이 발표한 'Agentic AI Control & Governance' 솔루션 소식을 접했습니다. 이번 발표의 핵심은 단순히 '어떤 AI 소프트웨어를 실행할 것인가'라는 기존의 화이트리스트 방식(Application Control)을 넘어, 실행 중인 AI 에이전트가 '실제로 어떤 명령을 내리고 어떻게 행동하는가'를 실시간으로 제어하겠다는

By JHL