Skip to navigation

DeepSeek V4.1 Flash 1017

View as Markdown

DeepSeek V4.1 Flash 1017 is a general-purpose open-weight model served on Sarvam infrastructure. It accepts text and image input and has a 1,048,576-token context window.

At a glance

Model IDdeepseekv4.1-flash-1017 · deepseekv4.1-flash-1017-interactive (high throughput)
Best forLong-document analysis and agentic workflows
Context window1,048,576 tokens
Input → outputText + image (inline only) → text
Reasoninglow, high (default when omitted), or max; can be turned off. See Reasoning
Tool callingSupported, including tool_choice: "required"
APIsPOST /v2/chat/completions and POST /v2/responses
Pricing₹14 input · ₹0.25 cached input · ₹55 output per 1M tokens, introductory pricing through the end of 2026; reasoning is billed as output (Pricing)

Key capabilities

Long context

Process up to 1,048,576 tokens across the prompt, reasoning, and generated output.

Image input

Send images inline as base64 data URIs alongside text.

Reasoning

Receive reasoning in reasoning_content separately from the final answer in content.

Tool calling

Use OpenAI-compatible tools and tool_choice for agentic workflows.

Streaming

Receive reasoning and final-answer deltas as server-sent events.

Moving from OpenRouter, Fireworks AI, or Together AI? The migration guides map model IDs and request fields to Sarvam.

Interactive variant

Model ID deepseekv4.1-flash-1017-interactive is a high-throughput deployment of DeepSeek V4.1 Flash 1017. It generates more than 200 output tokens per second, against about 80 on deepseekv4.1-flash-1017, so long answers and streamed replies finish sooner. It accepts the same requests, inputs, and parameters as deepseekv4.1-flash-1017; only the model ID changes.

Like the base model, the interactive variant is serverless: any API key can call it. One parameter differs: on Responses, the interactive variant accepts top_k, while deepseekv4.1-flash-1017 returns 400 for it. Both accept top_k on Chat Completion V2.

deepseekv4.1-flash-1017deepseekv4.1-flash-1017-interactive
Best forLong-document analysis and agentic workflows at the lowest priceWorkloads that need faster output, such as long answers or streaming to users
AccessServerless: any API keyServerless: any API key
Output speedAbout 80 tokens per secondMore than 200 tokens per second
Pricing (per 1M tokens)₹14 input · ₹0.25 cached input · ₹55 output (introductory, through the end of 2026)₹25 input · ₹0.5 cached input · ₹105 output

Quickstart

from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY")
response = client.chat.completions_v2(
model="deepseekv4.1-flash-1017",
messages=[
{
"role": "user",
"content": "Explain the difference between a B-tree and a B+ tree index.",
}
],
temperature=1,
top_p=0.95,
max_tokens=2000,
)
print(response.choices[0].message.content)

Supported parameters

model: "deepseekv4.1-flash-1017" on Chat Completion V2 and Responses. Full request/response schemas live on those API reference pages; this table covers what’s actually accepted for this model.

ParameterChat Completion V2Responses
Streaming (stream)
Tool calling (tools, tool_choice)
parallel_tool_calls: false enforced
Structured output (response_format / text.format)
Log probabilities (logprobs, top_logprobs) send top_logprobs with include: ["message.output_text.logprobs"]; logprobs: true returns 400
Multiple choices (n > 1) 400 400
Reasoning controlreasoning_effort: low, high (default), or maxreasoning.effort: same values
Turn reasoning off reasoning_effort: "none" reasoning.effort: "none"

400 is invalid_request_error.

Reasoning

DeepSeek V4.1 Flash 1017 has three reasoning modes, low, high, and max, and accepts all three directly on both APIs. It reasons at high when the field is omitted. minimal is served as low, and medium and xhigh are served as high.

RouteFieldAccepted values
Chat Completion V2reasoning_effort"low", "high" (default), or "max"
Responsesreasoning.effort"low", "high" (default), or "max"

This is different from GLM-5.3, where the Responses API rejects the literal string "max", DeepSeek V4.1 Flash 1017 has no such restriction.

Read the reasoning trace from choices[].message.reasoning_content on chat, or from the reasoning item’s content[0].text in output on Responses (summary is filled only when you set reasoning.summary). Reasoning tokens are billed as output tokens either way, and count against max_tokens on chat or max_output_tokens on Responses. Neither has a small default, so set them explicitly.

To turn reasoning off, set reasoning_effort: "none" on chat or reasoning.effort: "none" on Responses. On chat, thinking: {"type": "disabled"} and chat_template_kwargs: {"enable_thinking": false} (through extra_body in the SDKs) also work. The effort must be a string: an integer returns 400 (“‘reasoning_effort’ must be a string.”).

Image input

Send images inline as base64 data URIs only. Remote image URLs are rejected:

import base64
with open("chart.png", "rb") as f:
data_uri = "data:image/png;base64," + base64.b64encode(f.read()).decode()
response = client.chat.completions_v2(
model="deepseekv4.1-flash-1017",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Summarise this chart."},
{"type": "image_url", "image_url": {"url": data_uri}},
],
}
],
max_tokens=2000,
)

Known limitations

  • Reasoning and the final answer share the max_tokens / max_output_tokens budget. Raise the cap, or turn thinking off with reasoning_effort: "none", when needed.

Limits and errors

AreaLimit or conditionAPI responseRecommended action
ContextPrompt tokens plus max_tokens exceed 1,048,576400 invalid_request_errorShorten the prompt or reduce max_tokens.
Outputmax_tokens exceeds 1,048,576400 invalid_request_errorSet max_tokens within the context window.
Request sizeRequest body exceeds 32 MiB (33,554,432 bytes), on both deepseekv4.1-flash-1017 and deepseekv4.1-flash-1017-interactive413 invalid_request_error, with the limit in the messageReduce the request body; base64 images count toward the limit.
Image inputImage sent by URL instead of inline base64400 invalid_request_errorSend the image as a base64 data URI.
ModalityRequest includes audio or video input400 invalid_request_errorSend text or inline image input.
ReasoningReasoning consumes the full max_tokens budget200 with content: null and finish_reason: "length"Raise max_tokens or set reasoning_effort: "none".
ToolsA named tool_choice is provided without tools400 invalid_request_errorInclude the matching function in tools.
AuthenticationAPI key is missing or invalid403 invalid_api_key_errorCheck the api-subscription-key header.
ModelModel ID is unknown or unavailable404 not_found_errorConfirm the ID with GET /v2/models.
QuotaNo credits remain402 insufficient_quota_errorAdd credits in the dashboard.
Rate limitRequest or concurrency limit is exceeded429 rate_limit_exceeded_errorBack off and retry.
AvailabilityModel remains overloaded after retries503 model_overloadedRetry later.