Views
No views yet

| Token Type | Price |
|---|---|
| Input (cache miss) | $0.20 / M tokens |
| Input (cache hit) | $0.04 / M tokens |
| Output | $1.15 / M tokens |
Pick the rightbase_urlfor your region. StepFun operates two regional platforms with separate API hosts. Thebase_urlyou pass to the OpenAI client must match the platform where your API key was issued, otherwise requests will be rejected as unauthorized.
- Global: platform.stepfun.ai —
base_url=https://api.stepfun.ai/v1- China: platform.stepfun.com —
base_url=https://api.stepfun.com/v1To avoid hard-coding the wrong region, the examples below read both the API key and base URL from environment variables. Export them once before running:bash1export STEP_API_KEY="sk-..." 2export STEP_BASE_URL="https://api.stepfun.ai/v1" # use https://api.stepfun.com/v1 for the China platform
1import os
2from openai import OpenAI
3
4client = OpenAI(
5 api_key=os.environ["STEP_API_KEY"],
6 base_url=os.environ["STEP_BASE_URL"],
7)
8
9completion = client.chat.completions.create(
10 model="step-3.7-flash",
11 messages=[
12 {
13 "role": "system",
14 "content": "You are an AI assistant provided by StepFun. You are good at Chinese, English, and many other languages, and you can see, think, and act to help users get things done.",
15 },
16 {
17 "role": "user",
18 "content": "Introduce StepFun's artificial intelligence capabilities."
19 },
20 ],
21)
22
23print(completion)1import os
2from openai import OpenAI
3
4client = OpenAI(
5 api_key=os.environ["STEP_API_KEY"],
6 base_url=os.environ["STEP_BASE_URL"],
7)
8
9completion = client.chat.completions.create(
10 model="step-3.7-flash",
11 messages=[
12 {
13 "role": "user",
14 "content": [
15 {"type": "text", "text": "What is in this picture?"},
16 {
17 "type": "image_url",
18 "image_url": {"url": "https://example.com/photo.jpg"},
19 },
20 ],
21 },
22 ],
23)
24
25print(completion)1# via Docker
2docker pull vllm/vllm-openai:stepfun371vllm serve <MODEL_PATH_OR_HF_ID> \
2--served-model-name step3p7-flash \
3--tensor-parallel-size 8 \
4--enable-expert-parallel \
5--disable-cascade-attn \
6--reasoning-parser step3p5 \
7--enable-auto-tool-choice \
8--tool-call-parser step3p5 \
9--speculative_config '{"method": "mtp", "num_speculative_tokens": 3}' \
10--trust-remote-code1vllm serve <MODEL_PATH_OR_HF_ID> \
2--served-model-name step3p7-flash-bf16 \
3--tensor-parallel-size 8 \
4--enable-expert-parallel \
5--disable-cascade-attn \
6--reasoning-parser step3p5 \
7--enable-auto-tool-choice \
8--tool-call-parser step3p5 \
9--speculative_config '{"method": "mtp", "num_speculative_tokens": 3}' \
10--trust-remote-code1python3 -m vllm.entrypoints.openai.api_server \
2--host 0.0.0.0 \
3--port ${PORT} \
4--model stepfun-ai/Step-3.7-Flash-NVFP4 \
5--served-model-name step3p7 \
6--tensor-parallel-size 4 \
7--gpu-memory-utilization 0.9 \
8--enable-expert-parallel \
9--trust-remote-code \
10--quantization modelopt \
11--kv-cache-dtype fp8 \
12--max-model-len 8192 \
13--reasoning-parser step3p5 \
14--enable-auto-tool-choice \
15--tool-call-parser step3p5 \
16--async-scheduling1# via Docker
2docker pull lmsysorg/sglang:dev-step-3.7-flash
3
4# or from source (pip)
5pip install "sglang[all] @ git+https://github.com/sgl-project/sglang.git"Note: For Blackwell GPUs,--mm-attention-backend fa4may be used.
1sglang serve --model-path stepfun-ai/Step-3.7-Flash \
2 --tp 8 \
3 --reasoning-parser step3p5 \
4 --tool-call-parser step3p5 \
5 --enable-multimodal \
6 --speculative-algorithm EAGLE \
7 --speculative-num-steps 3 \
8 --speculative-eagle-topk 1 \
9 --speculative-num-draft-tokens 4 \
10 --enable-multi-layer-eagle \
11 --trust-remote-code \
12 --host 0.0.0.0 \
13 --port 80001sglang serve --model-path stepfun-ai/Step-3.7-Flash-FP8 \
2 --tp 8 \
3 --ep 4 \
4 --reasoning-parser step3p5 \
5 --tool-call-parser step3p5 \
6 --enable-multimodal \
7 --speculative-algorithm EAGLE \
8 --speculative-num-steps 3 \
9 --speculative-eagle-topk 1 \
10 --speculative-num-draft-tokens 4 \
11 --enable-multi-layer-eagle \
12 --trust-remote-code \
13 --host 0.0.0.0 \
14 --port 80001sglang serve --model-path stepfun-ai/Step-3.7-Flash-NVFP4 \
2 --tp 4 --ep 4 \
3 --moe-runner-backend flashinfer_trtllm \
4 --kv-cache-dtype fp8_e4m3 \
5 --quantization modelopt_fp4 \
6 --trust-remote-code \
7 --reasoning-parser step3p5 \
8 --tool-call-parser step3p5 \
9 --attention-backend trtllm_mhaNote: Deployment of this model requirestransformers5.0 or later.
1from transformers import AutoProcessor, AutoModelForCausalLM
2
3MODEL_PATH = "<MODEL_PATH_OR_HF_ID>"
4
5# 1. Setup
6processor = AutoProcessor.from_pretrained(MODEL_PATH, trust_remote_code=True)
7model = AutoModelForCausalLM.from_pretrained(
8 MODEL_PATH,
9 device_map="auto",
10 dtype="auto",
11 trust_remote_code=True
12)
13
14# 2. Prepare Input
15messages = [
16 {
17 "role": "user",
18 "content": [
19 {"type": "image", "url": "https://example.com/photo.jpg"},
20 {"type": "text", "text": "What is in this picture?"}
21 ]
22 },
23]
24inputs = processor.apply_chat_template(
25 messages,
26 tokenize=True,
27 add_generation_prompt=True,
28 return_dict=True,
29 return_tensors="pt",
30).to(model.device)
31
32# 3. Generate
33generated_ids = model.generate(**inputs, max_new_tokens=128, do_sample=False)
34output_text = processor.decode(generated_ids[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
35
36print(output_text)| Component | Quantization | File Size |
|---|---|---|
| Language Model | Q4_K_S | 111.5 GB |
| Language Model | IQ4_XS | 104.99 GB |
| Language Model | Q3_K_L | 102.5 GB |
| Multimodal Projector | FP16 | 3.97 GB |
1git clone https://github.com/stepfun-ai/llama.cpp.git
2cd llama.cpp
3git checkout -b step3.7 origin/step3.71cmake -B build-macos -S . \
2 -DCMAKE_BUILD_TYPE=Release \
3 -DBUILD_SHARED_LIBS=ON \
4 -DLLAMA_BUILD_SERVER=ON \
5 -DLLAMA_BUILD_TESTS=ON \
6 -DGGML_METAL=ON \
7 -DGGML_METAL_EMBED_LIBRARY=ON \
8 -DGGML_BLAS=ON \
9 -DGGML_BLAS_VENDOR=Apple \
10 -DGGML_ACCELERATE=ON \
11 -DGGML_NATIVE=ON
12cmake --build build-macos -j81cmake -S . -B build-cuda \
2 -DCMAKE_BUILD_TYPE=Release \
3 -DGGML_CUDA=ON \
4 -DGGML_CUDA_GRAPHS=ON \
5 -DGGML_CUDA_FORCE_MMQ=ON \
6 -DLLAMA_OPENSSL=OFF \
7 -DLLAMA_BUILD_COMMON=ON \
8 -DLLAMA_BUILD_TOOLS=ON \
9 -DLLAMA_BUILD_SERVER=ON \
10 -DLLAMA_BUILD_EXAMPLES=OFF \
11 -DLLAMA_BUILD_TESTS=OFF
12cmake --build build-cuda -j81cmake -S . -B build-vulkan \
2 -DCMAKE_BUILD_TYPE=Release \
3 -DGGML_VULKAN=ON \
4 -DGGML_NATIVE=ON \
5 -DLLAMA_BUILD_SERVER=ON \
6 -DLLAMA_BUILD_UI=OFF \
7 -DLLAMA_BUILD_TOOLS=ON
8cmake --build build-vulkan -j8llama-cli:./llama-cli -m Step3.7_Q4_K_S.gguf -b 2048 -ub 2048 -fa on --temp 1.0 -p "What's your name?"llama-batched-bench:./llama-batched-bench -m step3.7_Q4_K_S.gguf -c 32768 -b 2048 -ub 2048 -npp 0,2048,8192,16384,32768 -ntg 128 -npl 1