Agent workflows · 2026-11-28
Sage-S2.1-Flash API: use Shanghai AI Lab's research model on LLMTR
Call Sage-S2.1-Flash on LLMTR as internlm/sage-s2.1-flash-free: image input, tool calling, JSON schema, switching reasoning off, and free use until 31 December 2026.
Short answer: how is Sage-S2.1-Flash called on LLMTR?
LLMTR is a gateway that gives access to language models from different providers through one OpenAI-compatible API. On LLMTR, Sage-S2.1-Flash is called as internlm/sage-s2.1-flash-free on the https://llmtr.com/v1/chat/completions endpoint. It has a 524,288-token context window, takes text and images, calls tools, returns JSON and reasons before answering by default.
The model is free until 31 December 2026, 24:00 (TRT), and nothing is taken from your balance in that time. From 1 January 2027, 00:00 (TRT), a request returns 410 model_retired.
What is Sage-S2.1-Flash and what is it for?
According to Shanghai AI Lab's Hugging Face model card, Sage-S2.1-Flash is a scientific multimodal model designed for research tasks that need several rounds of analysis and verification. It combines reading scientific data with information retrieval, coding and tool use; it runs analyses with specialized software, checks the result against intermediate outputs and visual feedback, and adjusts its next step accordingly.
According to the lab's model repository, it is a 320-billion-parameter mixture-of-experts (MoE) model with 18 billion parameters active per token, and its weights are open under the MIT license. The card also says that more than ten scientific input types, such as molecular graphs, crystal structures and protein sequences, are read by a separate encoder. This row on LLMTR accepts text and images.
- Multi-step analysis: research loops that check a result against intermediate outputs and correct the next step.
- Machine learning engineering: preparing data, training a model and evaluating the result.
- Spreadsheets and office documents: answering questions from tables and business documents.
- Tool-driven research: agents that run software through function calls.
Model id and response fields
Set base_url to https://llmtr.com/v1 in the OpenAI SDK and put internlm/sage-s2.1-flash-free in the model field. The answer arrives in content and the reasoning text in reasoning_content.
Without max_tokens, an answer is at most 65,536 tokens. Reasoning tokens count toward that limit; if a response ends with finish_reason: length, treat it as incomplete and raise max_tokens or switch reasoning off.
Clients that speak the Anthropic Messages format can call the same id through https://llmtr.com/v1/messages. The OpenAI Responses format (/v1/responses) is not open on this row.
A request with an image, and the response fields
import os
from openai import OpenAI
client = OpenAI(base_url="https://llmtr.com/v1", api_key=os.environ["LLMTR_API_KEY"])
response = client.chat.completions.create(
model="internlm/sage-s2.1-flash-free",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe the trend in this chart and list two checks you would run on the data."},
# Your own image: an https address or a base64 data URL.
{"type": "image_url", "image_url": {"url": "https://example.com/your-chart.png"}},
],
}
],
max_tokens=8192,
)
choice = response.choices[0]
print("finish_reason:", choice.finish_reason)
print("reasoning:", (choice.message.model_extra or {}).get("reasoning_content", "")[:300])
print("answer:", choice.message.content)
print("prompt:", response.usage.prompt_tokens, "completion:", response.usage.completion_tokens)
Switching reasoning off and on
The model reasons before answering by default. For short, well-defined tasks, switch reasoning off by adding :fast to the model id or sending reasoning: false in the request body; :think keeps it on.
reasoning_effort is not supported on this row and is rejected with 400: reasoning is switched on or off, not set by level.
A tool call with reasoning off, and the switch in the body
import json
import os
from openai import OpenAI
client = OpenAI(base_url="https://llmtr.com/v1", api_key=os.environ["LLMTR_API_KEY"])
tools = [
{
"type": "function",
"function": {
"name": "run_regression",
"description": "Fit a linear regression on a named dataset and return slope, intercept and r2.",
"parameters": {
"type": "object",
"properties": {"dataset": {"type": "string"}, "x": {"type": "string"}, "y": {"type": "string"}},
"required": ["dataset", "x", "y"],
},
},
}
]
# Reasoning off with the model id suffix; tool_choice stays "auto".
response = client.chat.completions.create(
model="internlm/sage-s2.1-flash-free:fast",
messages=[{"role": "user", "content": "Fit dose against response on the trial_2026 dataset and report the slope."}],
tools=tools,
tool_choice="auto",
)
for call in response.choices[0].message.tool_calls or []:
print(call.function.name, json.loads(call.function.arguments))
# The same switch in the request body.
off = client.chat.completions.create(
model="internlm/sage-s2.1-flash-free",
messages=[{"role": "user", "content": "What is 17 x 23? Reply with the number only."}],
extra_body={"reasoning": False},
)
print(off.choices[0].message.content)
Images, tool calling and JSON
The rules below say which request fields to send and how.
- Images: send an https address or a base64 data URL in an image_url part; text and image can share a message.
- Tool calling: define functions in tools; tool_choice can be auto, required, none or a named function. With none, the tool definitions are not passed to the model and the response lists tools in its llmtr_dropped_parameters field.
- JSON: response_format supports json_object and strict json_schema.
- Caching: part of a prompt that repeats the same beginning can be read from cache; the cached part shows in usage.prompt_tokens_details.cached_tokens.
Test results reported by the lab
The results below are taken from the table on Shanghai AI Lab's model card. They are the lab's own evaluation and have not been independently verified. Sage-S2.1-Flash has the table's highest score on three of the eight tests shown and trails the leading model on the other five.
Treat the table as a starting point and decide by trying the model on your own tasks.
| Test | Sage-S2.1-Flash | DeepSeek-V4.1-Flash-1017 | Qwen3.8-Max | GPT-5.6 Sol | Claude Opus 5 |
|---|---|---|---|---|---|
| MLE-bench Lite | 90.3 | 89.2 | 82.2 | 80.7 | 88.0 |
| OfficeQA Pro | 72.2 | 69.7 | 66.2 | 66.4 | 67.2 |
| SpreadsheetBench 2 | 37.1 | 35.8 | 34.9 | 32.7 | 33.6 |
| BFCL V4 | 75.5 | 71.4 | 66.8 | 68.8 | 80.6 |
| OSWorld-Verified | 85.2 | 78.5 | 84.3 | 82.2 | 86.4 |
| BrowseComp | 91.2 | 93.8 | – | 92.2 | 90.8 |
| PaperBench | 88.0 | 88.6 | 95.1 | 94.3 | 86.9 |
| SWE-bench Pro | 60.6 | 61.8 | 65.3 | 59.8 | 76.5 |
What happens after 31 December 2026?
internlm/sage-s2.1-flash-free is free until 31 December 2026, 24:00 (TRT), and nothing is taken from your balance in that time. From 1 January 2027, 00:00 (TRT), a request returns 410 model_retired.
To continue after that date on a paid row that takes text and images and calls tools, look at qwen/qwen3.8-max or deepseek/deepseek-v4.1-flash-1017 in the catalog; both are called on the same endpoint.
A request can get 429 or 503; in that case try again later or use one of the rows above.
Data and privacy
Requests are processed through a third-party provider. Prompts and completions may be logged by the provider and used to improve the model; do not send sensitive, personal or customer data.
Calling Sage-S2.1-Flash through LLMTR
Three steps to send a request to Sage-S2.1-Flash with the OpenAI SDK.
- Create an API key. Create an API key in the LLMTR dashboard and put it in the LLMTR_API_KEY environment variable.
- Set up the client. Set base_url to https://llmtr.com/v1 in the OpenAI SDK and put internlm/sage-s2.1-flash-free in the model field.
- Choose reasoning. The model reasons by default; for short tasks add :fast to the model id or send reasoning: false.
Frequently asked questions
Is Sage-S2.1-Flash paid on LLMTR?
No. The model is free until 31 December 2026, 24:00 (TRT), and nothing is taken from your balance. From 1 January 2027, 00:00 (TRT), a request returns 410 model_retired.
How do I switch reasoning off?
Add :fast to the model id or send reasoning: false in the request body. reasoning_effort is rejected with 400 on this row.
Can I send images to Sage-S2.1-Flash?
Yes. Send an https address or a base64 data URL in an image_url part; text and image can share a message.
What happens when I send tool_choice: none?
The model calls no tool: the tool definitions are not passed to it and the response lists tools in its llmtr_dropped_parameters field. auto, required and a named function work too.