Step-3.7-Flash

Step-3.7-Flash (new)

Step-3.7-Flash는 198B 파라미터 Mixture-of-Experts(MoE) 비전-언어 모델로, 196B 파라미터 언어 백본과 이미지 이해를 위한 1.8B 파라미터 비전 인코더를 결합해요. 고빈도 프로덕션 워크로드용으로 설계되어 토큰당 약 11B 파라미터를 활성화하고, 세 가지 선택 가능한 추론 수준(low, medium, high)을 지원하는 256k 컨텍스트 윈도우를 제공해요. 모델은 여러 양자화 형식(BF16, FP8, NVFP4)으로 제공돼요.

에이전트 워크플로를 확장해야 하는 개발자용으로, 지각·검색·추론을 결합하는 작업(대규모 금융 보고서 한 번에 파싱, 교차 소스 검증이 있는 다단계 검색 루프, 고처리량 파이프라인의 동시 코딩 에이전트)에 적합해요.

출처: 문서

본문

1. 모델 소개

Step-3.7-Flash는 198B 파라미터 MoE 비전-언어 모델로, 196B 파라미터 언어 백본과 네이티브 이미지 이해를 위한 1.8B 파라미터 비전 인코더를 결합해요. 고빈도 프로덕션 워크로드에 맞게 설계되어 토큰당 약 11B 파라미터를 활성화하며, 세 가지 선택 가능한 추론 수준(low, medium, high)을 지원하는 256k 컨텍스트 윈도우를 제공해요. 모델은 여러 양자화 형식(BF16, FP8, NVFP4)으로 제공돼요.

Step-3.7-Flash는 지각, 검색, 추론을 결합하는 에이전트 워크플로를 확장해야 하는 개발자용으로 만들어졌어요 — 대규모 금융 보고서를 한 번에 파싱하거나, 교차 소스 검증이 있는 다단계 검색 루프를 실행하거나, 고처리량 파이프라인에서 동시 코딩 에이전트를 운영하는 것 같은 작업 말이에요.

2. SGLang 설치

Step-3.7-Flash는 현재 Docker 이미지 설치로 SGLang에서 사용할 수 있어요.

Docker (NVIDIA)

# Pull the docker image
docker pull lmsysorg/sglang:latest

# Launch the container
docker run -it --gpus all \
  --shm-size=32g \
  --ipc=host \
  --network=host \
  lmsysorg/sglang:latest bash

3. 모델 배포

이 절은 사용 사례별로 최적화된 배포 구성을 제공해요.

3.1 기본 구성

Step-3.7-Flash 시리즈는 한 가지 크기로 여러 양자화 옵션을 제공해요. 권장 시작 구성은 하드웨어에 따라 달라져요.

인터랙티브 명령 생성기: 아래 구성 선택기를 사용해 하드웨어 플랫폼, 양자화 방법, 기능에 맞는 배포 명령을 자동 생성하세요.

3.2 구성 팁

  • 메모리: 높은 VRAM 용량의 GPU가 필요해요. 지원 플랫폼: H200 (4x, TP=4), B200/B300 (4x, TP=4), GB200/GB300 (4x, TP=4).
  • NVFP4 양자화: NVFP4는 가장 작은 메모리 풋프린트를 제공해요. --quantization modelopt_fp4 --kv-cache-dtype fp8_e4m3 --moe-runner-backend flashinfer_trtllm이 필요해요.
  • Trust Remote Code: 커스텀 모델 아키텍처 때문에 모든 Step-3.7-Flash 변형은 --trust-remote-code가 필요해요.

4. 모델 호출

4.1 기본 사용

기본 API 사용과 요청 예제는 다음을 참조하세요:

4.2 고급 사용

4.2.1 멀티모달 입력

Step-3.7-Flash는 텍스트와 함께 이미지 입력을 지원해요. 기본 예제:

from openai import OpenAI

client = OpenAI(
    api_key="EMPTY",
    base_url="http://localhost:30000/v1",
    timeout=3600
)

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://ofasys-multimodal-wlcb-3-toshanghai.oss-accelerate.aliyuncs.com/wpf272043/keepme/image/receipt.png"
                }
            },
            {
                "type": "text",
                "text": "Read all the text in the image."
            }
        ]
    }
]

start = time.time()
response = client.chat.completions.create(
    model="stepfun-ai/Step-3.7-Flash",
    messages=messages,
    max_tokens=2048,
)
print(f"Response costs: {time.time() - start:.2f}s")
print(f"Generated text: {response.choices[0].message.content}")

다중 이미지 입력 예제:

Step-3.7-Flash는 비교나 분석을 위해 단일 요청에서 여러 이미지를 처리할 수 있어요:

from openai import OpenAI

client = OpenAI(
    api_key="EMPTY",
    base_url="http://localhost:30000/v1",
    timeout=3600
)

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://www.civitatis.com/f/china/hong-kong/guia/taxi.jpg"
                }
            },
            {
                "type": "image_url",
                "image_url": {
                    "url": "https://cdn.cheapoguides.com/wp-content/uploads/sites/7/2025/05/GettyImages-509614603-1280x600.jpg"
                }
            },
            {
                "type": "text",
                "text": "Compare these two images and describe the differences in 100 words or less."
            }
        ]
    }
]

start = time.time()
response = client.chat.completions.create(
    model="stepfun-ai/Step-3.7-Flash",
    messages=messages,
    max_tokens=2048,
)
print(f"Response costs: {time.time() - start:.2f}s")
print(f"Generated text: {response.choices[0].message.content}")

4.2.2 Reasoning Parser

Step-3.7-Flash는 reasoning 모드를 지원해요. 배포 시 reasoning parser를 활성화해 thinking과 content 섹션을 분리하세요:

sglang serve \
  --model-path stepfun-ai/Step-3.7-Flash \
  --tp 4 \
  --trust-remote-code \
  --reasoning-parser step3p5
from openai import OpenAI

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

# Enable streaming to see the thinking process in real-time
response = client.chat.completions.create(
    model="stepfun-ai/Step-3.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()

4.2.3 Tool Calling

Step-3.7-Flash는 툴 호출 능력을 지원해요. 툴 호출 파서를 활성화하세요:

sglang 서버 시작:

sglang serve \
  --model-path stepfun-ai/Step-3.7-Flash \
  --tp 4 \
  --trust-remote-code \
  --reasoning-parser step3p5 \
  --tool-call-parser step3p5
from openai import OpenAI

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

# 1. define 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"]
            }
        }
    }
]

# 2. tool run
def get_weather(location, unit="celsius"):
    return f"The weather in {location} is 22 {unit[0].upper()} and sunny."

# 3. send first request
print("--- Sending first request ---")
response = client.chat.completions.create(
    model="stepfun-ai/Step-3.7-Flash",
    messages=[
        {"role": "user", "content": "What's the weather in Beijing?"}
    ],
    tools=tools,
    temperature=1.0,
    stream=False
)

message = response.choices[0].message

# 4. Handle Reasoning Content
reasoning = getattr(message, 'reasoning_content', None)
if reasoning:
    print("=============== Thinking =================")
    print(reasoning)
    print("==========================================")

# 5. Handle Tool Calls
if message.tool_calls:
    print("\nTool Calls detected:")
    history_messages = [
        {"role": "user", "content": "What's the weather in Beijing?"},
        message
    ]

    for tool_call in message.tool_calls:
        print(f"   Tool: {tool_call.function.name}")
        print(f"   Args: {tool_call.function.arguments}")

        args = json.loads(tool_call.function.arguments)
        tool_result = get_weather(args.get("location"), args.get("unit", "celsius"))

        history_messages.append({
            "role": "tool",
            "tool_call_id": tool_call.id,
            "content": tool_result
        })

    print("\n--- Sending tool results ---")
    final_response = client.chat.completions.create(
        model="stepfun-ai/Step-3.7-Flash",
        messages=history_messages,
        temperature=1.0,
        stream=False
    )

    print("=============== Final Content =================")
    print(final_response.choices[0].message.content)

else:
    if message.content:
        print("=============== Content =================")
        print(message.content)

참고:

  • reasoning parser는 모델이 툴을 어떻게 사용하기로 결정하는지 보여줘요.
  • 툴 호출은 함수 이름과 인자로 명확히 표시돼요.
  • 그런 다음 함수를 실행하고 결과를 다시 보내 대화를 계속할 수 있어요.

5. 벤치마크

벤치마크 결과는 곧 추가될 예정이에요.

더 알아보기 (Learn more)