Instructions to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S # Run inference directly in the terminal: llama cli -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S # Run inference directly in the terminal: llama cli -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S # Run inference directly in the terminal: ./llama-cli -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S # Run inference directly in the terminal: ./build/bin/llama-cli -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Use Docker
docker model run hf.co/stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
- LM Studio
- Jan
- vLLM
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
- SGLang
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with Ollama:
ollama run hf.co/stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
- Unsloth Studio
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S to start chatting
- Pi
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with Docker Model Runner:
docker model run hf.co/stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
- Lemonade
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Run and chat with the model
lemonade run user.Step-3.5-Flash-GGUF-Q4_K_S-Q4_K_S
List all available models
lemonade list
- Hermes Agent
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S:Q4_K_S" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
chat template is broken
Hello.
I'm excited to appearance stepfun's official GGUF.
But, if you load GGUF normally, the model is strange.
For example
- The model don't think
- The model speak unnatural Japanese
- The model don't stop
However, if you load GGUF with chat template file (--chat-template-file "D:\Step-3.5-Flash\chat_template.jinja") the model is normal.
Is this GGUF's template broken?
Interesting. Where do find that chat_template.jinja?
- With this jinja template when calling tools I get this exception:
srv operator(): got exception: {"error":{"code":500,"message":"\n------------\nWhile executing FilterExpression at line 55, column 63 in source:\n...- for args_name, args_value in arguments|items %}↵ {{- '<...\n ^\nError: Unknown (built-in) filter 'items' for type String","type":"server_error"}}
- Looks like the jinja template has a bug, I worked it around with this fixed jinja template.
diff --git a/jinja_template_for_arch_step35.jinja b/jinja_template_for_arch_step35.jinja
index c09ea497d..ca3817b2d 100644
--- a/jinja_template_for_arch_step35.jinja
+++ b/jinja_template_for_arch_step35.jinja
@@ -51,13 +51,17 @@
{%- endif %}
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
{%- if tool_call.arguments is defined %}
- {%- set arguments = tool_call.arguments %}
- {%- for args_name, args_value in arguments|items %}
+ {%- if tool_call.arguments is mapping %}
+ {%- for args_name, args_value in tool_call.arguments|items %}
{{- '<parameter=' + args_name + '>\n' }}
{%- set args_value = args_value | tojson(ensure_ascii=False) | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
{{- args_value }}
{{- '\n</parameter>\n' }}
- {%- endfor %}
+ {%- endfor %}
+ {%- else %}
+ {#- arguments is string (JSON from server) - output as single parameter block #}
+ {{- '<parameter=arguments>\n' + (tool_call.arguments | string) + '\n</parameter>\n' }}
+ {%- endif %}
{%- endif %}
{{- '</function>\n</tool_call>' }}
{%- endfor %}
{% macro render_content(content) %}{% if content is none %}{{- '' }}{% elif content is string %}{{- content }}{% elif content is mapping %}{{- content['value'] if 'value' in content else content['text'] }}{% elif content is iterable %}{% for item in content %}{% if item.type == 'text' %}{{- item['value'] if 'value' in item else item['text'] }}{% elif item.type == 'image' %}<im_patch>{% endif %}{% endfor %}{% endif %}{% endmacro %}
{{bos_token}}{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0].role == 'system' %}
{{- render_content(messages[0].content) + '\n\n' }}
{%- endif %}
{{- "# Tools\n\nYou have access to the following functions in JSONSchema format:\n\n<tools>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson(ensure_ascii=False) }}
{%- endfor %}
{{- "\n</tools>\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...>\n...\n</function> block must be nested within <tool_call>\n...\n</tool_call> XML tags\n- Required parameters MUST be specified\n</IMPORTANT><|im_end|>\n" }}
{%- else %}
{%- if messages[0].role == 'system' %}
{{- '<|im_start|>system\n' + render_content(messages[0].content) + '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
{%- for message in messages[::-1] %}
{%- set index = (messages|length - 1) - loop.index0 %}
{%- if ns.multi_step_tool and message.role == "user" and render_content(message.content) is string and not(render_content(message.content).startswith('<tool_response>') and render_content(message.content).endswith('</tool_response>')) %}
{%- set ns.multi_step_tool = false %}
{%- set ns.last_query_index = index %}
{%- endif %}
{%- endfor %}
{%- for message in messages %}
{%- set content = render_content(message.content) %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
{%- set role_name = 'observation' if (message.role == "system" and not loop.first and message.name == 'observation') else message.role %}
{{- '<|im_start|>' + role_name + '\n' + content + '<|im_end|>' + '\n' }}
{%- elif message.role == "assistant" %}
{%- if message.reasoning_content is string %}
{%- set reasoning_content = render_content(message.reasoning_content) %}
{%- else %}
{%- if '</think>' in content %}
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
{%- else %}
{%- set reasoning_content = '' %}
{%- endif %}
{%- endif %}
{%- if loop.index0 > ns.last_query_index %}
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n' + content }}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- if message.tool_calls %}
{%- for tool_call in message.tool_calls %}
{%- if tool_call.function is defined %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
{%- if tool_call.arguments is defined %}
{%- set arguments = tool_call.arguments %}
{%- for args_name, args_value in arguments|items %}
{{- '<parameter=' + args_name + '>\n' }}
{%- set args_value = args_value | tojson(ensure_ascii=False) | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
{{- args_value }}
{{- '\n</parameter>\n' }}
{%- endfor %}
{%- endif %}
{{- '</function>\n</tool_call>' }}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>tool_response\n' }}
{%- endif %}
{{- '<tool_response>' }}
{{- content }}
{{- '</tool_response>' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n<think>\n' }}
{%- endif %}
Turns out that we can make use of autoparser branch: https://github.com/pwilkin/llama.cpp/tree/autoparser
I also get this FilterExpression at line 55, column 63 error when tools are called in llama.cpp. Using the patch from @exxocism did not help - the model fails to generate output at all. Unclear why. I'll dig into it a bit more, but its clear there is something wrong with the currently distributed template.
The patch of @exxocism does work; updating to the b7972 branch of llama.cpp fixed the freezing. There are other people experiencing the same problem; this patch fixes the error but adds a lot of noise to the output when tools are called: https://huggingface.co/ubergarm/Step-3.5-Flash-GGUF/discussions/1#69878ca7ae66ac235fc2ca95
Sry I accidentally specified the wrong minja when converting the model earlier. I’ve re-uploaded it. Now model can think.
@apohelios where can we find the updated chat template? This one is broken with tools: https://huggingface.co/stepfun-ai/Step-3.5-Flash/blob/main/chat_template.jinja
@Qnibbles Tool calling issues here aren’t caused by the chat template — it’s a known issue on llama.cpp mainline. You can try this PR which fixes the tool call problems:
https://github.com/ggml-org/llama.cpp/pull/18675
@Qnibbles Tool calling issues here aren’t caused by the chat template — it’s a known issue on llama.cpp mainline. You can try this PR which fixes the tool call problems:
https://github.com/ggml-org/llama.cpp/pull/18675
What problem is there with this model and tool calls, exactly, once the template is patched?
Tool calling seems to work "OK" for me, with the patch above or a previous similar one that I did (simply changing |items to .items). Opencode does show the start of the in an ugly way, but somehow manages to call it OK. Open-WebUI MCP calls work fine (with native tool calling enabled there too).

