GLM-4.7-Flash

GLM-4.7-Flash

GLM-4.7-Flash는 Zhipu AI가 개발한 GLM-4.7 시리즈의 경량·고속 모델로, 추론·함수 호출·효율적인 로컬 배포에서 최상급 성능을 자랑해요. GLM-4.7 계열에서 컴팩트한 변형 모델로, 성능과 효율의 균형을 맞추도록 설계된 30B-A3B MoE 모델이에요.

총 30B 파라미터 중 활성 파라미터가 3B뿐이라 추론이 매우 가볍고, GLM-4.7에서 이어받은 강력한 추론 능력과 우수한 코딩·도구 사용 능력을 갖췄어요. 단일 GPU에 최적화되어 있어 로컬 배포 시나리오에 특히 잘 맞는 모델이에요.

이 문서는 SGLang으로 GLM-4.7-Flash를 배포하고, 추론 파서나 함수 호출 같은 고급 기능을 사용하는 방법을 설명해요.

출처: 문서

본문

1. 모델 소개

GLM-4.7-Flash는 Zhipu AI가 개발한 GLM-4.7 시리즈의 경량·고속 모델로, 추론·함수 호출·효율적인 로컬 배포에서 최상급 성능을 갖추고 있어요.

GLM-4.7 시리즈의 컴팩트 변형 모델인 GLM-4.7-Flash는 성능과 효율의 균형을 맞추도록 설계된 30B-A3B MoE 모델이에요:

  • 경량 아키텍처: 총 30B 파라미터 중 활성 파라미터는 3B뿐이라 효율적인 추론이 가능해요
  • 강화된 추론: GLM-4.7의 추론 능력을 이어받아 최적화된 성능을 제공해요
  • 뛰어난 코딩: 강력한 코드 생성·이해 능력을 갖추고 있어요
  • 고급 도구 사용: 복잡한 워크플로를 위한 견고한 함수 호출·에이전트 능력을 제공해요
  • 로컬 배포에 최적화: 단일 GPU 배포 시나리오를 염두에 두고 설계되었어요

자세한 내용은 공식 GLM-4.7 문서를 참고하세요.

주요 특징:

  • 효율적인 MoE 아키텍처: 최적의 성능/효율 트레이드오프를 위한 30B-A3B 희소 활성화 구조
  • 여러 양자화 형식: 서로 다른 성능/메모리 트레이드오프를 위한 BF16, FP8 변형 제공
  • 하드웨어 최적화: NVIDIA H100/H200/B200 GPU에 특별히 튜닝됨
  • 고성능: 처리량과 지연 시간 시나리오 모두에 최적화

제공 모델:

라이선스:

라이선스 세부사항은 공식 GLM-4.7-Flash 모델 카드를 참고하세요.

2. SGLang 설치

SGLang은 여러 설치 방법을 제공해요. 하드웨어 플랫폼과 요구사항에 맞는 설치 방법을 선택하면 돼요.

설치 안내는 공식 SGLang 설치 가이드를 참고하세요.

3. 모델 배포

이 섹션에서는 하드웨어 플랫폼과 사용 사례에 맞게 최적화된 배포 구성을 제공해요.

3.1 기본 구성

대화형 명령 생성기: 아래 구성 선택기를 사용하면 하드웨어 플랫폼·양자화 방법·배포 전략·추론(Thinking) 기능에 맞는 배포 명령을 자동으로 생성할 수 있어요.

원문 페이지에는 하드웨어 플랫폼, 양자화 방법, 배포 전략(TP/DP/MTP), 추론 기능, 함수 호출 파서 등을 골라 실행할 배포 명령어를 자동으로 만들어 주는 대화형 선택기가 포함되어 있어요. 위키에서는 렌더링되지 않으니, 아래 섹션의 명령어를 직접 참고하면 돼요.

3.2 구성 팁

  • EAGLE 추측 디코딩: GLM-4.7-Flash를 지원해요. --speculative-algorithm EAGLE --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4 플래그를 추가하세요. spec-v2 중첩 스케줄러는 기본적으로 활성화되어 있으며, 비활성화하려면 --disable-overlap-schedule을 전달하세요.

4. 모델 호출

4.1 기본 사용법

기본 API 사용법과 요청 예시는 아래를 참고하세요:

4.2 고급 사용법

4.2.1 추론(Reasoning) 파서

GLM-4.7-Flash는 기본적으로 Thinking 모드를 지원해요. 배포 시 추론 파서를 활성화하면 thinking 영역과 content 영역을 분리할 수 있어요:

python -m sglang.launch_server \
  --model zai-org/GLM-4.7-Flash \
  --reasoning-parser glm45 \
  --attention-backend triton \
  --tp 1 \
  --host 0.0.0.0 \
  --port 8000

Thinking 과정과 함께 스트리밍하기:

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="EMPTY"
)

# Enable streaming to see the thinking process in real-time
response = client.chat.completions.create(
    model="zai-org/GLM-4.7-Flash",
    messages=[
        {"role": "user", "content": "Solve this problem step by step: What is 15% of 240?"}
    ],
    temperature=0.7,
    max_tokens=2048,
    stream=True
)

# Process the stream
has_thinking = False
has_answer = False
thinking_started = False

for chunk in response:
    if chunk.choices and len(chunk.choices) > 0:
        delta = chunk.choices[0].delta

        # Print thinking process
        if hasattr(delta, 'reasoning_content') and delta.reasoning_content:
            if not thinking_started:
                print("=============== Thinking =================", flush=True)
                thinking_started = True
            has_thinking = True
            print(delta.reasoning_content, end="", flush=True)

        # Print answer content
        if delta.content:
            # Close thinking section and add content header
            if has_thinking and not has_answer:
                print("\n=============== Content =================", flush=True)
                has_answer = True
            print(delta.content, end="", flush=True)

print()

출력 예시:

=============== Thinking =================
To solve this problem, I need to calculate 15% of 240.
Step 1: Convert 15% to decimal: 15% = 0.15
Step 2: Multiply 240 by 0.15
Step 3: 240 × 0.15 = 36
=============== Content =================

The answer is 36. To find 15% of 240, we multiply 240 by 0.15, which equals 36.

참고: 추론 파서는 모델의 단계별 사고 과정을 캡처해서, 모델이 결론에 도달하는 방식을 볼 수 있게 해줘요.

4.2.2 함수 호출(Tool Calling)

**모델별 파서 이름:** GLM-4.5와 GLM-4.6은 `--tool-call-parser glm45`을 사용해요. GLM-4.7과 GLM-4.7-Flash는 `--tool-call-parser glm47`을 사용해요. 모든 GLM 모델은 세대와 무관하게 `--reasoning-parser glm45`를 사용해요.

GLM-4.7-Flash는 함수 호출 기능을 지원해요. 함수 호출 파서를 활성화하세요:

python -m sglang.launch_server \
  --model zai-org/GLM-4.7-Flash \
  --reasoning-parser glm45 \
  --tool-call-parser glm47 \
  --attention-backend triton \
  --tp 1 \
  --host 0.0.0.0 \
  --port 8000

Python 예시 (Thinking 과정 포함):

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="EMPTY"
)

# Define available tools
tools = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",
            "description": "Get the current weather for a location",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city name"
                    },
                    "unit": {
                        "type": "string",
                        "enum": ["celsius", "fahrenheit"],
                        "description": "Temperature unit"
                    }
                },
                "required": ["location"]
            }
        }
    }
]

# Make request with streaming to see thinking process
response = client.chat.completions.create(
    model="zai-org/GLM-4.7-Flash",
    messages=[
        {"role": "user", "content": "What's the weather in Beijing?"}
    ],
    tools=tools,
    temperature=0.7,
    stream=True
)

# Process streaming response
thinking_started = False
has_thinking = False
tool_calls_accumulator = {}

for chunk in response:
    if chunk.choices and len(chunk.choices) > 0:
        delta = chunk.choices[0].delta

        # Print thinking process
        if hasattr(delta, 'reasoning_content') and delta.reasoning_content:
            if not thinking_started:
                print("=============== Thinking =================", flush=True)
                thinking_started = True
            has_thinking = True
            print(delta.reasoning_content, end="", flush=True)

        # Accumulate tool calls (tool call deltas may stream in multiple chunks)
        if hasattr(delta, 'tool_calls') and delta.tool_calls:
            for tool_call in delta.tool_calls:
                index = tool_call.index
                if index not in tool_calls_accumulator:
                    tool_calls_accumulator[index] = {
                        'name': None,
                        'arguments': ''
                    }

                if tool_call.function:
                    if tool_call.function.name:
                        tool_calls_accumulator[index]['name'] = tool_call.function.name
                    if tool_call.function.arguments:
                        tool_calls_accumulator[index]['arguments'] += tool_call.function.arguments

        # Print content
        if delta.content:
            print(delta.content, end="", flush=True)

# Print accumulated tool calls
if tool_calls_accumulator:
    print("\n=============== Tool Calls =================", flush=True)
    for index, tool_call in sorted(tool_calls_accumulator.items()):
        print(f"Tool Call: {tool_call['name']}")
        print(f"   Arguments: {tool_call['arguments']}")

print()

출력 예시:

=============== Thinking =================
The user is asking for the weather in Beijing. I have the get_weather function available which can provide weather information for a location. The required parameter is "location" and the
 user has provided "Beijing". There's an optional parameter "unit" for temperature unit, but the user hasn't specified which unit they prefer, and since it's optional, I should not ask about it or make up a value for it. I'll call the function with just the location parameter.I'll check the current weather in Beijing for you.
=============== Tool Calls =================
Tool Call: get_weather
   Arguments: {"location": "Beijing"}

참고:

  • 추론 파서는 모델이 어떻게 도구를 사용할지 결정하는지를 보여줘요
  • 함수 호출은 함수 이름과 인자로 명확하게 표시돼요
  • 이후 함수를 실행하고 결과를 다시 보내 대화를 이어갈 수 있어요

함수 호출 결과 처리하기:

# After getting the tool call, execute the function
def get_weather(location, unit="celsius"):
    # Your actual weather API call here
    return f"The weather in {location} is 22°{unit[0].upper()} and sunny."

# Send tool result back to the model
messages = [
    {"role": "user", "content": "What's the weather in Beijing?"},
    {
        "role": "assistant",
        "content": None,
        "tool_calls": [{
            "id": "call_123",
            "type": "function",
            "function": {
                "name": "get_weather",
                "arguments": '{"location": "Beijing", "unit": "celsius"}'
            }
        }]
    },
    {
        "role": "tool",
        "tool_call_id": "call_123",
        "content": get_weather("Beijing", "celsius")
    }
]

final_response = client.chat.completions.create(
    model="zai-org/GLM-4.7-Flash",
    messages=messages,
    temperature=0.7
)

print(final_response.choices[0].message.content)
# Output: "The weather in Beijing is currently 22°C and sunny."

5. 벤치마크

이 섹션은 비교 가능한 벤치마크 결과를 위해 업계 표준 구성을 사용해요.

5.1 속도 벤치마크

테스트 환경:

  • 하드웨어: NVIDIA B200 (1x)
  • 모델: GLM-4.7-Flash
  • 텐서 병렬화: 1
  • SGLang 버전: 0.5.7

벤치마크 방법론:

프레임워크와 하드웨어 플랫폼 간 결과를 비교할 수 있도록 업계 표준 벤치마크 구성을 사용해요.

5.1.1 표준 테스트 시나리오

세 가지 핵심 시나리오는 실제 사용 패턴을 반영해요:

시나리오 입력 길이 출력 길이 사용 사례
Chat 1K 1K 가장 흔한 대화형 AI 워크로드
Reasoning 1K 8K 장문 생성, 복잡한 추론 작업
Summarization 8K 1K 문서 요약, RAG 검색

5.1.2 동시성 수준

처리량과 지연 시간의 트레이드오프(Pareto frontier)를 파악하기 위해 각 시나리오를 세 가지 동시성 수준에서 테스트해요:

  • 낮은 동시성: --max-concurrency 1 (지연 시간 최적화)
  • 중간 동시성: --max-concurrency 16 (균형)
  • 높은 동시성: --max-concurrency 100 (처리량 최적화)

5.1.3 프롬프트 수

각 동시성 수준에서 num_prompts를 설정해 실제 사용자 부하를 시뮬레이션해요:

  • 빠른 테스트: num_prompts = concurrency × 1 (최소 테스트)
  • 권장: num_prompts = concurrency × 5 (표준 벤치마크)
  • 안정적 측정: num_prompts = concurrency × 10 (프로덕션급)

5.1.4 벤치마크 명령

시나리오 1: Chat (1K/1K) - 가장 중요

  • 모델 배포
python -m sglang.launch_server \
  --model zai-org/GLM-4.7-Flash \
  --attention-backend triton \
  --tp 1
  • 낮은 동시성 (지연 시간 최적화)
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 1000 \
  --random-output-len 1000 \
  --num-prompts 10 \
  --max-concurrency 1 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 1
Successful requests:                     10
Benchmark duration (s):                  38.94
Total input tokens:                      6101
Total input text tokens:                 6101
Total generated tokens:                  4220
Total generated tokens (retokenized):    4220
Request throughput (req/s):              0.26
Input token throughput (tok/s):          156.67
Output token throughput (tok/s):         108.37
Peak output token throughput (tok/s):    125.00
Peak concurrent requests:                2
Total token throughput (tok/s):          265.03
Concurrency:                             1.00
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   3891.12
Median E2E Latency (ms):                 3061.48
P90 E2E Latency (ms):                    7172.25
P99 E2E Latency (ms):                    9042.62
---------------Time to First Token----------------
Mean TTFT (ms):                          131.36
Median TTFT (ms):                        94.55
P99 TTFT (ms):                           435.93
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          8.75
Median TPOT (ms):                        8.82
P99 TPOT (ms):                           9.39
---------------Inter-Token Latency----------------
Mean ITL (ms):                           8.93
Median ITL (ms):                         8.98
P95 ITL (ms):                            9.83
P99 ITL (ms):                            10.20
Max ITL (ms):                            18.50
==================================================
  • 중간 동시성 (균형)
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 1000 \
  --random-output-len 1000 \
  --num-prompts 80 \
  --max-concurrency 16 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 16
Successful requests:                     80
Benchmark duration (s):                  52.73
Total input tokens:                      39668
Total input text tokens:                 39668
Total generated tokens:                  40805
Total generated tokens (retokenized):    40775
Request throughput (req/s):              1.52
Input token throughput (tok/s):          752.27
Output token throughput (tok/s):         773.83
Peak output token throughput (tok/s):    1040.00
Peak concurrent requests:                21
Total token throughput (tok/s):          1526.10
Concurrency:                             13.98
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   9217.90
Median E2E Latency (ms):                 9642.50
P90 E2E Latency (ms):                    15147.02
P99 E2E Latency (ms):                    18237.06
---------------Time to First Token----------------
Mean TTFT (ms):                          299.02
Median TTFT (ms):                        105.98
P99 TTFT (ms):                           1109.29
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          18.03
Median TPOT (ms):                        18.00
P99 TPOT (ms):                           26.51
---------------Inter-Token Latency----------------
Mean ITL (ms):                           17.52
Median ITL (ms):                         16.07
P95 ITL (ms):                            18.14
P99 ITL (ms):                            89.43
Max ITL (ms):                            763.13
==================================================
  • 높은 동시성 (처리량 최적화)
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 1000 \
  --random-output-len 1000 \
  --num-prompts 500 \
  --max-concurrency 100 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 100
Successful requests:                     500
Benchmark duration (s):                  91.48
Total input tokens:                      249831
Total input text tokens:                 249831
Total generated tokens:                  252662
Total generated tokens (retokenized):    250941
Request throughput (req/s):              5.47
Input token throughput (tok/s):          2730.87
Output token throughput (tok/s):         2761.82
Peak output token throughput (tok/s):    4199.00
Peak concurrent requests:                109
Total token throughput (tok/s):          5492.69
Concurrency:                             90.54
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   16566.04
Median E2E Latency (ms):                 16134.36
P90 E2E Latency (ms):                    30167.60
P99 E2E Latency (ms):                    34034.04
---------------Time to First Token----------------
Mean TTFT (ms):                          433.94
Median TTFT (ms):                        123.26
P99 TTFT (ms):                           1760.09
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          32.26
Median TPOT (ms):                        33.56
P99 TPOT (ms):                           38.78
---------------Inter-Token Latency----------------
Mean ITL (ms):                           31.99
Median ITL (ms):                         24.06
P95 ITL (ms):                            79.62
P99 ITL (ms):                            103.03
Max ITL (ms):                            1369.20
==================================================

시나리오 2: Reasoning (1K/8K)

  • 낮은 동시성
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 1000 \
  --random-output-len 8000 \
  --num-prompts 10 \
  --max-concurrency 1 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 1
Successful requests:                     10
Benchmark duration (s):                  525.43
Total input tokens:                      6101
Total input text tokens:                 6101
Total generated tokens:                  44462
Total generated tokens (retokenized):    44451
Request throughput (req/s):              0.02
Input token throughput (tok/s):          11.61
Output token throughput (tok/s):         84.62
Peak output token throughput (tok/s):    125.00
Peak concurrent requests:                2
Total token throughput (tok/s):          96.23
Concurrency:                             1.00
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   52540.19
Median E2E Latency (ms):                 53694.45
P90 E2E Latency (ms):                    94742.08
P99 E2E Latency (ms):                    101224.18
---------------Time to First Token----------------
Mean TTFT (ms):                          97.45
Median TTFT (ms):                        95.28
P99 TTFT (ms):                           105.64
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          10.94
Median TPOT (ms):                        11.25
P99 TPOT (ms):                           13.09
---------------Inter-Token Latency----------------
Mean ITL (ms):                           11.80
Median ITL (ms):                         11.51
P95 ITL (ms):                            15.83
P99 ITL (ms):                            16.86
Max ITL (ms):                            19.96
==================================================
  • 중간 동시성
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 1000 \
  --random-output-len 8000 \
  --num-prompts 80 \
  --max-concurrency 16 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 16
Successful requests:                     80
Benchmark duration (s):                  473.92
Total input tokens:                      39668
Total input text tokens:                 39668
Total generated tokens:                  318306
Total generated tokens (retokenized):    317860
Request throughput (req/s):              0.17
Input token throughput (tok/s):          83.70
Output token throughput (tok/s):         671.65
Peak output token throughput (tok/s):    1040.00
Peak concurrent requests:                19
Total token throughput (tok/s):          755.35
Concurrency:                             13.80
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   81746.73
Median E2E Latency (ms):                 78508.54
P90 E2E Latency (ms):                    155292.49
P99 E2E Latency (ms):                    166769.99
---------------Time to First Token----------------
Mean TTFT (ms):                          117.50
Median TTFT (ms):                        101.97
P99 TTFT (ms):                           182.88
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          20.36
Median TPOT (ms):                        20.48
P99 TPOT (ms):                           22.63
---------------Inter-Token Latency----------------
Mean ITL (ms):                           20.52
Median ITL (ms):                         20.42
P95 ITL (ms):                            23.41
P99 ITL (ms):                            26.29
Max ITL (ms):                            90.48
==================================================
  • 높은 동시성
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 1000 \
  --random-output-len 8000 \
  --num-prompts 320 \
  --max-concurrency 64 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 64
Successful requests:                     320
Benchmark duration (s):                  714.72
Total input tokens:                      158939
Total input text tokens:                 158939
Total generated tokens:                  1301025
Total generated tokens (retokenized):    1289431
Request throughput (req/s):              0.45
Input token throughput (tok/s):          222.38
Output token throughput (tok/s):         1820.33
Peak output token throughput (tok/s):    3200.00
Peak concurrent requests:                68
Total token throughput (tok/s):          2042.71
Concurrency:                             55.68
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   124364.58
Median E2E Latency (ms):                 129250.98
P90 E2E Latency (ms):                    219175.80
P99 E2E Latency (ms):                    247741.77
---------------Time to First Token----------------
Mean TTFT (ms):                          149.40
Median TTFT (ms):                        114.78
P99 TTFT (ms):                           288.60
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          30.51
Median TPOT (ms):                        31.75
P99 TPOT (ms):                           33.32
---------------Inter-Token Latency----------------
Mean ITL (ms):                           30.56
Median ITL (ms):                         30.82
P95 ITL (ms):                            33.20
P99 ITL (ms):                            80.54
Max ITL (ms):                            117.72
==================================================

시나리오 3: Summarization (8K/1K)

  • 낮은 동시성
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 8000 \
  --random-output-len 1000 \
  --num-prompts 10 \
  --max-concurrency 1 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 1
Successful requests:                     10
Benchmark duration (s):                  58.27
Total input tokens:                      41941
Total input text tokens:                 41941
Total generated tokens:                  4220
Total generated tokens (retokenized):    4220
Request throughput (req/s):              0.17
Input token throughput (tok/s):          719.73
Output token throughput (tok/s):         72.42
Peak output token throughput (tok/s):    112.00
Peak concurrent requests:                2
Total token throughput (tok/s):          792.15
Concurrency:                             1.00
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   5825.08
Median E2E Latency (ms):                 4624.26
P90 E2E Latency (ms):                    12690.22
P99 E2E Latency (ms):                    13177.96
---------------Time to First Token----------------
Mean TTFT (ms):                          296.01
Median TTFT (ms):                        195.59
P99 TTFT (ms):                           717.88
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          12.63
Median TPOT (ms):                        13.07
P99 TPOT (ms):                           16.68
---------------Inter-Token Latency----------------
Mean ITL (ms):                           13.13
Median ITL (ms):                         13.17
P95 ITL (ms):                            17.02
P99 ITL (ms):                            17.47
Max ITL (ms):                            19.84
==================================================
  • 중간 동시성
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 8000 \
  --random-output-len 1000 \
  --num-prompts 80 \
  --max-concurrency 16 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 16
Successful requests:                     80
Benchmark duration (s):                  89.59
Total input tokens:                      300020
Total input text tokens:                 300020
Total generated tokens:                  41669
Total generated tokens (retokenized):    41656
Request throughput (req/s):              0.89
Input token throughput (tok/s):          3348.77
Output token throughput (tok/s):         465.10
Peak output token throughput (tok/s):    752.00
Peak concurrent requests:                19
Total token throughput (tok/s):          3813.87
Concurrency:                             14.39
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   16120.74
Median E2E Latency (ms):                 16246.55
P90 E2E Latency (ms):                    27279.72
P99 E2E Latency (ms):                    34577.93
---------------Time to First Token----------------
Mean TTFT (ms):                          1943.94
Median TTFT (ms):                        382.19
P99 TTFT (ms):                           8980.41
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          27.87
Median TPOT (ms):                        28.26
P99 TPOT (ms):                           40.55
---------------Inter-Token Latency----------------
Mean ITL (ms):                           27.27
Median ITL (ms):                         21.74
P95 ITL (ms):                            23.32
P99 ITL (ms):                            232.65
Max ITL (ms):                            4282.01
==================================================
  • 높은 동시성
python -m sglang.bench_serving \
  --backend sglang \
  --model zai-org/GLM-4.7-Flash \
  --dataset-name random \
  --random-input-len 8000 \
  --random-output-len 1000 \
  --num-prompts 320 \
  --max-concurrency 64 \
  --request-rate inf
============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 64
Successful requests:                     320
Benchmark duration (s):                  167.01
Total input tokens:                      1273893
Total input text tokens:                 1273893
Total generated tokens:                  170000
Total generated tokens (retokenized):    169226
Request throughput (req/s):              1.92
Input token throughput (tok/s):          7627.82
Output token throughput (tok/s):         1017.93
Peak output token throughput (tok/s):    1984.00
Peak concurrent requests:                69
Total token throughput (tok/s):          8645.75
Concurrency:                             59.68
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   31147.52
Median E2E Latency (ms):                 30603.34
P90 E2E Latency (ms):                    54889.44
P99 E2E Latency (ms):                    67665.30
---------------Time to First Token----------------
Mean TTFT (ms):                          428.87
Median TTFT (ms):                        441.69
P99 TTFT (ms):                           1232.68
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          58.06
Median TPOT (ms):                        62.79
P99 TPOT (ms):                           82.23
---------------Inter-Token Latency----------------
Mean ITL (ms):                           57.93
Median ITL (ms):                         33.30
P95 ITL (ms):                            247.98
P99 ITL (ms):                            409.63
Max ITL (ms):                            1421.21
==================================================

5.1.5 결과 이해하기

핵심 지표:

  • 요청 처리량 (req/s): 초당 처리하는 요청 수
  • 출력 토큰 처리량 (tok/s): 초당 생성하는 총 토큰 수
  • 평균 TTFT (ms): 첫 토큰까지의 시간 (Time to First Token) - 응답성을 측정해요
  • 평균 TPOT (ms): 출력 토큰당 시간 (Time Per Output Token) - 생성 속도를 측정해요
  • 평균 ITL (ms): 토큰 간 지연 시간 (Inter-Token Latency) - 스트리밍 일관성을 측정해요

이 구성이 중요한 이유:

  • 1K/1K (Chat): 가장 흔한 대화형 AI 워크로드를 나타내요. 대부분의 배포에서 최우선 시나리오예요.
  • 1K/8K (Reasoning): 복잡한 추론·코드 생성·상세한 설명에 중요한 장문 생성 능력을 테스트해요.
  • 8K/1K (Summarization): 대용량 컨텍스트 입력에서의 성능을 평가하며, RAG 시스템·문서 Q&A·요약 작업에 필수적이에요.
  • 가변 동시성: 다양한 부하 수준에서 처리량과 지연 시간의 최적 트레이드오프인 Pareto frontier를 포착해요. 낮은 동시성은 최상의 지연 시간을, 높은 동시성은 최대 처리량을 보여줘요.

결과 해석하기:

  • 자신의 하드웨어 기준선 수치와 결과를 비교해 보세요
  • 동일 지연 시간에서 더 높은 처리량 = 더 나은 성능
  • 더 낮은 TTFT = 더 반응성 좋은 사용자 경험
  • 더 낮은 TPOT = 더 빠른 생성 속도

5.2 정확도 벤치마크

표준 벤치마크에서 모델 정확도를 기록해요:

5.2.1 GSM8K 벤치마크

  • 벤치마크 명령
python -m sglang.test.few_shot_gsm8k \
  --num-questions 200 \
  --port 30000
  • 결과
Accuracy: 0.845
Invalid: 0.000
Latency: 8.431 s
Output throughput: 2195.387 token/s

더 알아보기 (Learn more)