Skip to navigation

DeepSeek V4.1 Flash 1017

Beta
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.

DeepSeek V4.1 Flash 1017 is in beta. Its behaviour, limits, and availability may change before general availability. Beta models must be enabled for your API key; without access, requests return 400 invalid_request_error (“This model is currently in beta”). Contact us to request access. See Beta models.

At a glance

Model IDdeepseekv4.1-flash-1017
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₹25 input · ₹0.5 cached input · ₹105 output per 1M tokens; 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.

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) requires temperature > 0 400
Reasoning controlreasoning_effort: low, high (default), or max, or an integer 1–100reasoning.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. Integer effort values from 1 to 100 are accepted as well.

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 10 MiB (10,485,760 bytes)413 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.