deepseek-ai/DeepSeek-V4.1-Flash
zetlyn/models-hf model hf deepseek-ai/DeepSeek-V4.1-Flash known 2026-09-10
https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash
Properties
| author | deepseek-aireceipt
What the source handed over{
"_asked": "deepseek-ai/DeepSeek-V4.1-Flash",
"_id": "6aa213563d5b3527359d1af2",
"author": "deepseek-ai",
"cardData": {
"library_name": "transformers",
"license": "mit",
"pipeline_tag": "image-text-to-text"
},
"config": {
"architectures": [
"DeepseekV41ForCausalLM"
],
"chat_template_jinja": "{#- DeepSeek-V4.1 chat template, ported from encoding/encoding.py in the model repo.\n Extra kwargs: thinking_mode (\"thinking\" | \"chat\", default \"thinking\"; enable_thinking=true/false is accepted\n as an alias), drop_thinking (default true), reasoning_effort (int in [1, 100] or \"low\"/\"medium\"/\"high\"/\"max\",\n default \"high\"). Assistant reasoning is read from reasoning_content, or from thinking as an alias. -#}\n{%- set IMG = \"<|deepseek_image|>\" -%}\n{%- set DSML = \"|DSML|\" -%}\n\n{%- if thinking_mode is not defined -%}\n {%- set thinking_mode = \"chat\" if (enable_thinking is defined and enable_thinking is not none and not enable_thinking) else \"thinking\" -%}\n{%- endif -%}\n{%- if thinking_mode not in [\"chat\", \"thinking\"] -%}\n {{- raise_exception(\"Invalid thinking_mode `\" ~ thinking_mode ~ \"`, should be \\\"chat\\\" or \\\"thinking\\\"\") -}}\n{%- endif -%}\n{%- if drop_thinking is not defined -%}{%- set drop_thinking = true -%}{%- endif -%}\n{%- if add_generation_prompt is not defined -%}{%- set add_generation_prompt = false -%}{%- endif -%}\n{%- if tools is not defined -%}{%- set tools = none -%}{%- endif -%}\n\n{%- if reasoning_effort is not defined or reasoning_effort is none -%}{%- set reasoning_effort = \"high\" -%}{%- endif -%}\n{%- set effort_map = {\"low\": 50, \"medium\": 62, \"high\": 75, \"max\": 100} -%}\n{%- if reasoning_effort is string and reasoning_effort in effort_map -%}\n {%- set budget = effort_map[reasoning_effort] -%}\n{%- elif reasoning_effort is integer and 1 <= reasoning_effort <= 100 -%}\n {%- set budget = reasoning_effort -%}\n{%- else -%}\n {{- raise_exception(\"Invalid reasoning effort: \" ~ reasoning_effort ~ \", should be int within [1,100] or one of \\\"low\\\", \\\"medium\\\", \\\"high\\\", \\\"max\\\"\") -}}\n{%- endif -%}\n\n{#- Text of text/image blocks joined by blank lines; other block types are dropped. -#}\n{%- macro joined_text(blocks) -%}\n {%- set jt = namespace(parts=[]) -%}\n {%- for b in blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set jt.parts = jt.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set jt.parts = jt.parts + [IMG] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- jt.parts | join(\"\\n\\n\") -}}\n{%- endmacro -%}\n\n{#- Splits/validates \"ns::name\" against an explicit namespace and returns the qualified name. -#}\n{%- macro qualified_name(name, ns) -%}\n {%- if ns is mapping -%}{%- set ns = ns.name -%}{%- endif -%}\n {%- set parts = name.split(\"::\", 1) -%}\n {%- if parts | length == 2 -%}\n {%- if ns is not none and ns != parts[0] -%}{{- raise_exception(\"Conflicting tool namespaces: \" ~ ns ~ \" != \" ~ parts[0]) -}}{%- endif -%}\n {%- set ns = parts[0] -%}\n {%- set name = parts[1] -%}\n {%- endif -%}\n {%- if \"::\" in name -%}{{- raise_exception(\"Tool name must not contain '::': \" ~ name) -}}{%- endif -%}\n {%- if ns is not none and \"::\" in ns -%}{{- raise_exception(\"Tool namespace must not contain '::': \" ~ ns) -}}{%- endif -%}\n {{- name if ns is none else ns ~ \"::\" ~ name -}}\n{%- endmacro -%}\n\n{%- macro render_tools(tool_list) -%}\n {%- set ts = namespace(schemas=[]) -%}\n {%- for tool in tool_list -%}\n {%- set fn = tool.function if tool.function is defined else tool -%}\n {%- set ns = tool.namespace if tool.namespace is defined and tool.namespace is not none else fn.get(\"namespace\") -%}\n {%- set schema = namespace(d={}) -%}\n {%- for k, v in fn.items() if k != \"namespace\" -%}{%- set schema.d = dict(schema.d, **{k: v}) -%}{%- endfor -%}\n {%- set schema.d = dict(schema.d, name=qualified_name(fn.name, ns)) -%}\n {%- if ns is mapping and ns.description -%}\n {%- set schema.d = dict(schema.d, description=ns.description ~ \"\\n\" ~ (fn.description or \"\")) -%}\n {%- endif -%}\n {%- set ts.schemas = ts.schemas + [schema.d | tojson] -%}\n {%- endfor -%}\n {{- \"## Tools\\n\\nYou have access to a set of tools to help answer the user's question. You can invoke tools by writing a \\\"<|DSML| calls>\\\" block like the following:\\n\\n<|DSML| calls>\\n<|DSML| invoke name=\\\"$TOOL_NAME\\\">\\n<|DSML| parameter name=\\\"$PARAMETER_NAME\\\" string=\\\"true|false\\\">$PARAMETER_VALUE</|DSML| parameter>\\n...\\n</|DSML| invoke>\\n<|DSML| invoke name=\\\"$TOOL_NAME2\\\">\\n...\\n</|DSML| invoke>\\n</|DSML| calls>\\n\\nString parameters should be specified as is and set `string=\\\"true\\\"`. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string=\\\"false\\\"`.\\n\\nIf thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.\\n\\nOtherwise, output directly after </think> with tool calls or final response.\\n\\n### Available Tool Schemas\\n\\n\" -}}\n {{- ts.schemas | join(\"\\n\") -}}\n {{- \"\\n\\nYou MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls.\\n\" -}}\n{%- endmacro -%}\n\n{#- 1. Merge tool results (and consecutive user turns) into user messages made of content blocks. -#}\n{%- set mns = namespace(list=[]) -%}\n{%- for msg in messages -%}\n {%- set content = msg.get(\"content\") -%}\n {%- set is_blocks = content is iterable and content is not string and content is not mapping -%}\n {%- if content is string and IMG in content -%}\n {{- raise_exception(\"Message content contains image special token \" ~ IMG ~ \". Images should be provided as image content blocks.\") -}}\n {%- endif -%}\n {%- set rc = msg.reasoning_content if msg.get(\"reasoning_content\") is not none else msg.get(\"thinking\") -%}\n {%- if rc is string and IMG in rc -%}\n {{- raise_exception(\"reasoning_content contains image special token \" ~ IMG) -}}\n {%- endif -%}\n {%- set prev = mns.list[-1] if mns.list else none -%}\n {%- if msg.role == \"tool\" -%}\n {%- set tblock = {\"type\": \"tool_result\", \"tool_use_id\": msg.get(\"tool_call_id\", \"\"), \"content\": joined_text(content) if is_blocks else msg.get(\"content\", \"\")} -%}\n {%- if prev is not none and prev.role == \"user\" -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + [tblock])] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [{\"role\": \"user\", \"content_blocks\": [tblock]}] -%}\n {%- endif -%}\n {%- elif msg.role == \"user\" -%}\n {%- set blocks = content if is_blocks else [{\"type\": \"text\", \"text\": content or \"\"}] -%}\n {%- if prev is not none and prev.role == \"user\" and prev.get(\"task\") is none -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + blocks)] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [dict(msg, content_blocks=blocks)] -%}\n {%- endif -%}\n {%- else -%}\n {%- set mns.list = mns.list + [msg] -%}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Top-level tools attach to a leading system message, or to a new empty one. -#}\n{%- if tools -%}\n {%- if mns.list and mns.list[0].role == \"system\" -%}\n {%- if not mns.list[0].get(\"tools\") -%}{%- set mns.list = [dict(mns.list[0], tools=tools)] + mns.list[1:] -%}{%- endif -%}\n {%- else -%}\n {%- set mns.list = [{\"role\": \"system\", \"content\": \"\", \"tools\": tools}] + mns.list -%}\n {%- endif -%}\n{%- endif -%}\n\n{#- 2. Reorder tool results to match the tool_calls order of the preceding assistant message. -#}\n{%- set sns = namespace(list=[], ids=[]) -%}\n{%- for m in mns.list -%}\n {%- if m.role == \"assistant\" and m.get(\"tool_calls\") -%}\n {%- set sns.ids = [] -%}\n {%- for tc in m.tool_calls -%}\n {%- set sns.ids = sns.ids + [tc.get(\"id\") or tc.get(\"function\", {}).get(\"id\", \"\")] -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- elif m.role == \"user\" and m.content_blocks -%}\n {%- set tb = namespace(blocks=[]) -%}\n {%- for b in m.content_blocks if b.type == \"tool_result\" -%}\n {%- set order = namespace(idx=0) -%}\n {%- for tc_id in sns.ids -%}\n {%- if tc_id and tc_id == b.get(\"tool_use_id\", \"\") -%}{%- set order.idx = loop.index0 -%}{%- endif -%}\n {%- endfor -%}\n {%- set tb.blocks = tb.blocks + [dict(b, _order=order.idx)] -%}\n {%- endfor -%}\n {%- if tb.blocks | length > 1 -%}\n {%- set sorted_blocks = tb.blocks | sort(attribute=\"_order\") -%}\n {%- set rb = namespace(blocks=[], i=0) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"tool_result\" -%}\n {%- set rb.blocks = rb.blocks + [sorted_blocks[rb.i]] -%}\n {%- set rb.i = rb.i + 1 -%}\n {%- else -%}\n {%- set rb.blocks = rb.blocks + [b] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [dict(m, content_blocks=rb.blocks)] -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n{%- endfor -%}\n{%- set msgs = sns.list -%}\n\n{#- Mid-conversation system messages count as user turns. Tools anywhere disable drop_thinking. -#}\n{%- set state = namespace(last_user=-1, has_tools=false) -%}\n{%- for m in msgs -%}\n {%- if m.role == \"user\" or (m.role == \"system\" and loop.index0 > 0) -%}{%- set state.last_user = loop.index0 -%}{%- endif -%}\n {%- if m.get(\"tools\") -%}{%- set state.has_tools = true -%}{%- endif -%}\n{%- endfor -%}\n{%- set effective_drop = drop_thinking and not state.has_tools -%}\n{%- set thinking = thinking_mode == \"thinking\" -%}\n\n{{- \"<|begin▁of▁sentence|>\" -}}\n{#- 3. Render each message. -#}\n{%- for m in msgs -%}\n {%- set idx = loop.index0 -%}\n {%- set content = m.get(\"content\") -%}\n {%- if content is iterable and content is not string and content is not mapping -%}{%- set content = joined_text(content) -%}{%- endif -%}\n\n {%- if idx == 0 -%}\n {%- if thinking or m.role == \"system\" -%}{{- \"<|System|>\" -}}{%- endif -%}\n {%- if thinking -%}{{- \"Reasoning Effort: \" ~ budget ~ \" (range 1-100, the higher the value, the more thorough the reasoning)\\n\\n\" -}}{%- endif -%}\n {%- endif -%}\n\n {%- if m.role == \"system\" -%}\n {%- if idx > 0 -%}{{- \"<|System|>\" -}}{%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tools\") -%}{{- \"\\n\\n\" ~ render_tools(m.tools) -}}{%- endif -%}\n {%- if m.get(\"response_format\") -%}\n {{- \"\\n\\n## Response Format:\\n\\nYou MUST strictly adhere to the following schema to reply:\\n\" ~ (m.response_format | tojson) -}}\n {%- endif -%}\n\n {%- elif m.role == \"user\" -%}\n {{- \"<|User|>\" -}}\n {%- set up = namespace(parts=[]) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set up.parts = up.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set up.parts = up.parts + [IMG] -%}\n {%- elif b.type == \"tool_result\" -%}\n {%- set tc = b.get(\"content\", \"\") -%}\n {%- if tc is iterable and tc is not string and tc is not mapping -%}\n {%- set sub = namespace(parts=[]) -%}\n {%- for s in tc -%}\n {%- if s.type == \"text\" -%}{%- set sub.parts = sub.parts + [s.get(\"text\", \"\")] -%}\n {%- elif s.type in [\"image\", \"image_url\"] -%}{%- set sub.parts = sub.parts + [IMG] -%}\n {%- else -%}{%- set sub.parts = sub.parts + [\"[Unsupported \" ~ s.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set tc = sub.parts | join(\"\\n\\n\") -%}\n {%- endif -%}\n {%- set up.parts = up.parts + [\"<tool_result>\" ~ tc ~ \"</tool_result>\"] -%}\n {%- else -%}\n {%- set up.parts = up.parts + [\"[Unsupported \" ~ b.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- up.parts | join(\"\\n\\n\") -}}\n\n {%- elif m.role == \"latest_reminder\" -%}\n {{- \"<|latest_reminder|>\" ~ content -}}\n\n {%- elif m.role == \"assistant\" -%}\n {%- set prev_has_task = idx > 0 and msgs[idx - 1].get(\"task\") is not none -%}\n {%- if thinking and not prev_has_task and (not effective_drop or idx > state.last_user) -%}\n {{- ((m.reasoning_content if m.get(\"reasoning_content\") is not none else m.get(\"thinking\")) or \"\") ~ \"</think>\" -}}\n {%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tool_calls\") -%}\n {%- set tcs = namespace(lines=[]) -%}\n {%- for tc in m.tool_calls -%}\n {%- set fn = tc.function -%}\n {%- set params = namespace(lines=[]) -%}\n {%- set args = fn.arguments if fn.arguments is mapping else {\"arguments\": fn.arguments} -%}\n {%- for k, v in args.items() -%}\n {%- set params.lines = params.lines + [\"<\" ~ DSML ~ \" parameter name=\\\"\" ~ k ~ \"\\\" string=\\\"\" ~ (\"true\" if v is string else \"false\") ~ \"\\\">\" ~ (v if v is string else v | tojson) ~ \"</\" ~ DSML ~ \" parameter>\"] -%}\n {%- endfor -%}\n {%- set name = qualified_name(fn.name, tc.get(\"namespace\") or fn.get(\"namespace\")) -%}\n {%- set tcs.lines = tcs.lines + [\"<\" ~ DSML ~ \" invoke name=\\\"\" ~ name ~ \"\\\">\\n\" ~ params.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" invoke>\"] -%}\n {%- endfor -%}\n {{- \"\\n\\n<\" ~ DSML ~ \" calls>\\n\" ~ tcs.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" calls>\" -}}\n {%- endif -%}\n {%- if not m.get(\"wo_eos\", false) -%}{{- \"<|end▁of▁sentence|>\" -}}{%- endif -%}\n\n {%- else -%}\n {{- raise_exception(\"Unknown role: \" ~ m.role) -}}\n {%- endif -%}\n\n {#- Transition tokens, only when the next message is an assistant/latest_reminder turn or this is the last one. -#}\n {%- if loop.last or msgs[idx + 1].role in [\"assistant\", \"latest_reminder\"] -%}\n {%- set task = m.get(\"task\") -%}\n {%- if task is not none -%}\n {%- set task_tokens = {\"action\": \"<|action|>\", \"query\": \"<|query|>\", \"authority\": \"<|authority|>\", \"domain\": \"<|domain|>\", \"title\": \"<|title|>\", \"read_url\": \"<|read_url|>\"} -%}\n {%- if task not in task_tokens -%}{{- raise_exception(\"Invalid task: '\" ~ task ~ \"'\") -}}{%- endif -%}\n {%- if task == \"action\" -%}{{- \"<|Assistant|>\" ~ (\"<think>\" if thinking else \"</think>\") -}}{%- endif -%}\n {{- task_tokens[task] -}}\n {%- elif (m.role == \"user\" or (m.role == \"system\" and idx > 0)) and (add_generation_prompt or not loop.last) -%}\n {{- \"<|Assistant|>\" ~ (\"<think>\" if thinking and (not effective_drop or idx >= state.last_user) else \"</think>\") -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n",
"model_type": "deepseek_v41",
"quantization_config": {
"quant_method": "fp8"
},
"tokenizer_config": {
"bos_token": {
"__type": "AddedToken",
"content": "<|begin▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"eos_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"unk_token": null
}
},
"createdAt": "2026-09-10T02:17:58.000Z",
"disabled": false,
"downloads": 798422,
"gated": false,
"id": "deepseek-ai/DeepSeek-V4.1-Flash",
"inference": "warm",
"lastModified": "2026-10-01T05:56:24.000Z",
"library_name": "transformers",
"likes": 4073,
"model-index": null,
"modelId": "deepseek-ai/DeepSeek-V4.1-Flash",
"pipeline_tag": "image-text-to-text",
"private": false,
"safetensors": {
"parameters": {
"BF16": 1976441856,
"F32": 42307282,
"F8_E4M3": 204015223296,
"I8": 557171343360
},
"total": 763205315794
},
"sha": "2cba9e42aa026125f3ed06c6d98c1db82f7ca027",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "DeepSeek_V41_Tech_Report.pdf"
},
{
"rfilename": "LICENSE"
},
{
"rfilename": "README.md"
},
{
"rfilename": "assets/dsv41_agentic_performance.png"
},
{
"rfilename": "assets/dsv41_kv_cache.png"
},
{
"rfilename": "chat_template.jinja"
},
{
"rfilename": "config.json"
},
{
"rfilename": "encoding/README.md"
},
{
"rfilename": "encoding/encoding.py"
},
{
"rfilename": "encoding/test_encoding.py"
},
{
"rfilename": "encoding/tests/test_input_1.json"
},
{
"rfilename": "encoding/tests/test_input_2.json"
},
{
"rfilename": "encoding/tests/test_input_3.json"
},
{
"rfilename": "encoding/tests/test_input_4.json"
},
{
"rfilename": "encoding/tests/test_input_5.json"
},
{
"rfilename": "encoding/tests/test_output_1.txt"
},
{
"rfilename": "encoding/tests/test_output_2.txt"
},
{
"rfilename": "encoding/tests/test_output_3.txt"
},
{
"rfilename": "encoding/tests/test_output_4.txt"
},
{
"rfilename": "encoding/tests/test_output_5.txt"
},
{
"rfilename": "evaluation/README.md"
},
{
"rfilename": "evaluation/dsh-minimal.patch"
},
{
"rfilename": "inference/README.md"
},
{
"rfilename": "inference/config.json"
},
{
"rfilename": "inference/convert.py"
},
{
"rfilename": "inference/engram.py"
},
{
"rfilename": "inference/examples/example.txt"
},
{
"rfilename": "inference/examples/example_harmony.json"
},
{
"rfilename": "inference/examples/images/carrots.jpeg"
},
{
"rfilename": "inference/examples/images/corn.jpeg"
},
{
"rfilename": "inference/generate.py"
},
{
"rfilename": "inference/image_processor.py"
},
{
"rfilename": "inference/kernel.py"
},
{
"rfilename": "inference/model.py"
},
{
"rfilename": "inference/requirements.txt"
},
{
"rfilename": "inference/run.sh"
},
{
"rfilename": "inference/vision.py"
},
{
"rfilename": "model-00001-of-00048.safetensors"
},
{
"rfilename": "model-00002-of-00048.safetensors"
},
{
"rfilename": "model-00003-of-00048.safetensors"
},
{
"rfilename": "model-00004-of-00048.safetensors"
},
{
"rfilename": "model-00005-of-00048.safetensors"
},
{
"rfilename": "model-00006-of-00048.safetensors"
},
{
"rfilename": "model-00007-of-00048.safetensors"
},
{
"rfilename": "model-00008-of-00048.safetensors"
},
{
"rfilename": "model-00009-of-00048.safetensors"
},
{
"rfilename": "model-00010-of-00048.safetensors"
},
{
"rfilename": "model-00011-of-00048.safetensors"
},
{
"rfilename": "model-00012-of-00048.safetensors"
},
{
"rfilename": "model-00013-of-00048.safetensors"
},
{
"rfilename": "model-00014-of-00048.safetensors"
},
{
"rfilename": "model-00015-of-00048.safetensors"
},
{
"rfilename": "model-00016-of-00048.safetensors"
},
{
"rfilename": "model-00017-of-00048.safetensors"
},
{
"rfilename": "model-00018-of-00048.safetensors"
},
{
"rfilename": "model-00019-of-00048.safetensors"
},
{
"rfilename": "model-00020-of-00048.safetensors"
},
{
"rfilename": "model-00021-of-00048.safetensors"
},
{
"rfilename": "model-00022-of-00048.safetensors"
},
{
"rfilename": "model-00023-of-00048.safetensors"
},
{
"rfilename": "model-00024-of-00048.safetensors"
},
{
"rfilename": "model-00025-of-00048.safetensors"
},
{
"rfilename": "model-00026-of-00048.safetensors"
},
{
"rfilename": "model-00027-of-00048.safetensors"
},
{
"rfilename": "model-00028-of-00048.safetensors"
},
{
"rfilename": "model-00029-of-00048.safetensors"
},
{
"rfilename": "model-00030-of-00048.safetensors"
},
{
"rfilename": "model-00031-of-00048.safetensors"
},
{
"rfilename": "model-00032-of-00048.safetensors"
},
{
"rfilename": "model-00033-of-00048.safetensors"
},
{
"rfilename": "model-00034-of-00048.safetensors"
},
{
"rfilename": "model-00035-of-00048.safetensors"
},
{
"rfilename": "model-00036-of-00048.safetensors"
},
{
"rfilename": "model-00037-of-00048.safetensors"
},
{
"rfilename": "model-00038-of-00048.safetensors"
},
{
"rfilename": "model-00039-of-00048.safetensors"
},
{
"rfilename": "model-00040-of-00048.safetensors"
},
{
"rfilename": "model-00041-of-00048.safetensors"
},
{
"rfilename": "model-00042-of-00048.safetensors"
},
{
"rfilename": "model-00043-of-00048.safetensors"
},
{
"rfilename": "model-00044-of-00048.safetensors"
},
{
"rfilename": "model-00045-of-00048.safetensors"
},
{
"rfilename": "model-00046-of-00048.safetensors"
},
{
"rfilename": "model-00047-of-00048.safetensors"
},
{
"rfilename": "model-00048-of-00048.safetensors"
},
{
"rfilename": "model.safetensors.index.json"
},
{
"rfilename": "tokenizer.json"
},
{
"rfilename": "tokenizer_config.json"
}
],
"spaces": [
"embedl/hfviewer",
"tardellirs/model-pulse",
"ginigen-ai/open-router-leaderboard",
"VIDraft/global-llm-leaderboard",
"zoom-ai/hle-leaderboard",
"lvwerra/agent-artifacts",
"townbox/deepseek-profile-guide",
"bagegegegw/DeepSeek-V4.1-Flash-UNCENSORED-Demo",
"akhaliq/DeepSeek-V4.1-Flash",
"yash-711/deepseek-v41-flash-fit",
"jkorstad/daggr-studio",
"yash-711/what-fits-84gb",
"gonduras/DeepSeek-V4.1-Flash-Demo",
"shareefmx/pdf-knowledge-assistant",
"mzubair-dh/loagaeth-extractor",
"Bob3432433/DeepSeek-V4-Flash",
"Mullernorth/Klaw",
"BhDirty555/OmniForge-AI",
"SZLHOLDINGS/szl-frontier",
"brian-learns/poor-richard",
"kokabtak/kokb1-static",
"venichole/deepseek-v4-1-flash-demo",
"Uwaish/emailwriter",
"Mullernorth/Nimo",
"MrVolts/agents-den",
"gonduras/deepseek-v4-1-flash-demo",
"Joshua56/deepseek-v4-1-flash-demo",
"cookiemonster778/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"leadupapp/deepseek-v41-flash-demo",
"BunsDev/DeepSeek-V4.1-Flash-Demo",
"timmaythetoolmann/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"chizkuhhh/Final_Assignment_Template",
"ggautreau/PanGramGraph",
"MALBIATY/Assignmentunit8",
"rurrence/deepseek-v41-flash-endpoint",
"yeeeeezus/inference",
"pymmdrza/DeepSeek-V4.1-Flash-Demo",
"sergiopaniego/tau2-env",
"TorkeHub/torki-2-benchmarks",
"Cenzer0/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"FineEnvs/RL-Explorer"
],
"tags": [
"transformers",
"safetensors",
"deepseek_v41",
"text-generation",
"image-text-to-text",
"conversational",
"license:mit",
"eval-results",
"endpoints_compatible",
"8-bit",
"fp8",
"region:us"
],
"transformersInfo": {
"auto_model": "AutoModelForCausalLM",
"pipeline_tag": "text-generation"
},
"usedStorage": 510311613821,
"widgetData": [
{
"text": "Hi, what can you help me with?"
},
{
"text": "What is 84 * 3 / 2?"
},
{
"text": "Tell me an interesting fact about the universe!"
},
{
"text": "Explain quantum computing in simple terms."
}
]
} | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| downloads | 798422receipt
What the source handed over{
"_asked": "deepseek-ai/DeepSeek-V4.1-Flash",
"_id": "6aa213563d5b3527359d1af2",
"author": "deepseek-ai",
"cardData": {
"library_name": "transformers",
"license": "mit",
"pipeline_tag": "image-text-to-text"
},
"config": {
"architectures": [
"DeepseekV41ForCausalLM"
],
"chat_template_jinja": "{#- DeepSeek-V4.1 chat template, ported from encoding/encoding.py in the model repo.\n Extra kwargs: thinking_mode (\"thinking\" | \"chat\", default \"thinking\"; enable_thinking=true/false is accepted\n as an alias), drop_thinking (default true), reasoning_effort (int in [1, 100] or \"low\"/\"medium\"/\"high\"/\"max\",\n default \"high\"). Assistant reasoning is read from reasoning_content, or from thinking as an alias. -#}\n{%- set IMG = \"<|deepseek_image|>\" -%}\n{%- set DSML = \"|DSML|\" -%}\n\n{%- if thinking_mode is not defined -%}\n {%- set thinking_mode = \"chat\" if (enable_thinking is defined and enable_thinking is not none and not enable_thinking) else \"thinking\" -%}\n{%- endif -%}\n{%- if thinking_mode not in [\"chat\", \"thinking\"] -%}\n {{- raise_exception(\"Invalid thinking_mode `\" ~ thinking_mode ~ \"`, should be \\\"chat\\\" or \\\"thinking\\\"\") -}}\n{%- endif -%}\n{%- if drop_thinking is not defined -%}{%- set drop_thinking = true -%}{%- endif -%}\n{%- if add_generation_prompt is not defined -%}{%- set add_generation_prompt = false -%}{%- endif -%}\n{%- if tools is not defined -%}{%- set tools = none -%}{%- endif -%}\n\n{%- if reasoning_effort is not defined or reasoning_effort is none -%}{%- set reasoning_effort = \"high\" -%}{%- endif -%}\n{%- set effort_map = {\"low\": 50, \"medium\": 62, \"high\": 75, \"max\": 100} -%}\n{%- if reasoning_effort is string and reasoning_effort in effort_map -%}\n {%- set budget = effort_map[reasoning_effort] -%}\n{%- elif reasoning_effort is integer and 1 <= reasoning_effort <= 100 -%}\n {%- set budget = reasoning_effort -%}\n{%- else -%}\n {{- raise_exception(\"Invalid reasoning effort: \" ~ reasoning_effort ~ \", should be int within [1,100] or one of \\\"low\\\", \\\"medium\\\", \\\"high\\\", \\\"max\\\"\") -}}\n{%- endif -%}\n\n{#- Text of text/image blocks joined by blank lines; other block types are dropped. -#}\n{%- macro joined_text(blocks) -%}\n {%- set jt = namespace(parts=[]) -%}\n {%- for b in blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set jt.parts = jt.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set jt.parts = jt.parts + [IMG] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- jt.parts | join(\"\\n\\n\") -}}\n{%- endmacro -%}\n\n{#- Splits/validates \"ns::name\" against an explicit namespace and returns the qualified name. -#}\n{%- macro qualified_name(name, ns) -%}\n {%- if ns is mapping -%}{%- set ns = ns.name -%}{%- endif -%}\n {%- set parts = name.split(\"::\", 1) -%}\n {%- if parts | length == 2 -%}\n {%- if ns is not none and ns != parts[0] -%}{{- raise_exception(\"Conflicting tool namespaces: \" ~ ns ~ \" != \" ~ parts[0]) -}}{%- endif -%}\n {%- set ns = parts[0] -%}\n {%- set name = parts[1] -%}\n {%- endif -%}\n {%- if \"::\" in name -%}{{- raise_exception(\"Tool name must not contain '::': \" ~ name) -}}{%- endif -%}\n {%- if ns is not none and \"::\" in ns -%}{{- raise_exception(\"Tool namespace must not contain '::': \" ~ ns) -}}{%- endif -%}\n {{- name if ns is none else ns ~ \"::\" ~ name -}}\n{%- endmacro -%}\n\n{%- macro render_tools(tool_list) -%}\n {%- set ts = namespace(schemas=[]) -%}\n {%- for tool in tool_list -%}\n {%- set fn = tool.function if tool.function is defined else tool -%}\n {%- set ns = tool.namespace if tool.namespace is defined and tool.namespace is not none else fn.get(\"namespace\") -%}\n {%- set schema = namespace(d={}) -%}\n {%- for k, v in fn.items() if k != \"namespace\" -%}{%- set schema.d = dict(schema.d, **{k: v}) -%}{%- endfor -%}\n {%- set schema.d = dict(schema.d, name=qualified_name(fn.name, ns)) -%}\n {%- if ns is mapping and ns.description -%}\n {%- set schema.d = dict(schema.d, description=ns.description ~ \"\\n\" ~ (fn.description or \"\")) -%}\n {%- endif -%}\n {%- set ts.schemas = ts.schemas + [schema.d | tojson] -%}\n {%- endfor -%}\n {{- \"## Tools\\n\\nYou have access to a set of tools to help answer the user's question. You can invoke tools by writing a \\\"<|DSML| calls>\\\" block like the following:\\n\\n<|DSML| calls>\\n<|DSML| invoke name=\\\"$TOOL_NAME\\\">\\n<|DSML| parameter name=\\\"$PARAMETER_NAME\\\" string=\\\"true|false\\\">$PARAMETER_VALUE</|DSML| parameter>\\n...\\n</|DSML| invoke>\\n<|DSML| invoke name=\\\"$TOOL_NAME2\\\">\\n...\\n</|DSML| invoke>\\n</|DSML| calls>\\n\\nString parameters should be specified as is and set `string=\\\"true\\\"`. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string=\\\"false\\\"`.\\n\\nIf thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.\\n\\nOtherwise, output directly after </think> with tool calls or final response.\\n\\n### Available Tool Schemas\\n\\n\" -}}\n {{- ts.schemas | join(\"\\n\") -}}\n {{- \"\\n\\nYou MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls.\\n\" -}}\n{%- endmacro -%}\n\n{#- 1. Merge tool results (and consecutive user turns) into user messages made of content blocks. -#}\n{%- set mns = namespace(list=[]) -%}\n{%- for msg in messages -%}\n {%- set content = msg.get(\"content\") -%}\n {%- set is_blocks = content is iterable and content is not string and content is not mapping -%}\n {%- if content is string and IMG in content -%}\n {{- raise_exception(\"Message content contains image special token \" ~ IMG ~ \". Images should be provided as image content blocks.\") -}}\n {%- endif -%}\n {%- set rc = msg.reasoning_content if msg.get(\"reasoning_content\") is not none else msg.get(\"thinking\") -%}\n {%- if rc is string and IMG in rc -%}\n {{- raise_exception(\"reasoning_content contains image special token \" ~ IMG) -}}\n {%- endif -%}\n {%- set prev = mns.list[-1] if mns.list else none -%}\n {%- if msg.role == \"tool\" -%}\n {%- set tblock = {\"type\": \"tool_result\", \"tool_use_id\": msg.get(\"tool_call_id\", \"\"), \"content\": joined_text(content) if is_blocks else msg.get(\"content\", \"\")} -%}\n {%- if prev is not none and prev.role == \"user\" -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + [tblock])] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [{\"role\": \"user\", \"content_blocks\": [tblock]}] -%}\n {%- endif -%}\n {%- elif msg.role == \"user\" -%}\n {%- set blocks = content if is_blocks else [{\"type\": \"text\", \"text\": content or \"\"}] -%}\n {%- if prev is not none and prev.role == \"user\" and prev.get(\"task\") is none -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + blocks)] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [dict(msg, content_blocks=blocks)] -%}\n {%- endif -%}\n {%- else -%}\n {%- set mns.list = mns.list + [msg] -%}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Top-level tools attach to a leading system message, or to a new empty one. -#}\n{%- if tools -%}\n {%- if mns.list and mns.list[0].role == \"system\" -%}\n {%- if not mns.list[0].get(\"tools\") -%}{%- set mns.list = [dict(mns.list[0], tools=tools)] + mns.list[1:] -%}{%- endif -%}\n {%- else -%}\n {%- set mns.list = [{\"role\": \"system\", \"content\": \"\", \"tools\": tools}] + mns.list -%}\n {%- endif -%}\n{%- endif -%}\n\n{#- 2. Reorder tool results to match the tool_calls order of the preceding assistant message. -#}\n{%- set sns = namespace(list=[], ids=[]) -%}\n{%- for m in mns.list -%}\n {%- if m.role == \"assistant\" and m.get(\"tool_calls\") -%}\n {%- set sns.ids = [] -%}\n {%- for tc in m.tool_calls -%}\n {%- set sns.ids = sns.ids + [tc.get(\"id\") or tc.get(\"function\", {}).get(\"id\", \"\")] -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- elif m.role == \"user\" and m.content_blocks -%}\n {%- set tb = namespace(blocks=[]) -%}\n {%- for b in m.content_blocks if b.type == \"tool_result\" -%}\n {%- set order = namespace(idx=0) -%}\n {%- for tc_id in sns.ids -%}\n {%- if tc_id and tc_id == b.get(\"tool_use_id\", \"\") -%}{%- set order.idx = loop.index0 -%}{%- endif -%}\n {%- endfor -%}\n {%- set tb.blocks = tb.blocks + [dict(b, _order=order.idx)] -%}\n {%- endfor -%}\n {%- if tb.blocks | length > 1 -%}\n {%- set sorted_blocks = tb.blocks | sort(attribute=\"_order\") -%}\n {%- set rb = namespace(blocks=[], i=0) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"tool_result\" -%}\n {%- set rb.blocks = rb.blocks + [sorted_blocks[rb.i]] -%}\n {%- set rb.i = rb.i + 1 -%}\n {%- else -%}\n {%- set rb.blocks = rb.blocks + [b] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [dict(m, content_blocks=rb.blocks)] -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n{%- endfor -%}\n{%- set msgs = sns.list -%}\n\n{#- Mid-conversation system messages count as user turns. Tools anywhere disable drop_thinking. -#}\n{%- set state = namespace(last_user=-1, has_tools=false) -%}\n{%- for m in msgs -%}\n {%- if m.role == \"user\" or (m.role == \"system\" and loop.index0 > 0) -%}{%- set state.last_user = loop.index0 -%}{%- endif -%}\n {%- if m.get(\"tools\") -%}{%- set state.has_tools = true -%}{%- endif -%}\n{%- endfor -%}\n{%- set effective_drop = drop_thinking and not state.has_tools -%}\n{%- set thinking = thinking_mode == \"thinking\" -%}\n\n{{- \"<|begin▁of▁sentence|>\" -}}\n{#- 3. Render each message. -#}\n{%- for m in msgs -%}\n {%- set idx = loop.index0 -%}\n {%- set content = m.get(\"content\") -%}\n {%- if content is iterable and content is not string and content is not mapping -%}{%- set content = joined_text(content) -%}{%- endif -%}\n\n {%- if idx == 0 -%}\n {%- if thinking or m.role == \"system\" -%}{{- \"<|System|>\" -}}{%- endif -%}\n {%- if thinking -%}{{- \"Reasoning Effort: \" ~ budget ~ \" (range 1-100, the higher the value, the more thorough the reasoning)\\n\\n\" -}}{%- endif -%}\n {%- endif -%}\n\n {%- if m.role == \"system\" -%}\n {%- if idx > 0 -%}{{- \"<|System|>\" -}}{%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tools\") -%}{{- \"\\n\\n\" ~ render_tools(m.tools) -}}{%- endif -%}\n {%- if m.get(\"response_format\") -%}\n {{- \"\\n\\n## Response Format:\\n\\nYou MUST strictly adhere to the following schema to reply:\\n\" ~ (m.response_format | tojson) -}}\n {%- endif -%}\n\n {%- elif m.role == \"user\" -%}\n {{- \"<|User|>\" -}}\n {%- set up = namespace(parts=[]) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set up.parts = up.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set up.parts = up.parts + [IMG] -%}\n {%- elif b.type == \"tool_result\" -%}\n {%- set tc = b.get(\"content\", \"\") -%}\n {%- if tc is iterable and tc is not string and tc is not mapping -%}\n {%- set sub = namespace(parts=[]) -%}\n {%- for s in tc -%}\n {%- if s.type == \"text\" -%}{%- set sub.parts = sub.parts + [s.get(\"text\", \"\")] -%}\n {%- elif s.type in [\"image\", \"image_url\"] -%}{%- set sub.parts = sub.parts + [IMG] -%}\n {%- else -%}{%- set sub.parts = sub.parts + [\"[Unsupported \" ~ s.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set tc = sub.parts | join(\"\\n\\n\") -%}\n {%- endif -%}\n {%- set up.parts = up.parts + [\"<tool_result>\" ~ tc ~ \"</tool_result>\"] -%}\n {%- else -%}\n {%- set up.parts = up.parts + [\"[Unsupported \" ~ b.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- up.parts | join(\"\\n\\n\") -}}\n\n {%- elif m.role == \"latest_reminder\" -%}\n {{- \"<|latest_reminder|>\" ~ content -}}\n\n {%- elif m.role == \"assistant\" -%}\n {%- set prev_has_task = idx > 0 and msgs[idx - 1].get(\"task\") is not none -%}\n {%- if thinking and not prev_has_task and (not effective_drop or idx > state.last_user) -%}\n {{- ((m.reasoning_content if m.get(\"reasoning_content\") is not none else m.get(\"thinking\")) or \"\") ~ \"</think>\" -}}\n {%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tool_calls\") -%}\n {%- set tcs = namespace(lines=[]) -%}\n {%- for tc in m.tool_calls -%}\n {%- set fn = tc.function -%}\n {%- set params = namespace(lines=[]) -%}\n {%- set args = fn.arguments if fn.arguments is mapping else {\"arguments\": fn.arguments} -%}\n {%- for k, v in args.items() -%}\n {%- set params.lines = params.lines + [\"<\" ~ DSML ~ \" parameter name=\\\"\" ~ k ~ \"\\\" string=\\\"\" ~ (\"true\" if v is string else \"false\") ~ \"\\\">\" ~ (v if v is string else v | tojson) ~ \"</\" ~ DSML ~ \" parameter>\"] -%}\n {%- endfor -%}\n {%- set name = qualified_name(fn.name, tc.get(\"namespace\") or fn.get(\"namespace\")) -%}\n {%- set tcs.lines = tcs.lines + [\"<\" ~ DSML ~ \" invoke name=\\\"\" ~ name ~ \"\\\">\\n\" ~ params.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" invoke>\"] -%}\n {%- endfor -%}\n {{- \"\\n\\n<\" ~ DSML ~ \" calls>\\n\" ~ tcs.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" calls>\" -}}\n {%- endif -%}\n {%- if not m.get(\"wo_eos\", false) -%}{{- \"<|end▁of▁sentence|>\" -}}{%- endif -%}\n\n {%- else -%}\n {{- raise_exception(\"Unknown role: \" ~ m.role) -}}\n {%- endif -%}\n\n {#- Transition tokens, only when the next message is an assistant/latest_reminder turn or this is the last one. -#}\n {%- if loop.last or msgs[idx + 1].role in [\"assistant\", \"latest_reminder\"] -%}\n {%- set task = m.get(\"task\") -%}\n {%- if task is not none -%}\n {%- set task_tokens = {\"action\": \"<|action|>\", \"query\": \"<|query|>\", \"authority\": \"<|authority|>\", \"domain\": \"<|domain|>\", \"title\": \"<|title|>\", \"read_url\": \"<|read_url|>\"} -%}\n {%- if task not in task_tokens -%}{{- raise_exception(\"Invalid task: '\" ~ task ~ \"'\") -}}{%- endif -%}\n {%- if task == \"action\" -%}{{- \"<|Assistant|>\" ~ (\"<think>\" if thinking else \"</think>\") -}}{%- endif -%}\n {{- task_tokens[task] -}}\n {%- elif (m.role == \"user\" or (m.role == \"system\" and idx > 0)) and (add_generation_prompt or not loop.last) -%}\n {{- \"<|Assistant|>\" ~ (\"<think>\" if thinking and (not effective_drop or idx >= state.last_user) else \"</think>\") -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n",
"model_type": "deepseek_v41",
"quantization_config": {
"quant_method": "fp8"
},
"tokenizer_config": {
"bos_token": {
"__type": "AddedToken",
"content": "<|begin▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"eos_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"unk_token": null
}
},
"createdAt": "2026-09-10T02:17:58.000Z",
"disabled": false,
"downloads": 798422,
"gated": false,
"id": "deepseek-ai/DeepSeek-V4.1-Flash",
"inference": "warm",
"lastModified": "2026-10-01T05:56:24.000Z",
"library_name": "transformers",
"likes": 4073,
"model-index": null,
"modelId": "deepseek-ai/DeepSeek-V4.1-Flash",
"pipeline_tag": "image-text-to-text",
"private": false,
"safetensors": {
"parameters": {
"BF16": 1976441856,
"F32": 42307282,
"F8_E4M3": 204015223296,
"I8": 557171343360
},
"total": 763205315794
},
"sha": "2cba9e42aa026125f3ed06c6d98c1db82f7ca027",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "DeepSeek_V41_Tech_Report.pdf"
},
{
"rfilename": "LICENSE"
},
{
"rfilename": "README.md"
},
{
"rfilename": "assets/dsv41_agentic_performance.png"
},
{
"rfilename": "assets/dsv41_kv_cache.png"
},
{
"rfilename": "chat_template.jinja"
},
{
"rfilename": "config.json"
},
{
"rfilename": "encoding/README.md"
},
{
"rfilename": "encoding/encoding.py"
},
{
"rfilename": "encoding/test_encoding.py"
},
{
"rfilename": "encoding/tests/test_input_1.json"
},
{
"rfilename": "encoding/tests/test_input_2.json"
},
{
"rfilename": "encoding/tests/test_input_3.json"
},
{
"rfilename": "encoding/tests/test_input_4.json"
},
{
"rfilename": "encoding/tests/test_input_5.json"
},
{
"rfilename": "encoding/tests/test_output_1.txt"
},
{
"rfilename": "encoding/tests/test_output_2.txt"
},
{
"rfilename": "encoding/tests/test_output_3.txt"
},
{
"rfilename": "encoding/tests/test_output_4.txt"
},
{
"rfilename": "encoding/tests/test_output_5.txt"
},
{
"rfilename": "evaluation/README.md"
},
{
"rfilename": "evaluation/dsh-minimal.patch"
},
{
"rfilename": "inference/README.md"
},
{
"rfilename": "inference/config.json"
},
{
"rfilename": "inference/convert.py"
},
{
"rfilename": "inference/engram.py"
},
{
"rfilename": "inference/examples/example.txt"
},
{
"rfilename": "inference/examples/example_harmony.json"
},
{
"rfilename": "inference/examples/images/carrots.jpeg"
},
{
"rfilename": "inference/examples/images/corn.jpeg"
},
{
"rfilename": "inference/generate.py"
},
{
"rfilename": "inference/image_processor.py"
},
{
"rfilename": "inference/kernel.py"
},
{
"rfilename": "inference/model.py"
},
{
"rfilename": "inference/requirements.txt"
},
{
"rfilename": "inference/run.sh"
},
{
"rfilename": "inference/vision.py"
},
{
"rfilename": "model-00001-of-00048.safetensors"
},
{
"rfilename": "model-00002-of-00048.safetensors"
},
{
"rfilename": "model-00003-of-00048.safetensors"
},
{
"rfilename": "model-00004-of-00048.safetensors"
},
{
"rfilename": "model-00005-of-00048.safetensors"
},
{
"rfilename": "model-00006-of-00048.safetensors"
},
{
"rfilename": "model-00007-of-00048.safetensors"
},
{
"rfilename": "model-00008-of-00048.safetensors"
},
{
"rfilename": "model-00009-of-00048.safetensors"
},
{
"rfilename": "model-00010-of-00048.safetensors"
},
{
"rfilename": "model-00011-of-00048.safetensors"
},
{
"rfilename": "model-00012-of-00048.safetensors"
},
{
"rfilename": "model-00013-of-00048.safetensors"
},
{
"rfilename": "model-00014-of-00048.safetensors"
},
{
"rfilename": "model-00015-of-00048.safetensors"
},
{
"rfilename": "model-00016-of-00048.safetensors"
},
{
"rfilename": "model-00017-of-00048.safetensors"
},
{
"rfilename": "model-00018-of-00048.safetensors"
},
{
"rfilename": "model-00019-of-00048.safetensors"
},
{
"rfilename": "model-00020-of-00048.safetensors"
},
{
"rfilename": "model-00021-of-00048.safetensors"
},
{
"rfilename": "model-00022-of-00048.safetensors"
},
{
"rfilename": "model-00023-of-00048.safetensors"
},
{
"rfilename": "model-00024-of-00048.safetensors"
},
{
"rfilename": "model-00025-of-00048.safetensors"
},
{
"rfilename": "model-00026-of-00048.safetensors"
},
{
"rfilename": "model-00027-of-00048.safetensors"
},
{
"rfilename": "model-00028-of-00048.safetensors"
},
{
"rfilename": "model-00029-of-00048.safetensors"
},
{
"rfilename": "model-00030-of-00048.safetensors"
},
{
"rfilename": "model-00031-of-00048.safetensors"
},
{
"rfilename": "model-00032-of-00048.safetensors"
},
{
"rfilename": "model-00033-of-00048.safetensors"
},
{
"rfilename": "model-00034-of-00048.safetensors"
},
{
"rfilename": "model-00035-of-00048.safetensors"
},
{
"rfilename": "model-00036-of-00048.safetensors"
},
{
"rfilename": "model-00037-of-00048.safetensors"
},
{
"rfilename": "model-00038-of-00048.safetensors"
},
{
"rfilename": "model-00039-of-00048.safetensors"
},
{
"rfilename": "model-00040-of-00048.safetensors"
},
{
"rfilename": "model-00041-of-00048.safetensors"
},
{
"rfilename": "model-00042-of-00048.safetensors"
},
{
"rfilename": "model-00043-of-00048.safetensors"
},
{
"rfilename": "model-00044-of-00048.safetensors"
},
{
"rfilename": "model-00045-of-00048.safetensors"
},
{
"rfilename": "model-00046-of-00048.safetensors"
},
{
"rfilename": "model-00047-of-00048.safetensors"
},
{
"rfilename": "model-00048-of-00048.safetensors"
},
{
"rfilename": "model.safetensors.index.json"
},
{
"rfilename": "tokenizer.json"
},
{
"rfilename": "tokenizer_config.json"
}
],
"spaces": [
"embedl/hfviewer",
"tardellirs/model-pulse",
"ginigen-ai/open-router-leaderboard",
"VIDraft/global-llm-leaderboard",
"zoom-ai/hle-leaderboard",
"lvwerra/agent-artifacts",
"townbox/deepseek-profile-guide",
"bagegegegw/DeepSeek-V4.1-Flash-UNCENSORED-Demo",
"akhaliq/DeepSeek-V4.1-Flash",
"yash-711/deepseek-v41-flash-fit",
"jkorstad/daggr-studio",
"yash-711/what-fits-84gb",
"gonduras/DeepSeek-V4.1-Flash-Demo",
"shareefmx/pdf-knowledge-assistant",
"mzubair-dh/loagaeth-extractor",
"Bob3432433/DeepSeek-V4-Flash",
"Mullernorth/Klaw",
"BhDirty555/OmniForge-AI",
"SZLHOLDINGS/szl-frontier",
"brian-learns/poor-richard",
"kokabtak/kokb1-static",
"venichole/deepseek-v4-1-flash-demo",
"Uwaish/emailwriter",
"Mullernorth/Nimo",
"MrVolts/agents-den",
"gonduras/deepseek-v4-1-flash-demo",
"Joshua56/deepseek-v4-1-flash-demo",
"cookiemonster778/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"leadupapp/deepseek-v41-flash-demo",
"BunsDev/DeepSeek-V4.1-Flash-Demo",
"timmaythetoolmann/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"chizkuhhh/Final_Assignment_Template",
"ggautreau/PanGramGraph",
"MALBIATY/Assignmentunit8",
"rurrence/deepseek-v41-flash-endpoint",
"yeeeeezus/inference",
"pymmdrza/DeepSeek-V4.1-Flash-Demo",
"sergiopaniego/tau2-env",
"TorkeHub/torki-2-benchmarks",
"Cenzer0/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"FineEnvs/RL-Explorer"
],
"tags": [
"transformers",
"safetensors",
"deepseek_v41",
"text-generation",
"image-text-to-text",
"conversational",
"license:mit",
"eval-results",
"endpoints_compatible",
"8-bit",
"fp8",
"region:us"
],
"transformersInfo": {
"auto_model": "AutoModelForCausalLM",
"pipeline_tag": "text-generation"
},
"usedStorage": 510311613821,
"widgetData": [
{
"text": "Hi, what can you help me with?"
},
{
"text": "What is 84 * 3 / 2?"
},
{
"text": "Tell me an interesting fact about the universe!"
},
{
"text": "Explain quantum computing in simple terms."
}
]
} | ||||||||
| gated | falsereceipt
What the source handed over{
"_asked": "deepseek-ai/DeepSeek-V4.1-Flash",
"_id": "6aa213563d5b3527359d1af2",
"author": "deepseek-ai",
"cardData": {
"library_name": "transformers",
"license": "mit",
"pipeline_tag": "image-text-to-text"
},
"config": {
"architectures": [
"DeepseekV41ForCausalLM"
],
"chat_template_jinja": "{#- DeepSeek-V4.1 chat template, ported from encoding/encoding.py in the model repo.\n Extra kwargs: thinking_mode (\"thinking\" | \"chat\", default \"thinking\"; enable_thinking=true/false is accepted\n as an alias), drop_thinking (default true), reasoning_effort (int in [1, 100] or \"low\"/\"medium\"/\"high\"/\"max\",\n default \"high\"). Assistant reasoning is read from reasoning_content, or from thinking as an alias. -#}\n{%- set IMG = \"<|deepseek_image|>\" -%}\n{%- set DSML = \"|DSML|\" -%}\n\n{%- if thinking_mode is not defined -%}\n {%- set thinking_mode = \"chat\" if (enable_thinking is defined and enable_thinking is not none and not enable_thinking) else \"thinking\" -%}\n{%- endif -%}\n{%- if thinking_mode not in [\"chat\", \"thinking\"] -%}\n {{- raise_exception(\"Invalid thinking_mode `\" ~ thinking_mode ~ \"`, should be \\\"chat\\\" or \\\"thinking\\\"\") -}}\n{%- endif -%}\n{%- if drop_thinking is not defined -%}{%- set drop_thinking = true -%}{%- endif -%}\n{%- if add_generation_prompt is not defined -%}{%- set add_generation_prompt = false -%}{%- endif -%}\n{%- if tools is not defined -%}{%- set tools = none -%}{%- endif -%}\n\n{%- if reasoning_effort is not defined or reasoning_effort is none -%}{%- set reasoning_effort = \"high\" -%}{%- endif -%}\n{%- set effort_map = {\"low\": 50, \"medium\": 62, \"high\": 75, \"max\": 100} -%}\n{%- if reasoning_effort is string and reasoning_effort in effort_map -%}\n {%- set budget = effort_map[reasoning_effort] -%}\n{%- elif reasoning_effort is integer and 1 <= reasoning_effort <= 100 -%}\n {%- set budget = reasoning_effort -%}\n{%- else -%}\n {{- raise_exception(\"Invalid reasoning effort: \" ~ reasoning_effort ~ \", should be int within [1,100] or one of \\\"low\\\", \\\"medium\\\", \\\"high\\\", \\\"max\\\"\") -}}\n{%- endif -%}\n\n{#- Text of text/image blocks joined by blank lines; other block types are dropped. -#}\n{%- macro joined_text(blocks) -%}\n {%- set jt = namespace(parts=[]) -%}\n {%- for b in blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set jt.parts = jt.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set jt.parts = jt.parts + [IMG] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- jt.parts | join(\"\\n\\n\") -}}\n{%- endmacro -%}\n\n{#- Splits/validates \"ns::name\" against an explicit namespace and returns the qualified name. -#}\n{%- macro qualified_name(name, ns) -%}\n {%- if ns is mapping -%}{%- set ns = ns.name -%}{%- endif -%}\n {%- set parts = name.split(\"::\", 1) -%}\n {%- if parts | length == 2 -%}\n {%- if ns is not none and ns != parts[0] -%}{{- raise_exception(\"Conflicting tool namespaces: \" ~ ns ~ \" != \" ~ parts[0]) -}}{%- endif -%}\n {%- set ns = parts[0] -%}\n {%- set name = parts[1] -%}\n {%- endif -%}\n {%- if \"::\" in name -%}{{- raise_exception(\"Tool name must not contain '::': \" ~ name) -}}{%- endif -%}\n {%- if ns is not none and \"::\" in ns -%}{{- raise_exception(\"Tool namespace must not contain '::': \" ~ ns) -}}{%- endif -%}\n {{- name if ns is none else ns ~ \"::\" ~ name -}}\n{%- endmacro -%}\n\n{%- macro render_tools(tool_list) -%}\n {%- set ts = namespace(schemas=[]) -%}\n {%- for tool in tool_list -%}\n {%- set fn = tool.function if tool.function is defined else tool -%}\n {%- set ns = tool.namespace if tool.namespace is defined and tool.namespace is not none else fn.get(\"namespace\") -%}\n {%- set schema = namespace(d={}) -%}\n {%- for k, v in fn.items() if k != \"namespace\" -%}{%- set schema.d = dict(schema.d, **{k: v}) -%}{%- endfor -%}\n {%- set schema.d = dict(schema.d, name=qualified_name(fn.name, ns)) -%}\n {%- if ns is mapping and ns.description -%}\n {%- set schema.d = dict(schema.d, description=ns.description ~ \"\\n\" ~ (fn.description or \"\")) -%}\n {%- endif -%}\n {%- set ts.schemas = ts.schemas + [schema.d | tojson] -%}\n {%- endfor -%}\n {{- \"## Tools\\n\\nYou have access to a set of tools to help answer the user's question. You can invoke tools by writing a \\\"<|DSML| calls>\\\" block like the following:\\n\\n<|DSML| calls>\\n<|DSML| invoke name=\\\"$TOOL_NAME\\\">\\n<|DSML| parameter name=\\\"$PARAMETER_NAME\\\" string=\\\"true|false\\\">$PARAMETER_VALUE</|DSML| parameter>\\n...\\n</|DSML| invoke>\\n<|DSML| invoke name=\\\"$TOOL_NAME2\\\">\\n...\\n</|DSML| invoke>\\n</|DSML| calls>\\n\\nString parameters should be specified as is and set `string=\\\"true\\\"`. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string=\\\"false\\\"`.\\n\\nIf thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.\\n\\nOtherwise, output directly after </think> with tool calls or final response.\\n\\n### Available Tool Schemas\\n\\n\" -}}\n {{- ts.schemas | join(\"\\n\") -}}\n {{- \"\\n\\nYou MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls.\\n\" -}}\n{%- endmacro -%}\n\n{#- 1. Merge tool results (and consecutive user turns) into user messages made of content blocks. -#}\n{%- set mns = namespace(list=[]) -%}\n{%- for msg in messages -%}\n {%- set content = msg.get(\"content\") -%}\n {%- set is_blocks = content is iterable and content is not string and content is not mapping -%}\n {%- if content is string and IMG in content -%}\n {{- raise_exception(\"Message content contains image special token \" ~ IMG ~ \". Images should be provided as image content blocks.\") -}}\n {%- endif -%}\n {%- set rc = msg.reasoning_content if msg.get(\"reasoning_content\") is not none else msg.get(\"thinking\") -%}\n {%- if rc is string and IMG in rc -%}\n {{- raise_exception(\"reasoning_content contains image special token \" ~ IMG) -}}\n {%- endif -%}\n {%- set prev = mns.list[-1] if mns.list else none -%}\n {%- if msg.role == \"tool\" -%}\n {%- set tblock = {\"type\": \"tool_result\", \"tool_use_id\": msg.get(\"tool_call_id\", \"\"), \"content\": joined_text(content) if is_blocks else msg.get(\"content\", \"\")} -%}\n {%- if prev is not none and prev.role == \"user\" -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + [tblock])] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [{\"role\": \"user\", \"content_blocks\": [tblock]}] -%}\n {%- endif -%}\n {%- elif msg.role == \"user\" -%}\n {%- set blocks = content if is_blocks else [{\"type\": \"text\", \"text\": content or \"\"}] -%}\n {%- if prev is not none and prev.role == \"user\" and prev.get(\"task\") is none -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + blocks)] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [dict(msg, content_blocks=blocks)] -%}\n {%- endif -%}\n {%- else -%}\n {%- set mns.list = mns.list + [msg] -%}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Top-level tools attach to a leading system message, or to a new empty one. -#}\n{%- if tools -%}\n {%- if mns.list and mns.list[0].role == \"system\" -%}\n {%- if not mns.list[0].get(\"tools\") -%}{%- set mns.list = [dict(mns.list[0], tools=tools)] + mns.list[1:] -%}{%- endif -%}\n {%- else -%}\n {%- set mns.list = [{\"role\": \"system\", \"content\": \"\", \"tools\": tools}] + mns.list -%}\n {%- endif -%}\n{%- endif -%}\n\n{#- 2. Reorder tool results to match the tool_calls order of the preceding assistant message. -#}\n{%- set sns = namespace(list=[], ids=[]) -%}\n{%- for m in mns.list -%}\n {%- if m.role == \"assistant\" and m.get(\"tool_calls\") -%}\n {%- set sns.ids = [] -%}\n {%- for tc in m.tool_calls -%}\n {%- set sns.ids = sns.ids + [tc.get(\"id\") or tc.get(\"function\", {}).get(\"id\", \"\")] -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- elif m.role == \"user\" and m.content_blocks -%}\n {%- set tb = namespace(blocks=[]) -%}\n {%- for b in m.content_blocks if b.type == \"tool_result\" -%}\n {%- set order = namespace(idx=0) -%}\n {%- for tc_id in sns.ids -%}\n {%- if tc_id and tc_id == b.get(\"tool_use_id\", \"\") -%}{%- set order.idx = loop.index0 -%}{%- endif -%}\n {%- endfor -%}\n {%- set tb.blocks = tb.blocks + [dict(b, _order=order.idx)] -%}\n {%- endfor -%}\n {%- if tb.blocks | length > 1 -%}\n {%- set sorted_blocks = tb.blocks | sort(attribute=\"_order\") -%}\n {%- set rb = namespace(blocks=[], i=0) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"tool_result\" -%}\n {%- set rb.blocks = rb.blocks + [sorted_blocks[rb.i]] -%}\n {%- set rb.i = rb.i + 1 -%}\n {%- else -%}\n {%- set rb.blocks = rb.blocks + [b] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [dict(m, content_blocks=rb.blocks)] -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n{%- endfor -%}\n{%- set msgs = sns.list -%}\n\n{#- Mid-conversation system messages count as user turns. Tools anywhere disable drop_thinking. -#}\n{%- set state = namespace(last_user=-1, has_tools=false) -%}\n{%- for m in msgs -%}\n {%- if m.role == \"user\" or (m.role == \"system\" and loop.index0 > 0) -%}{%- set state.last_user = loop.index0 -%}{%- endif -%}\n {%- if m.get(\"tools\") -%}{%- set state.has_tools = true -%}{%- endif -%}\n{%- endfor -%}\n{%- set effective_drop = drop_thinking and not state.has_tools -%}\n{%- set thinking = thinking_mode == \"thinking\" -%}\n\n{{- \"<|begin▁of▁sentence|>\" -}}\n{#- 3. Render each message. -#}\n{%- for m in msgs -%}\n {%- set idx = loop.index0 -%}\n {%- set content = m.get(\"content\") -%}\n {%- if content is iterable and content is not string and content is not mapping -%}{%- set content = joined_text(content) -%}{%- endif -%}\n\n {%- if idx == 0 -%}\n {%- if thinking or m.role == \"system\" -%}{{- \"<|System|>\" -}}{%- endif -%}\n {%- if thinking -%}{{- \"Reasoning Effort: \" ~ budget ~ \" (range 1-100, the higher the value, the more thorough the reasoning)\\n\\n\" -}}{%- endif -%}\n {%- endif -%}\n\n {%- if m.role == \"system\" -%}\n {%- if idx > 0 -%}{{- \"<|System|>\" -}}{%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tools\") -%}{{- \"\\n\\n\" ~ render_tools(m.tools) -}}{%- endif -%}\n {%- if m.get(\"response_format\") -%}\n {{- \"\\n\\n## Response Format:\\n\\nYou MUST strictly adhere to the following schema to reply:\\n\" ~ (m.response_format | tojson) -}}\n {%- endif -%}\n\n {%- elif m.role == \"user\" -%}\n {{- \"<|User|>\" -}}\n {%- set up = namespace(parts=[]) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set up.parts = up.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set up.parts = up.parts + [IMG] -%}\n {%- elif b.type == \"tool_result\" -%}\n {%- set tc = b.get(\"content\", \"\") -%}\n {%- if tc is iterable and tc is not string and tc is not mapping -%}\n {%- set sub = namespace(parts=[]) -%}\n {%- for s in tc -%}\n {%- if s.type == \"text\" -%}{%- set sub.parts = sub.parts + [s.get(\"text\", \"\")] -%}\n {%- elif s.type in [\"image\", \"image_url\"] -%}{%- set sub.parts = sub.parts + [IMG] -%}\n {%- else -%}{%- set sub.parts = sub.parts + [\"[Unsupported \" ~ s.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set tc = sub.parts | join(\"\\n\\n\") -%}\n {%- endif -%}\n {%- set up.parts = up.parts + [\"<tool_result>\" ~ tc ~ \"</tool_result>\"] -%}\n {%- else -%}\n {%- set up.parts = up.parts + [\"[Unsupported \" ~ b.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- up.parts | join(\"\\n\\n\") -}}\n\n {%- elif m.role == \"latest_reminder\" -%}\n {{- \"<|latest_reminder|>\" ~ content -}}\n\n {%- elif m.role == \"assistant\" -%}\n {%- set prev_has_task = idx > 0 and msgs[idx - 1].get(\"task\") is not none -%}\n {%- if thinking and not prev_has_task and (not effective_drop or idx > state.last_user) -%}\n {{- ((m.reasoning_content if m.get(\"reasoning_content\") is not none else m.get(\"thinking\")) or \"\") ~ \"</think>\" -}}\n {%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tool_calls\") -%}\n {%- set tcs = namespace(lines=[]) -%}\n {%- for tc in m.tool_calls -%}\n {%- set fn = tc.function -%}\n {%- set params = namespace(lines=[]) -%}\n {%- set args = fn.arguments if fn.arguments is mapping else {\"arguments\": fn.arguments} -%}\n {%- for k, v in args.items() -%}\n {%- set params.lines = params.lines + [\"<\" ~ DSML ~ \" parameter name=\\\"\" ~ k ~ \"\\\" string=\\\"\" ~ (\"true\" if v is string else \"false\") ~ \"\\\">\" ~ (v if v is string else v | tojson) ~ \"</\" ~ DSML ~ \" parameter>\"] -%}\n {%- endfor -%}\n {%- set name = qualified_name(fn.name, tc.get(\"namespace\") or fn.get(\"namespace\")) -%}\n {%- set tcs.lines = tcs.lines + [\"<\" ~ DSML ~ \" invoke name=\\\"\" ~ name ~ \"\\\">\\n\" ~ params.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" invoke>\"] -%}\n {%- endfor -%}\n {{- \"\\n\\n<\" ~ DSML ~ \" calls>\\n\" ~ tcs.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" calls>\" -}}\n {%- endif -%}\n {%- if not m.get(\"wo_eos\", false) -%}{{- \"<|end▁of▁sentence|>\" -}}{%- endif -%}\n\n {%- else -%}\n {{- raise_exception(\"Unknown role: \" ~ m.role) -}}\n {%- endif -%}\n\n {#- Transition tokens, only when the next message is an assistant/latest_reminder turn or this is the last one. -#}\n {%- if loop.last or msgs[idx + 1].role in [\"assistant\", \"latest_reminder\"] -%}\n {%- set task = m.get(\"task\") -%}\n {%- if task is not none -%}\n {%- set task_tokens = {\"action\": \"<|action|>\", \"query\": \"<|query|>\", \"authority\": \"<|authority|>\", \"domain\": \"<|domain|>\", \"title\": \"<|title|>\", \"read_url\": \"<|read_url|>\"} -%}\n {%- if task not in task_tokens -%}{{- raise_exception(\"Invalid task: '\" ~ task ~ \"'\") -}}{%- endif -%}\n {%- if task == \"action\" -%}{{- \"<|Assistant|>\" ~ (\"<think>\" if thinking else \"</think>\") -}}{%- endif -%}\n {{- task_tokens[task] -}}\n {%- elif (m.role == \"user\" or (m.role == \"system\" and idx > 0)) and (add_generation_prompt or not loop.last) -%}\n {{- \"<|Assistant|>\" ~ (\"<think>\" if thinking and (not effective_drop or idx >= state.last_user) else \"</think>\") -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n",
"model_type": "deepseek_v41",
"quantization_config": {
"quant_method": "fp8"
},
"tokenizer_config": {
"bos_token": {
"__type": "AddedToken",
"content": "<|begin▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"eos_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"unk_token": null
}
},
"createdAt": "2026-09-10T02:17:58.000Z",
"disabled": false,
"downloads": 798422,
"gated": false,
"id": "deepseek-ai/DeepSeek-V4.1-Flash",
"inference": "warm",
"lastModified": "2026-10-01T05:56:24.000Z",
"library_name": "transformers",
"likes": 4073,
"model-index": null,
"modelId": "deepseek-ai/DeepSeek-V4.1-Flash",
"pipeline_tag": "image-text-to-text",
"private": false,
"safetensors": {
"parameters": {
"BF16": 1976441856,
"F32": 42307282,
"F8_E4M3": 204015223296,
"I8": 557171343360
},
"total": 763205315794
},
"sha": "2cba9e42aa026125f3ed06c6d98c1db82f7ca027",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "DeepSeek_V41_Tech_Report.pdf"
},
{
"rfilename": "LICENSE"
},
{
"rfilename": "README.md"
},
{
"rfilename": "assets/dsv41_agentic_performance.png"
},
{
"rfilename": "assets/dsv41_kv_cache.png"
},
{
"rfilename": "chat_template.jinja"
},
{
"rfilename": "config.json"
},
{
"rfilename": "encoding/README.md"
},
{
"rfilename": "encoding/encoding.py"
},
{
"rfilename": "encoding/test_encoding.py"
},
{
"rfilename": "encoding/tests/test_input_1.json"
},
{
"rfilename": "encoding/tests/test_input_2.json"
},
{
"rfilename": "encoding/tests/test_input_3.json"
},
{
"rfilename": "encoding/tests/test_input_4.json"
},
{
"rfilename": "encoding/tests/test_input_5.json"
},
{
"rfilename": "encoding/tests/test_output_1.txt"
},
{
"rfilename": "encoding/tests/test_output_2.txt"
},
{
"rfilename": "encoding/tests/test_output_3.txt"
},
{
"rfilename": "encoding/tests/test_output_4.txt"
},
{
"rfilename": "encoding/tests/test_output_5.txt"
},
{
"rfilename": "evaluation/README.md"
},
{
"rfilename": "evaluation/dsh-minimal.patch"
},
{
"rfilename": "inference/README.md"
},
{
"rfilename": "inference/config.json"
},
{
"rfilename": "inference/convert.py"
},
{
"rfilename": "inference/engram.py"
},
{
"rfilename": "inference/examples/example.txt"
},
{
"rfilename": "inference/examples/example_harmony.json"
},
{
"rfilename": "inference/examples/images/carrots.jpeg"
},
{
"rfilename": "inference/examples/images/corn.jpeg"
},
{
"rfilename": "inference/generate.py"
},
{
"rfilename": "inference/image_processor.py"
},
{
"rfilename": "inference/kernel.py"
},
{
"rfilename": "inference/model.py"
},
{
"rfilename": "inference/requirements.txt"
},
{
"rfilename": "inference/run.sh"
},
{
"rfilename": "inference/vision.py"
},
{
"rfilename": "model-00001-of-00048.safetensors"
},
{
"rfilename": "model-00002-of-00048.safetensors"
},
{
"rfilename": "model-00003-of-00048.safetensors"
},
{
"rfilename": "model-00004-of-00048.safetensors"
},
{
"rfilename": "model-00005-of-00048.safetensors"
},
{
"rfilename": "model-00006-of-00048.safetensors"
},
{
"rfilename": "model-00007-of-00048.safetensors"
},
{
"rfilename": "model-00008-of-00048.safetensors"
},
{
"rfilename": "model-00009-of-00048.safetensors"
},
{
"rfilename": "model-00010-of-00048.safetensors"
},
{
"rfilename": "model-00011-of-00048.safetensors"
},
{
"rfilename": "model-00012-of-00048.safetensors"
},
{
"rfilename": "model-00013-of-00048.safetensors"
},
{
"rfilename": "model-00014-of-00048.safetensors"
},
{
"rfilename": "model-00015-of-00048.safetensors"
},
{
"rfilename": "model-00016-of-00048.safetensors"
},
{
"rfilename": "model-00017-of-00048.safetensors"
},
{
"rfilename": "model-00018-of-00048.safetensors"
},
{
"rfilename": "model-00019-of-00048.safetensors"
},
{
"rfilename": "model-00020-of-00048.safetensors"
},
{
"rfilename": "model-00021-of-00048.safetensors"
},
{
"rfilename": "model-00022-of-00048.safetensors"
},
{
"rfilename": "model-00023-of-00048.safetensors"
},
{
"rfilename": "model-00024-of-00048.safetensors"
},
{
"rfilename": "model-00025-of-00048.safetensors"
},
{
"rfilename": "model-00026-of-00048.safetensors"
},
{
"rfilename": "model-00027-of-00048.safetensors"
},
{
"rfilename": "model-00028-of-00048.safetensors"
},
{
"rfilename": "model-00029-of-00048.safetensors"
},
{
"rfilename": "model-00030-of-00048.safetensors"
},
{
"rfilename": "model-00031-of-00048.safetensors"
},
{
"rfilename": "model-00032-of-00048.safetensors"
},
{
"rfilename": "model-00033-of-00048.safetensors"
},
{
"rfilename": "model-00034-of-00048.safetensors"
},
{
"rfilename": "model-00035-of-00048.safetensors"
},
{
"rfilename": "model-00036-of-00048.safetensors"
},
{
"rfilename": "model-00037-of-00048.safetensors"
},
{
"rfilename": "model-00038-of-00048.safetensors"
},
{
"rfilename": "model-00039-of-00048.safetensors"
},
{
"rfilename": "model-00040-of-00048.safetensors"
},
{
"rfilename": "model-00041-of-00048.safetensors"
},
{
"rfilename": "model-00042-of-00048.safetensors"
},
{
"rfilename": "model-00043-of-00048.safetensors"
},
{
"rfilename": "model-00044-of-00048.safetensors"
},
{
"rfilename": "model-00045-of-00048.safetensors"
},
{
"rfilename": "model-00046-of-00048.safetensors"
},
{
"rfilename": "model-00047-of-00048.safetensors"
},
{
"rfilename": "model-00048-of-00048.safetensors"
},
{
"rfilename": "model.safetensors.index.json"
},
{
"rfilename": "tokenizer.json"
},
{
"rfilename": "tokenizer_config.json"
}
],
"spaces": [
"embedl/hfviewer",
"tardellirs/model-pulse",
"ginigen-ai/open-router-leaderboard",
"VIDraft/global-llm-leaderboard",
"zoom-ai/hle-leaderboard",
"lvwerra/agent-artifacts",
"townbox/deepseek-profile-guide",
"bagegegegw/DeepSeek-V4.1-Flash-UNCENSORED-Demo",
"akhaliq/DeepSeek-V4.1-Flash",
"yash-711/deepseek-v41-flash-fit",
"jkorstad/daggr-studio",
"yash-711/what-fits-84gb",
"gonduras/DeepSeek-V4.1-Flash-Demo",
"shareefmx/pdf-knowledge-assistant",
"mzubair-dh/loagaeth-extractor",
"Bob3432433/DeepSeek-V4-Flash",
"Mullernorth/Klaw",
"BhDirty555/OmniForge-AI",
"SZLHOLDINGS/szl-frontier",
"brian-learns/poor-richard",
"kokabtak/kokb1-static",
"venichole/deepseek-v4-1-flash-demo",
"Uwaish/emailwriter",
"Mullernorth/Nimo",
"MrVolts/agents-den",
"gonduras/deepseek-v4-1-flash-demo",
"Joshua56/deepseek-v4-1-flash-demo",
"cookiemonster778/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"leadupapp/deepseek-v41-flash-demo",
"BunsDev/DeepSeek-V4.1-Flash-Demo",
"timmaythetoolmann/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"chizkuhhh/Final_Assignment_Template",
"ggautreau/PanGramGraph",
"MALBIATY/Assignmentunit8",
"rurrence/deepseek-v41-flash-endpoint",
"yeeeeezus/inference",
"pymmdrza/DeepSeek-V4.1-Flash-Demo",
"sergiopaniego/tau2-env",
"TorkeHub/torki-2-benchmarks",
"Cenzer0/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"FineEnvs/RL-Explorer"
],
"tags": [
"transformers",
"safetensors",
"deepseek_v41",
"text-generation",
"image-text-to-text",
"conversational",
"license:mit",
"eval-results",
"endpoints_compatible",
"8-bit",
"fp8",
"region:us"
],
"transformersInfo": {
"auto_model": "AutoModelForCausalLM",
"pipeline_tag": "text-generation"
},
"usedStorage": 510311613821,
"widgetData": [
{
"text": "Hi, what can you help me with?"
},
{
"text": "What is 84 * 3 / 2?"
},
{
"text": "Tell me an interesting fact about the universe!"
},
{
"text": "Explain quantum computing in simple terms."
}
]
} | ||||||||
| licence | mitreceipt
What the source handed over{
"_asked": "deepseek-ai/DeepSeek-V4.1-Flash",
"_id": "6aa213563d5b3527359d1af2",
"author": "deepseek-ai",
"cardData": {
"library_name": "transformers",
"license": "mit",
"pipeline_tag": "image-text-to-text"
},
"config": {
"architectures": [
"DeepseekV41ForCausalLM"
],
"chat_template_jinja": "{#- DeepSeek-V4.1 chat template, ported from encoding/encoding.py in the model repo.\n Extra kwargs: thinking_mode (\"thinking\" | \"chat\", default \"thinking\"; enable_thinking=true/false is accepted\n as an alias), drop_thinking (default true), reasoning_effort (int in [1, 100] or \"low\"/\"medium\"/\"high\"/\"max\",\n default \"high\"). Assistant reasoning is read from reasoning_content, or from thinking as an alias. -#}\n{%- set IMG = \"<|deepseek_image|>\" -%}\n{%- set DSML = \"|DSML|\" -%}\n\n{%- if thinking_mode is not defined -%}\n {%- set thinking_mode = \"chat\" if (enable_thinking is defined and enable_thinking is not none and not enable_thinking) else \"thinking\" -%}\n{%- endif -%}\n{%- if thinking_mode not in [\"chat\", \"thinking\"] -%}\n {{- raise_exception(\"Invalid thinking_mode `\" ~ thinking_mode ~ \"`, should be \\\"chat\\\" or \\\"thinking\\\"\") -}}\n{%- endif -%}\n{%- if drop_thinking is not defined -%}{%- set drop_thinking = true -%}{%- endif -%}\n{%- if add_generation_prompt is not defined -%}{%- set add_generation_prompt = false -%}{%- endif -%}\n{%- if tools is not defined -%}{%- set tools = none -%}{%- endif -%}\n\n{%- if reasoning_effort is not defined or reasoning_effort is none -%}{%- set reasoning_effort = \"high\" -%}{%- endif -%}\n{%- set effort_map = {\"low\": 50, \"medium\": 62, \"high\": 75, \"max\": 100} -%}\n{%- if reasoning_effort is string and reasoning_effort in effort_map -%}\n {%- set budget = effort_map[reasoning_effort] -%}\n{%- elif reasoning_effort is integer and 1 <= reasoning_effort <= 100 -%}\n {%- set budget = reasoning_effort -%}\n{%- else -%}\n {{- raise_exception(\"Invalid reasoning effort: \" ~ reasoning_effort ~ \", should be int within [1,100] or one of \\\"low\\\", \\\"medium\\\", \\\"high\\\", \\\"max\\\"\") -}}\n{%- endif -%}\n\n{#- Text of text/image blocks joined by blank lines; other block types are dropped. -#}\n{%- macro joined_text(blocks) -%}\n {%- set jt = namespace(parts=[]) -%}\n {%- for b in blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set jt.parts = jt.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set jt.parts = jt.parts + [IMG] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- jt.parts | join(\"\\n\\n\") -}}\n{%- endmacro -%}\n\n{#- Splits/validates \"ns::name\" against an explicit namespace and returns the qualified name. -#}\n{%- macro qualified_name(name, ns) -%}\n {%- if ns is mapping -%}{%- set ns = ns.name -%}{%- endif -%}\n {%- set parts = name.split(\"::\", 1) -%}\n {%- if parts | length == 2 -%}\n {%- if ns is not none and ns != parts[0] -%}{{- raise_exception(\"Conflicting tool namespaces: \" ~ ns ~ \" != \" ~ parts[0]) -}}{%- endif -%}\n {%- set ns = parts[0] -%}\n {%- set name = parts[1] -%}\n {%- endif -%}\n {%- if \"::\" in name -%}{{- raise_exception(\"Tool name must not contain '::': \" ~ name) -}}{%- endif -%}\n {%- if ns is not none and \"::\" in ns -%}{{- raise_exception(\"Tool namespace must not contain '::': \" ~ ns) -}}{%- endif -%}\n {{- name if ns is none else ns ~ \"::\" ~ name -}}\n{%- endmacro -%}\n\n{%- macro render_tools(tool_list) -%}\n {%- set ts = namespace(schemas=[]) -%}\n {%- for tool in tool_list -%}\n {%- set fn = tool.function if tool.function is defined else tool -%}\n {%- set ns = tool.namespace if tool.namespace is defined and tool.namespace is not none else fn.get(\"namespace\") -%}\n {%- set schema = namespace(d={}) -%}\n {%- for k, v in fn.items() if k != \"namespace\" -%}{%- set schema.d = dict(schema.d, **{k: v}) -%}{%- endfor -%}\n {%- set schema.d = dict(schema.d, name=qualified_name(fn.name, ns)) -%}\n {%- if ns is mapping and ns.description -%}\n {%- set schema.d = dict(schema.d, description=ns.description ~ \"\\n\" ~ (fn.description or \"\")) -%}\n {%- endif -%}\n {%- set ts.schemas = ts.schemas + [schema.d | tojson] -%}\n {%- endfor -%}\n {{- \"## Tools\\n\\nYou have access to a set of tools to help answer the user's question. You can invoke tools by writing a \\\"<|DSML| calls>\\\" block like the following:\\n\\n<|DSML| calls>\\n<|DSML| invoke name=\\\"$TOOL_NAME\\\">\\n<|DSML| parameter name=\\\"$PARAMETER_NAME\\\" string=\\\"true|false\\\">$PARAMETER_VALUE</|DSML| parameter>\\n...\\n</|DSML| invoke>\\n<|DSML| invoke name=\\\"$TOOL_NAME2\\\">\\n...\\n</|DSML| invoke>\\n</|DSML| calls>\\n\\nString parameters should be specified as is and set `string=\\\"true\\\"`. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string=\\\"false\\\"`.\\n\\nIf thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.\\n\\nOtherwise, output directly after </think> with tool calls or final response.\\n\\n### Available Tool Schemas\\n\\n\" -}}\n {{- ts.schemas | join(\"\\n\") -}}\n {{- \"\\n\\nYou MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls.\\n\" -}}\n{%- endmacro -%}\n\n{#- 1. Merge tool results (and consecutive user turns) into user messages made of content blocks. -#}\n{%- set mns = namespace(list=[]) -%}\n{%- for msg in messages -%}\n {%- set content = msg.get(\"content\") -%}\n {%- set is_blocks = content is iterable and content is not string and content is not mapping -%}\n {%- if content is string and IMG in content -%}\n {{- raise_exception(\"Message content contains image special token \" ~ IMG ~ \". Images should be provided as image content blocks.\") -}}\n {%- endif -%}\n {%- set rc = msg.reasoning_content if msg.get(\"reasoning_content\") is not none else msg.get(\"thinking\") -%}\n {%- if rc is string and IMG in rc -%}\n {{- raise_exception(\"reasoning_content contains image special token \" ~ IMG) -}}\n {%- endif -%}\n {%- set prev = mns.list[-1] if mns.list else none -%}\n {%- if msg.role == \"tool\" -%}\n {%- set tblock = {\"type\": \"tool_result\", \"tool_use_id\": msg.get(\"tool_call_id\", \"\"), \"content\": joined_text(content) if is_blocks else msg.get(\"content\", \"\")} -%}\n {%- if prev is not none and prev.role == \"user\" -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + [tblock])] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [{\"role\": \"user\", \"content_blocks\": [tblock]}] -%}\n {%- endif -%}\n {%- elif msg.role == \"user\" -%}\n {%- set blocks = content if is_blocks else [{\"type\": \"text\", \"text\": content or \"\"}] -%}\n {%- if prev is not none and prev.role == \"user\" and prev.get(\"task\") is none -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + blocks)] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [dict(msg, content_blocks=blocks)] -%}\n {%- endif -%}\n {%- else -%}\n {%- set mns.list = mns.list + [msg] -%}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Top-level tools attach to a leading system message, or to a new empty one. -#}\n{%- if tools -%}\n {%- if mns.list and mns.list[0].role == \"system\" -%}\n {%- if not mns.list[0].get(\"tools\") -%}{%- set mns.list = [dict(mns.list[0], tools=tools)] + mns.list[1:] -%}{%- endif -%}\n {%- else -%}\n {%- set mns.list = [{\"role\": \"system\", \"content\": \"\", \"tools\": tools}] + mns.list -%}\n {%- endif -%}\n{%- endif -%}\n\n{#- 2. Reorder tool results to match the tool_calls order of the preceding assistant message. -#}\n{%- set sns = namespace(list=[], ids=[]) -%}\n{%- for m in mns.list -%}\n {%- if m.role == \"assistant\" and m.get(\"tool_calls\") -%}\n {%- set sns.ids = [] -%}\n {%- for tc in m.tool_calls -%}\n {%- set sns.ids = sns.ids + [tc.get(\"id\") or tc.get(\"function\", {}).get(\"id\", \"\")] -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- elif m.role == \"user\" and m.content_blocks -%}\n {%- set tb = namespace(blocks=[]) -%}\n {%- for b in m.content_blocks if b.type == \"tool_result\" -%}\n {%- set order = namespace(idx=0) -%}\n {%- for tc_id in sns.ids -%}\n {%- if tc_id and tc_id == b.get(\"tool_use_id\", \"\") -%}{%- set order.idx = loop.index0 -%}{%- endif -%}\n {%- endfor -%}\n {%- set tb.blocks = tb.blocks + [dict(b, _order=order.idx)] -%}\n {%- endfor -%}\n {%- if tb.blocks | length > 1 -%}\n {%- set sorted_blocks = tb.blocks | sort(attribute=\"_order\") -%}\n {%- set rb = namespace(blocks=[], i=0) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"tool_result\" -%}\n {%- set rb.blocks = rb.blocks + [sorted_blocks[rb.i]] -%}\n {%- set rb.i = rb.i + 1 -%}\n {%- else -%}\n {%- set rb.blocks = rb.blocks + [b] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [dict(m, content_blocks=rb.blocks)] -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n{%- endfor -%}\n{%- set msgs = sns.list -%}\n\n{#- Mid-conversation system messages count as user turns. Tools anywhere disable drop_thinking. -#}\n{%- set state = namespace(last_user=-1, has_tools=false) -%}\n{%- for m in msgs -%}\n {%- if m.role == \"user\" or (m.role == \"system\" and loop.index0 > 0) -%}{%- set state.last_user = loop.index0 -%}{%- endif -%}\n {%- if m.get(\"tools\") -%}{%- set state.has_tools = true -%}{%- endif -%}\n{%- endfor -%}\n{%- set effective_drop = drop_thinking and not state.has_tools -%}\n{%- set thinking = thinking_mode == \"thinking\" -%}\n\n{{- \"<|begin▁of▁sentence|>\" -}}\n{#- 3. Render each message. -#}\n{%- for m in msgs -%}\n {%- set idx = loop.index0 -%}\n {%- set content = m.get(\"content\") -%}\n {%- if content is iterable and content is not string and content is not mapping -%}{%- set content = joined_text(content) -%}{%- endif -%}\n\n {%- if idx == 0 -%}\n {%- if thinking or m.role == \"system\" -%}{{- \"<|System|>\" -}}{%- endif -%}\n {%- if thinking -%}{{- \"Reasoning Effort: \" ~ budget ~ \" (range 1-100, the higher the value, the more thorough the reasoning)\\n\\n\" -}}{%- endif -%}\n {%- endif -%}\n\n {%- if m.role == \"system\" -%}\n {%- if idx > 0 -%}{{- \"<|System|>\" -}}{%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tools\") -%}{{- \"\\n\\n\" ~ render_tools(m.tools) -}}{%- endif -%}\n {%- if m.get(\"response_format\") -%}\n {{- \"\\n\\n## Response Format:\\n\\nYou MUST strictly adhere to the following schema to reply:\\n\" ~ (m.response_format | tojson) -}}\n {%- endif -%}\n\n {%- elif m.role == \"user\" -%}\n {{- \"<|User|>\" -}}\n {%- set up = namespace(parts=[]) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set up.parts = up.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set up.parts = up.parts + [IMG] -%}\n {%- elif b.type == \"tool_result\" -%}\n {%- set tc = b.get(\"content\", \"\") -%}\n {%- if tc is iterable and tc is not string and tc is not mapping -%}\n {%- set sub = namespace(parts=[]) -%}\n {%- for s in tc -%}\n {%- if s.type == \"text\" -%}{%- set sub.parts = sub.parts + [s.get(\"text\", \"\")] -%}\n {%- elif s.type in [\"image\", \"image_url\"] -%}{%- set sub.parts = sub.parts + [IMG] -%}\n {%- else -%}{%- set sub.parts = sub.parts + [\"[Unsupported \" ~ s.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set tc = sub.parts | join(\"\\n\\n\") -%}\n {%- endif -%}\n {%- set up.parts = up.parts + [\"<tool_result>\" ~ tc ~ \"</tool_result>\"] -%}\n {%- else -%}\n {%- set up.parts = up.parts + [\"[Unsupported \" ~ b.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- up.parts | join(\"\\n\\n\") -}}\n\n {%- elif m.role == \"latest_reminder\" -%}\n {{- \"<|latest_reminder|>\" ~ content -}}\n\n {%- elif m.role == \"assistant\" -%}\n {%- set prev_has_task = idx > 0 and msgs[idx - 1].get(\"task\") is not none -%}\n {%- if thinking and not prev_has_task and (not effective_drop or idx > state.last_user) -%}\n {{- ((m.reasoning_content if m.get(\"reasoning_content\") is not none else m.get(\"thinking\")) or \"\") ~ \"</think>\" -}}\n {%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tool_calls\") -%}\n {%- set tcs = namespace(lines=[]) -%}\n {%- for tc in m.tool_calls -%}\n {%- set fn = tc.function -%}\n {%- set params = namespace(lines=[]) -%}\n {%- set args = fn.arguments if fn.arguments is mapping else {\"arguments\": fn.arguments} -%}\n {%- for k, v in args.items() -%}\n {%- set params.lines = params.lines + [\"<\" ~ DSML ~ \" parameter name=\\\"\" ~ k ~ \"\\\" string=\\\"\" ~ (\"true\" if v is string else \"false\") ~ \"\\\">\" ~ (v if v is string else v | tojson) ~ \"</\" ~ DSML ~ \" parameter>\"] -%}\n {%- endfor -%}\n {%- set name = qualified_name(fn.name, tc.get(\"namespace\") or fn.get(\"namespace\")) -%}\n {%- set tcs.lines = tcs.lines + [\"<\" ~ DSML ~ \" invoke name=\\\"\" ~ name ~ \"\\\">\\n\" ~ params.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" invoke>\"] -%}\n {%- endfor -%}\n {{- \"\\n\\n<\" ~ DSML ~ \" calls>\\n\" ~ tcs.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" calls>\" -}}\n {%- endif -%}\n {%- if not m.get(\"wo_eos\", false) -%}{{- \"<|end▁of▁sentence|>\" -}}{%- endif -%}\n\n {%- else -%}\n {{- raise_exception(\"Unknown role: \" ~ m.role) -}}\n {%- endif -%}\n\n {#- Transition tokens, only when the next message is an assistant/latest_reminder turn or this is the last one. -#}\n {%- if loop.last or msgs[idx + 1].role in [\"assistant\", \"latest_reminder\"] -%}\n {%- set task = m.get(\"task\") -%}\n {%- if task is not none -%}\n {%- set task_tokens = {\"action\": \"<|action|>\", \"query\": \"<|query|>\", \"authority\": \"<|authority|>\", \"domain\": \"<|domain|>\", \"title\": \"<|title|>\", \"read_url\": \"<|read_url|>\"} -%}\n {%- if task not in task_tokens -%}{{- raise_exception(\"Invalid task: '\" ~ task ~ \"'\") -}}{%- endif -%}\n {%- if task == \"action\" -%}{{- \"<|Assistant|>\" ~ (\"<think>\" if thinking else \"</think>\") -}}{%- endif -%}\n {{- task_tokens[task] -}}\n {%- elif (m.role == \"user\" or (m.role == \"system\" and idx > 0)) and (add_generation_prompt or not loop.last) -%}\n {{- \"<|Assistant|>\" ~ (\"<think>\" if thinking and (not effective_drop or idx >= state.last_user) else \"</think>\") -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n",
"model_type": "deepseek_v41",
"quantization_config": {
"quant_method": "fp8"
},
"tokenizer_config": {
"bos_token": {
"__type": "AddedToken",
"content": "<|begin▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"eos_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"unk_token": null
}
},
"createdAt": "2026-09-10T02:17:58.000Z",
"disabled": false,
"downloads": 798422,
"gated": false,
"id": "deepseek-ai/DeepSeek-V4.1-Flash",
"inference": "warm",
"lastModified": "2026-10-01T05:56:24.000Z",
"library_name": "transformers",
"likes": 4073,
"model-index": null,
"modelId": "deepseek-ai/DeepSeek-V4.1-Flash",
"pipeline_tag": "image-text-to-text",
"private": false,
"safetensors": {
"parameters": {
"BF16": 1976441856,
"F32": 42307282,
"F8_E4M3": 204015223296,
"I8": 557171343360
},
"total": 763205315794
},
"sha": "2cba9e42aa026125f3ed06c6d98c1db82f7ca027",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "DeepSeek_V41_Tech_Report.pdf"
},
{
"rfilename": "LICENSE"
},
{
"rfilename": "README.md"
},
{
"rfilename": "assets/dsv41_agentic_performance.png"
},
{
"rfilename": "assets/dsv41_kv_cache.png"
},
{
"rfilename": "chat_template.jinja"
},
{
"rfilename": "config.json"
},
{
"rfilename": "encoding/README.md"
},
{
"rfilename": "encoding/encoding.py"
},
{
"rfilename": "encoding/test_encoding.py"
},
{
"rfilename": "encoding/tests/test_input_1.json"
},
{
"rfilename": "encoding/tests/test_input_2.json"
},
{
"rfilename": "encoding/tests/test_input_3.json"
},
{
"rfilename": "encoding/tests/test_input_4.json"
},
{
"rfilename": "encoding/tests/test_input_5.json"
},
{
"rfilename": "encoding/tests/test_output_1.txt"
},
{
"rfilename": "encoding/tests/test_output_2.txt"
},
{
"rfilename": "encoding/tests/test_output_3.txt"
},
{
"rfilename": "encoding/tests/test_output_4.txt"
},
{
"rfilename": "encoding/tests/test_output_5.txt"
},
{
"rfilename": "evaluation/README.md"
},
{
"rfilename": "evaluation/dsh-minimal.patch"
},
{
"rfilename": "inference/README.md"
},
{
"rfilename": "inference/config.json"
},
{
"rfilename": "inference/convert.py"
},
{
"rfilename": "inference/engram.py"
},
{
"rfilename": "inference/examples/example.txt"
},
{
"rfilename": "inference/examples/example_harmony.json"
},
{
"rfilename": "inference/examples/images/carrots.jpeg"
},
{
"rfilename": "inference/examples/images/corn.jpeg"
},
{
"rfilename": "inference/generate.py"
},
{
"rfilename": "inference/image_processor.py"
},
{
"rfilename": "inference/kernel.py"
},
{
"rfilename": "inference/model.py"
},
{
"rfilename": "inference/requirements.txt"
},
{
"rfilename": "inference/run.sh"
},
{
"rfilename": "inference/vision.py"
},
{
"rfilename": "model-00001-of-00048.safetensors"
},
{
"rfilename": "model-00002-of-00048.safetensors"
},
{
"rfilename": "model-00003-of-00048.safetensors"
},
{
"rfilename": "model-00004-of-00048.safetensors"
},
{
"rfilename": "model-00005-of-00048.safetensors"
},
{
"rfilename": "model-00006-of-00048.safetensors"
},
{
"rfilename": "model-00007-of-00048.safetensors"
},
{
"rfilename": "model-00008-of-00048.safetensors"
},
{
"rfilename": "model-00009-of-00048.safetensors"
},
{
"rfilename": "model-00010-of-00048.safetensors"
},
{
"rfilename": "model-00011-of-00048.safetensors"
},
{
"rfilename": "model-00012-of-00048.safetensors"
},
{
"rfilename": "model-00013-of-00048.safetensors"
},
{
"rfilename": "model-00014-of-00048.safetensors"
},
{
"rfilename": "model-00015-of-00048.safetensors"
},
{
"rfilename": "model-00016-of-00048.safetensors"
},
{
"rfilename": "model-00017-of-00048.safetensors"
},
{
"rfilename": "model-00018-of-00048.safetensors"
},
{
"rfilename": "model-00019-of-00048.safetensors"
},
{
"rfilename": "model-00020-of-00048.safetensors"
},
{
"rfilename": "model-00021-of-00048.safetensors"
},
{
"rfilename": "model-00022-of-00048.safetensors"
},
{
"rfilename": "model-00023-of-00048.safetensors"
},
{
"rfilename": "model-00024-of-00048.safetensors"
},
{
"rfilename": "model-00025-of-00048.safetensors"
},
{
"rfilename": "model-00026-of-00048.safetensors"
},
{
"rfilename": "model-00027-of-00048.safetensors"
},
{
"rfilename": "model-00028-of-00048.safetensors"
},
{
"rfilename": "model-00029-of-00048.safetensors"
},
{
"rfilename": "model-00030-of-00048.safetensors"
},
{
"rfilename": "model-00031-of-00048.safetensors"
},
{
"rfilename": "model-00032-of-00048.safetensors"
},
{
"rfilename": "model-00033-of-00048.safetensors"
},
{
"rfilename": "model-00034-of-00048.safetensors"
},
{
"rfilename": "model-00035-of-00048.safetensors"
},
{
"rfilename": "model-00036-of-00048.safetensors"
},
{
"rfilename": "model-00037-of-00048.safetensors"
},
{
"rfilename": "model-00038-of-00048.safetensors"
},
{
"rfilename": "model-00039-of-00048.safetensors"
},
{
"rfilename": "model-00040-of-00048.safetensors"
},
{
"rfilename": "model-00041-of-00048.safetensors"
},
{
"rfilename": "model-00042-of-00048.safetensors"
},
{
"rfilename": "model-00043-of-00048.safetensors"
},
{
"rfilename": "model-00044-of-00048.safetensors"
},
{
"rfilename": "model-00045-of-00048.safetensors"
},
{
"rfilename": "model-00046-of-00048.safetensors"
},
{
"rfilename": "model-00047-of-00048.safetensors"
},
{
"rfilename": "model-00048-of-00048.safetensors"
},
{
"rfilename": "model.safetensors.index.json"
},
{
"rfilename": "tokenizer.json"
},
{
"rfilename": "tokenizer_config.json"
}
],
"spaces": [
"embedl/hfviewer",
"tardellirs/model-pulse",
"ginigen-ai/open-router-leaderboard",
"VIDraft/global-llm-leaderboard",
"zoom-ai/hle-leaderboard",
"lvwerra/agent-artifacts",
"townbox/deepseek-profile-guide",
"bagegegegw/DeepSeek-V4.1-Flash-UNCENSORED-Demo",
"akhaliq/DeepSeek-V4.1-Flash",
"yash-711/deepseek-v41-flash-fit",
"jkorstad/daggr-studio",
"yash-711/what-fits-84gb",
"gonduras/DeepSeek-V4.1-Flash-Demo",
"shareefmx/pdf-knowledge-assistant",
"mzubair-dh/loagaeth-extractor",
"Bob3432433/DeepSeek-V4-Flash",
"Mullernorth/Klaw",
"BhDirty555/OmniForge-AI",
"SZLHOLDINGS/szl-frontier",
"brian-learns/poor-richard",
"kokabtak/kokb1-static",
"venichole/deepseek-v4-1-flash-demo",
"Uwaish/emailwriter",
"Mullernorth/Nimo",
"MrVolts/agents-den",
"gonduras/deepseek-v4-1-flash-demo",
"Joshua56/deepseek-v4-1-flash-demo",
"cookiemonster778/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"leadupapp/deepseek-v41-flash-demo",
"BunsDev/DeepSeek-V4.1-Flash-Demo",
"timmaythetoolmann/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"chizkuhhh/Final_Assignment_Template",
"ggautreau/PanGramGraph",
"MALBIATY/Assignmentunit8",
"rurrence/deepseek-v41-flash-endpoint",
"yeeeeezus/inference",
"pymmdrza/DeepSeek-V4.1-Flash-Demo",
"sergiopaniego/tau2-env",
"TorkeHub/torki-2-benchmarks",
"Cenzer0/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"FineEnvs/RL-Explorer"
],
"tags": [
"transformers",
"safetensors",
"deepseek_v41",
"text-generation",
"image-text-to-text",
"conversational",
"license:mit",
"eval-results",
"endpoints_compatible",
"8-bit",
"fp8",
"region:us"
],
"transformersInfo": {
"auto_model": "AutoModelForCausalLM",
"pipeline_tag": "text-generation"
},
"usedStorage": 510311613821,
"widgetData": [
{
"text": "Hi, what can you help me with?"
},
{
"text": "What is 84 * 3 / 2?"
},
{
"text": "Tell me an interesting fact about the universe!"
},
{
"text": "Explain quantum computing in simple terms."
}
]
} | ||||||||
| likes | 4073receipt
What the source handed over{
"_asked": "deepseek-ai/DeepSeek-V4.1-Flash",
"_id": "6aa213563d5b3527359d1af2",
"author": "deepseek-ai",
"cardData": {
"library_name": "transformers",
"license": "mit",
"pipeline_tag": "image-text-to-text"
},
"config": {
"architectures": [
"DeepseekV41ForCausalLM"
],
"chat_template_jinja": "{#- DeepSeek-V4.1 chat template, ported from encoding/encoding.py in the model repo.\n Extra kwargs: thinking_mode (\"thinking\" | \"chat\", default \"thinking\"; enable_thinking=true/false is accepted\n as an alias), drop_thinking (default true), reasoning_effort (int in [1, 100] or \"low\"/\"medium\"/\"high\"/\"max\",\n default \"high\"). Assistant reasoning is read from reasoning_content, or from thinking as an alias. -#}\n{%- set IMG = \"<|deepseek_image|>\" -%}\n{%- set DSML = \"|DSML|\" -%}\n\n{%- if thinking_mode is not defined -%}\n {%- set thinking_mode = \"chat\" if (enable_thinking is defined and enable_thinking is not none and not enable_thinking) else \"thinking\" -%}\n{%- endif -%}\n{%- if thinking_mode not in [\"chat\", \"thinking\"] -%}\n {{- raise_exception(\"Invalid thinking_mode `\" ~ thinking_mode ~ \"`, should be \\\"chat\\\" or \\\"thinking\\\"\") -}}\n{%- endif -%}\n{%- if drop_thinking is not defined -%}{%- set drop_thinking = true -%}{%- endif -%}\n{%- if add_generation_prompt is not defined -%}{%- set add_generation_prompt = false -%}{%- endif -%}\n{%- if tools is not defined -%}{%- set tools = none -%}{%- endif -%}\n\n{%- if reasoning_effort is not defined or reasoning_effort is none -%}{%- set reasoning_effort = \"high\" -%}{%- endif -%}\n{%- set effort_map = {\"low\": 50, \"medium\": 62, \"high\": 75, \"max\": 100} -%}\n{%- if reasoning_effort is string and reasoning_effort in effort_map -%}\n {%- set budget = effort_map[reasoning_effort] -%}\n{%- elif reasoning_effort is integer and 1 <= reasoning_effort <= 100 -%}\n {%- set budget = reasoning_effort -%}\n{%- else -%}\n {{- raise_exception(\"Invalid reasoning effort: \" ~ reasoning_effort ~ \", should be int within [1,100] or one of \\\"low\\\", \\\"medium\\\", \\\"high\\\", \\\"max\\\"\") -}}\n{%- endif -%}\n\n{#- Text of text/image blocks joined by blank lines; other block types are dropped. -#}\n{%- macro joined_text(blocks) -%}\n {%- set jt = namespace(parts=[]) -%}\n {%- for b in blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set jt.parts = jt.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set jt.parts = jt.parts + [IMG] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- jt.parts | join(\"\\n\\n\") -}}\n{%- endmacro -%}\n\n{#- Splits/validates \"ns::name\" against an explicit namespace and returns the qualified name. -#}\n{%- macro qualified_name(name, ns) -%}\n {%- if ns is mapping -%}{%- set ns = ns.name -%}{%- endif -%}\n {%- set parts = name.split(\"::\", 1) -%}\n {%- if parts | length == 2 -%}\n {%- if ns is not none and ns != parts[0] -%}{{- raise_exception(\"Conflicting tool namespaces: \" ~ ns ~ \" != \" ~ parts[0]) -}}{%- endif -%}\n {%- set ns = parts[0] -%}\n {%- set name = parts[1] -%}\n {%- endif -%}\n {%- if \"::\" in name -%}{{- raise_exception(\"Tool name must not contain '::': \" ~ name) -}}{%- endif -%}\n {%- if ns is not none and \"::\" in ns -%}{{- raise_exception(\"Tool namespace must not contain '::': \" ~ ns) -}}{%- endif -%}\n {{- name if ns is none else ns ~ \"::\" ~ name -}}\n{%- endmacro -%}\n\n{%- macro render_tools(tool_list) -%}\n {%- set ts = namespace(schemas=[]) -%}\n {%- for tool in tool_list -%}\n {%- set fn = tool.function if tool.function is defined else tool -%}\n {%- set ns = tool.namespace if tool.namespace is defined and tool.namespace is not none else fn.get(\"namespace\") -%}\n {%- set schema = namespace(d={}) -%}\n {%- for k, v in fn.items() if k != \"namespace\" -%}{%- set schema.d = dict(schema.d, **{k: v}) -%}{%- endfor -%}\n {%- set schema.d = dict(schema.d, name=qualified_name(fn.name, ns)) -%}\n {%- if ns is mapping and ns.description -%}\n {%- set schema.d = dict(schema.d, description=ns.description ~ \"\\n\" ~ (fn.description or \"\")) -%}\n {%- endif -%}\n {%- set ts.schemas = ts.schemas + [schema.d | tojson] -%}\n {%- endfor -%}\n {{- \"## Tools\\n\\nYou have access to a set of tools to help answer the user's question. You can invoke tools by writing a \\\"<|DSML| calls>\\\" block like the following:\\n\\n<|DSML| calls>\\n<|DSML| invoke name=\\\"$TOOL_NAME\\\">\\n<|DSML| parameter name=\\\"$PARAMETER_NAME\\\" string=\\\"true|false\\\">$PARAMETER_VALUE</|DSML| parameter>\\n...\\n</|DSML| invoke>\\n<|DSML| invoke name=\\\"$TOOL_NAME2\\\">\\n...\\n</|DSML| invoke>\\n</|DSML| calls>\\n\\nString parameters should be specified as is and set `string=\\\"true\\\"`. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string=\\\"false\\\"`.\\n\\nIf thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.\\n\\nOtherwise, output directly after </think> with tool calls or final response.\\n\\n### Available Tool Schemas\\n\\n\" -}}\n {{- ts.schemas | join(\"\\n\") -}}\n {{- \"\\n\\nYou MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls.\\n\" -}}\n{%- endmacro -%}\n\n{#- 1. Merge tool results (and consecutive user turns) into user messages made of content blocks. -#}\n{%- set mns = namespace(list=[]) -%}\n{%- for msg in messages -%}\n {%- set content = msg.get(\"content\") -%}\n {%- set is_blocks = content is iterable and content is not string and content is not mapping -%}\n {%- if content is string and IMG in content -%}\n {{- raise_exception(\"Message content contains image special token \" ~ IMG ~ \". Images should be provided as image content blocks.\") -}}\n {%- endif -%}\n {%- set rc = msg.reasoning_content if msg.get(\"reasoning_content\") is not none else msg.get(\"thinking\") -%}\n {%- if rc is string and IMG in rc -%}\n {{- raise_exception(\"reasoning_content contains image special token \" ~ IMG) -}}\n {%- endif -%}\n {%- set prev = mns.list[-1] if mns.list else none -%}\n {%- if msg.role == \"tool\" -%}\n {%- set tblock = {\"type\": \"tool_result\", \"tool_use_id\": msg.get(\"tool_call_id\", \"\"), \"content\": joined_text(content) if is_blocks else msg.get(\"content\", \"\")} -%}\n {%- if prev is not none and prev.role == \"user\" -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + [tblock])] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [{\"role\": \"user\", \"content_blocks\": [tblock]}] -%}\n {%- endif -%}\n {%- elif msg.role == \"user\" -%}\n {%- set blocks = content if is_blocks else [{\"type\": \"text\", \"text\": content or \"\"}] -%}\n {%- if prev is not none and prev.role == \"user\" and prev.get(\"task\") is none -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + blocks)] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [dict(msg, content_blocks=blocks)] -%}\n {%- endif -%}\n {%- else -%}\n {%- set mns.list = mns.list + [msg] -%}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Top-level tools attach to a leading system message, or to a new empty one. -#}\n{%- if tools -%}\n {%- if mns.list and mns.list[0].role == \"system\" -%}\n {%- if not mns.list[0].get(\"tools\") -%}{%- set mns.list = [dict(mns.list[0], tools=tools)] + mns.list[1:] -%}{%- endif -%}\n {%- else -%}\n {%- set mns.list = [{\"role\": \"system\", \"content\": \"\", \"tools\": tools}] + mns.list -%}\n {%- endif -%}\n{%- endif -%}\n\n{#- 2. Reorder tool results to match the tool_calls order of the preceding assistant message. -#}\n{%- set sns = namespace(list=[], ids=[]) -%}\n{%- for m in mns.list -%}\n {%- if m.role == \"assistant\" and m.get(\"tool_calls\") -%}\n {%- set sns.ids = [] -%}\n {%- for tc in m.tool_calls -%}\n {%- set sns.ids = sns.ids + [tc.get(\"id\") or tc.get(\"function\", {}).get(\"id\", \"\")] -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- elif m.role == \"user\" and m.content_blocks -%}\n {%- set tb = namespace(blocks=[]) -%}\n {%- for b in m.content_blocks if b.type == \"tool_result\" -%}\n {%- set order = namespace(idx=0) -%}\n {%- for tc_id in sns.ids -%}\n {%- if tc_id and tc_id == b.get(\"tool_use_id\", \"\") -%}{%- set order.idx = loop.index0 -%}{%- endif -%}\n {%- endfor -%}\n {%- set tb.blocks = tb.blocks + [dict(b, _order=order.idx)] -%}\n {%- endfor -%}\n {%- if tb.blocks | length > 1 -%}\n {%- set sorted_blocks = tb.blocks | sort(attribute=\"_order\") -%}\n {%- set rb = namespace(blocks=[], i=0) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"tool_result\" -%}\n {%- set rb.blocks = rb.blocks + [sorted_blocks[rb.i]] -%}\n {%- set rb.i = rb.i + 1 -%}\n {%- else -%}\n {%- set rb.blocks = rb.blocks + [b] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [dict(m, content_blocks=rb.blocks)] -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n{%- endfor -%}\n{%- set msgs = sns.list -%}\n\n{#- Mid-conversation system messages count as user turns. Tools anywhere disable drop_thinking. -#}\n{%- set state = namespace(last_user=-1, has_tools=false) -%}\n{%- for m in msgs -%}\n {%- if m.role == \"user\" or (m.role == \"system\" and loop.index0 > 0) -%}{%- set state.last_user = loop.index0 -%}{%- endif -%}\n {%- if m.get(\"tools\") -%}{%- set state.has_tools = true -%}{%- endif -%}\n{%- endfor -%}\n{%- set effective_drop = drop_thinking and not state.has_tools -%}\n{%- set thinking = thinking_mode == \"thinking\" -%}\n\n{{- \"<|begin▁of▁sentence|>\" -}}\n{#- 3. Render each message. -#}\n{%- for m in msgs -%}\n {%- set idx = loop.index0 -%}\n {%- set content = m.get(\"content\") -%}\n {%- if content is iterable and content is not string and content is not mapping -%}{%- set content = joined_text(content) -%}{%- endif -%}\n\n {%- if idx == 0 -%}\n {%- if thinking or m.role == \"system\" -%}{{- \"<|System|>\" -}}{%- endif -%}\n {%- if thinking -%}{{- \"Reasoning Effort: \" ~ budget ~ \" (range 1-100, the higher the value, the more thorough the reasoning)\\n\\n\" -}}{%- endif -%}\n {%- endif -%}\n\n {%- if m.role == \"system\" -%}\n {%- if idx > 0 -%}{{- \"<|System|>\" -}}{%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tools\") -%}{{- \"\\n\\n\" ~ render_tools(m.tools) -}}{%- endif -%}\n {%- if m.get(\"response_format\") -%}\n {{- \"\\n\\n## Response Format:\\n\\nYou MUST strictly adhere to the following schema to reply:\\n\" ~ (m.response_format | tojson) -}}\n {%- endif -%}\n\n {%- elif m.role == \"user\" -%}\n {{- \"<|User|>\" -}}\n {%- set up = namespace(parts=[]) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set up.parts = up.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set up.parts = up.parts + [IMG] -%}\n {%- elif b.type == \"tool_result\" -%}\n {%- set tc = b.get(\"content\", \"\") -%}\n {%- if tc is iterable and tc is not string and tc is not mapping -%}\n {%- set sub = namespace(parts=[]) -%}\n {%- for s in tc -%}\n {%- if s.type == \"text\" -%}{%- set sub.parts = sub.parts + [s.get(\"text\", \"\")] -%}\n {%- elif s.type in [\"image\", \"image_url\"] -%}{%- set sub.parts = sub.parts + [IMG] -%}\n {%- else -%}{%- set sub.parts = sub.parts + [\"[Unsupported \" ~ s.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set tc = sub.parts | join(\"\\n\\n\") -%}\n {%- endif -%}\n {%- set up.parts = up.parts + [\"<tool_result>\" ~ tc ~ \"</tool_result>\"] -%}\n {%- else -%}\n {%- set up.parts = up.parts + [\"[Unsupported \" ~ b.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- up.parts | join(\"\\n\\n\") -}}\n\n {%- elif m.role == \"latest_reminder\" -%}\n {{- \"<|latest_reminder|>\" ~ content -}}\n\n {%- elif m.role == \"assistant\" -%}\n {%- set prev_has_task = idx > 0 and msgs[idx - 1].get(\"task\") is not none -%}\n {%- if thinking and not prev_has_task and (not effective_drop or idx > state.last_user) -%}\n {{- ((m.reasoning_content if m.get(\"reasoning_content\") is not none else m.get(\"thinking\")) or \"\") ~ \"</think>\" -}}\n {%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tool_calls\") -%}\n {%- set tcs = namespace(lines=[]) -%}\n {%- for tc in m.tool_calls -%}\n {%- set fn = tc.function -%}\n {%- set params = namespace(lines=[]) -%}\n {%- set args = fn.arguments if fn.arguments is mapping else {\"arguments\": fn.arguments} -%}\n {%- for k, v in args.items() -%}\n {%- set params.lines = params.lines + [\"<\" ~ DSML ~ \" parameter name=\\\"\" ~ k ~ \"\\\" string=\\\"\" ~ (\"true\" if v is string else \"false\") ~ \"\\\">\" ~ (v if v is string else v | tojson) ~ \"</\" ~ DSML ~ \" parameter>\"] -%}\n {%- endfor -%}\n {%- set name = qualified_name(fn.name, tc.get(\"namespace\") or fn.get(\"namespace\")) -%}\n {%- set tcs.lines = tcs.lines + [\"<\" ~ DSML ~ \" invoke name=\\\"\" ~ name ~ \"\\\">\\n\" ~ params.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" invoke>\"] -%}\n {%- endfor -%}\n {{- \"\\n\\n<\" ~ DSML ~ \" calls>\\n\" ~ tcs.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" calls>\" -}}\n {%- endif -%}\n {%- if not m.get(\"wo_eos\", false) -%}{{- \"<|end▁of▁sentence|>\" -}}{%- endif -%}\n\n {%- else -%}\n {{- raise_exception(\"Unknown role: \" ~ m.role) -}}\n {%- endif -%}\n\n {#- Transition tokens, only when the next message is an assistant/latest_reminder turn or this is the last one. -#}\n {%- if loop.last or msgs[idx + 1].role in [\"assistant\", \"latest_reminder\"] -%}\n {%- set task = m.get(\"task\") -%}\n {%- if task is not none -%}\n {%- set task_tokens = {\"action\": \"<|action|>\", \"query\": \"<|query|>\", \"authority\": \"<|authority|>\", \"domain\": \"<|domain|>\", \"title\": \"<|title|>\", \"read_url\": \"<|read_url|>\"} -%}\n {%- if task not in task_tokens -%}{{- raise_exception(\"Invalid task: '\" ~ task ~ \"'\") -}}{%- endif -%}\n {%- if task == \"action\" -%}{{- \"<|Assistant|>\" ~ (\"<think>\" if thinking else \"</think>\") -}}{%- endif -%}\n {{- task_tokens[task] -}}\n {%- elif (m.role == \"user\" or (m.role == \"system\" and idx > 0)) and (add_generation_prompt or not loop.last) -%}\n {{- \"<|Assistant|>\" ~ (\"<think>\" if thinking and (not effective_drop or idx >= state.last_user) else \"</think>\") -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n",
"model_type": "deepseek_v41",
"quantization_config": {
"quant_method": "fp8"
},
"tokenizer_config": {
"bos_token": {
"__type": "AddedToken",
"content": "<|begin▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"eos_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"unk_token": null
}
},
"createdAt": "2026-09-10T02:17:58.000Z",
"disabled": false,
"downloads": 798422,
"gated": false,
"id": "deepseek-ai/DeepSeek-V4.1-Flash",
"inference": "warm",
"lastModified": "2026-10-01T05:56:24.000Z",
"library_name": "transformers",
"likes": 4073,
"model-index": null,
"modelId": "deepseek-ai/DeepSeek-V4.1-Flash",
"pipeline_tag": "image-text-to-text",
"private": false,
"safetensors": {
"parameters": {
"BF16": 1976441856,
"F32": 42307282,
"F8_E4M3": 204015223296,
"I8": 557171343360
},
"total": 763205315794
},
"sha": "2cba9e42aa026125f3ed06c6d98c1db82f7ca027",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "DeepSeek_V41_Tech_Report.pdf"
},
{
"rfilename": "LICENSE"
},
{
"rfilename": "README.md"
},
{
"rfilename": "assets/dsv41_agentic_performance.png"
},
{
"rfilename": "assets/dsv41_kv_cache.png"
},
{
"rfilename": "chat_template.jinja"
},
{
"rfilename": "config.json"
},
{
"rfilename": "encoding/README.md"
},
{
"rfilename": "encoding/encoding.py"
},
{
"rfilename": "encoding/test_encoding.py"
},
{
"rfilename": "encoding/tests/test_input_1.json"
},
{
"rfilename": "encoding/tests/test_input_2.json"
},
{
"rfilename": "encoding/tests/test_input_3.json"
},
{
"rfilename": "encoding/tests/test_input_4.json"
},
{
"rfilename": "encoding/tests/test_input_5.json"
},
{
"rfilename": "encoding/tests/test_output_1.txt"
},
{
"rfilename": "encoding/tests/test_output_2.txt"
},
{
"rfilename": "encoding/tests/test_output_3.txt"
},
{
"rfilename": "encoding/tests/test_output_4.txt"
},
{
"rfilename": "encoding/tests/test_output_5.txt"
},
{
"rfilename": "evaluation/README.md"
},
{
"rfilename": "evaluation/dsh-minimal.patch"
},
{
"rfilename": "inference/README.md"
},
{
"rfilename": "inference/config.json"
},
{
"rfilename": "inference/convert.py"
},
{
"rfilename": "inference/engram.py"
},
{
"rfilename": "inference/examples/example.txt"
},
{
"rfilename": "inference/examples/example_harmony.json"
},
{
"rfilename": "inference/examples/images/carrots.jpeg"
},
{
"rfilename": "inference/examples/images/corn.jpeg"
},
{
"rfilename": "inference/generate.py"
},
{
"rfilename": "inference/image_processor.py"
},
{
"rfilename": "inference/kernel.py"
},
{
"rfilename": "inference/model.py"
},
{
"rfilename": "inference/requirements.txt"
},
{
"rfilename": "inference/run.sh"
},
{
"rfilename": "inference/vision.py"
},
{
"rfilename": "model-00001-of-00048.safetensors"
},
{
"rfilename": "model-00002-of-00048.safetensors"
},
{
"rfilename": "model-00003-of-00048.safetensors"
},
{
"rfilename": "model-00004-of-00048.safetensors"
},
{
"rfilename": "model-00005-of-00048.safetensors"
},
{
"rfilename": "model-00006-of-00048.safetensors"
},
{
"rfilename": "model-00007-of-00048.safetensors"
},
{
"rfilename": "model-00008-of-00048.safetensors"
},
{
"rfilename": "model-00009-of-00048.safetensors"
},
{
"rfilename": "model-00010-of-00048.safetensors"
},
{
"rfilename": "model-00011-of-00048.safetensors"
},
{
"rfilename": "model-00012-of-00048.safetensors"
},
{
"rfilename": "model-00013-of-00048.safetensors"
},
{
"rfilename": "model-00014-of-00048.safetensors"
},
{
"rfilename": "model-00015-of-00048.safetensors"
},
{
"rfilename": "model-00016-of-00048.safetensors"
},
{
"rfilename": "model-00017-of-00048.safetensors"
},
{
"rfilename": "model-00018-of-00048.safetensors"
},
{
"rfilename": "model-00019-of-00048.safetensors"
},
{
"rfilename": "model-00020-of-00048.safetensors"
},
{
"rfilename": "model-00021-of-00048.safetensors"
},
{
"rfilename": "model-00022-of-00048.safetensors"
},
{
"rfilename": "model-00023-of-00048.safetensors"
},
{
"rfilename": "model-00024-of-00048.safetensors"
},
{
"rfilename": "model-00025-of-00048.safetensors"
},
{
"rfilename": "model-00026-of-00048.safetensors"
},
{
"rfilename": "model-00027-of-00048.safetensors"
},
{
"rfilename": "model-00028-of-00048.safetensors"
},
{
"rfilename": "model-00029-of-00048.safetensors"
},
{
"rfilename": "model-00030-of-00048.safetensors"
},
{
"rfilename": "model-00031-of-00048.safetensors"
},
{
"rfilename": "model-00032-of-00048.safetensors"
},
{
"rfilename": "model-00033-of-00048.safetensors"
},
{
"rfilename": "model-00034-of-00048.safetensors"
},
{
"rfilename": "model-00035-of-00048.safetensors"
},
{
"rfilename": "model-00036-of-00048.safetensors"
},
{
"rfilename": "model-00037-of-00048.safetensors"
},
{
"rfilename": "model-00038-of-00048.safetensors"
},
{
"rfilename": "model-00039-of-00048.safetensors"
},
{
"rfilename": "model-00040-of-00048.safetensors"
},
{
"rfilename": "model-00041-of-00048.safetensors"
},
{
"rfilename": "model-00042-of-00048.safetensors"
},
{
"rfilename": "model-00043-of-00048.safetensors"
},
{
"rfilename": "model-00044-of-00048.safetensors"
},
{
"rfilename": "model-00045-of-00048.safetensors"
},
{
"rfilename": "model-00046-of-00048.safetensors"
},
{
"rfilename": "model-00047-of-00048.safetensors"
},
{
"rfilename": "model-00048-of-00048.safetensors"
},
{
"rfilename": "model.safetensors.index.json"
},
{
"rfilename": "tokenizer.json"
},
{
"rfilename": "tokenizer_config.json"
}
],
"spaces": [
"embedl/hfviewer",
"tardellirs/model-pulse",
"ginigen-ai/open-router-leaderboard",
"VIDraft/global-llm-leaderboard",
"zoom-ai/hle-leaderboard",
"lvwerra/agent-artifacts",
"townbox/deepseek-profile-guide",
"bagegegegw/DeepSeek-V4.1-Flash-UNCENSORED-Demo",
"akhaliq/DeepSeek-V4.1-Flash",
"yash-711/deepseek-v41-flash-fit",
"jkorstad/daggr-studio",
"yash-711/what-fits-84gb",
"gonduras/DeepSeek-V4.1-Flash-Demo",
"shareefmx/pdf-knowledge-assistant",
"mzubair-dh/loagaeth-extractor",
"Bob3432433/DeepSeek-V4-Flash",
"Mullernorth/Klaw",
"BhDirty555/OmniForge-AI",
"SZLHOLDINGS/szl-frontier",
"brian-learns/poor-richard",
"kokabtak/kokb1-static",
"venichole/deepseek-v4-1-flash-demo",
"Uwaish/emailwriter",
"Mullernorth/Nimo",
"MrVolts/agents-den",
"gonduras/deepseek-v4-1-flash-demo",
"Joshua56/deepseek-v4-1-flash-demo",
"cookiemonster778/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"leadupapp/deepseek-v41-flash-demo",
"BunsDev/DeepSeek-V4.1-Flash-Demo",
"timmaythetoolmann/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"chizkuhhh/Final_Assignment_Template",
"ggautreau/PanGramGraph",
"MALBIATY/Assignmentunit8",
"rurrence/deepseek-v41-flash-endpoint",
"yeeeeezus/inference",
"pymmdrza/DeepSeek-V4.1-Flash-Demo",
"sergiopaniego/tau2-env",
"TorkeHub/torki-2-benchmarks",
"Cenzer0/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"FineEnvs/RL-Explorer"
],
"tags": [
"transformers",
"safetensors",
"deepseek_v41",
"text-generation",
"image-text-to-text",
"conversational",
"license:mit",
"eval-results",
"endpoints_compatible",
"8-bit",
"fp8",
"region:us"
],
"transformersInfo": {
"auto_model": "AutoModelForCausalLM",
"pipeline_tag": "text-generation"
},
"usedStorage": 510311613821,
"widgetData": [
{
"text": "Hi, what can you help me with?"
},
{
"text": "What is 84 * 3 / 2?"
},
{
"text": "Tell me an interesting fact about the universe!"
},
{
"text": "Explain quantum computing in simple terms."
}
]
} | ||||||||
| task | image-text-to-textreceipt
What the source handed over{
"_asked": "deepseek-ai/DeepSeek-V4.1-Flash",
"_id": "6aa213563d5b3527359d1af2",
"author": "deepseek-ai",
"cardData": {
"library_name": "transformers",
"license": "mit",
"pipeline_tag": "image-text-to-text"
},
"config": {
"architectures": [
"DeepseekV41ForCausalLM"
],
"chat_template_jinja": "{#- DeepSeek-V4.1 chat template, ported from encoding/encoding.py in the model repo.\n Extra kwargs: thinking_mode (\"thinking\" | \"chat\", default \"thinking\"; enable_thinking=true/false is accepted\n as an alias), drop_thinking (default true), reasoning_effort (int in [1, 100] or \"low\"/\"medium\"/\"high\"/\"max\",\n default \"high\"). Assistant reasoning is read from reasoning_content, or from thinking as an alias. -#}\n{%- set IMG = \"<|deepseek_image|>\" -%}\n{%- set DSML = \"|DSML|\" -%}\n\n{%- if thinking_mode is not defined -%}\n {%- set thinking_mode = \"chat\" if (enable_thinking is defined and enable_thinking is not none and not enable_thinking) else \"thinking\" -%}\n{%- endif -%}\n{%- if thinking_mode not in [\"chat\", \"thinking\"] -%}\n {{- raise_exception(\"Invalid thinking_mode `\" ~ thinking_mode ~ \"`, should be \\\"chat\\\" or \\\"thinking\\\"\") -}}\n{%- endif -%}\n{%- if drop_thinking is not defined -%}{%- set drop_thinking = true -%}{%- endif -%}\n{%- if add_generation_prompt is not defined -%}{%- set add_generation_prompt = false -%}{%- endif -%}\n{%- if tools is not defined -%}{%- set tools = none -%}{%- endif -%}\n\n{%- if reasoning_effort is not defined or reasoning_effort is none -%}{%- set reasoning_effort = \"high\" -%}{%- endif -%}\n{%- set effort_map = {\"low\": 50, \"medium\": 62, \"high\": 75, \"max\": 100} -%}\n{%- if reasoning_effort is string and reasoning_effort in effort_map -%}\n {%- set budget = effort_map[reasoning_effort] -%}\n{%- elif reasoning_effort is integer and 1 <= reasoning_effort <= 100 -%}\n {%- set budget = reasoning_effort -%}\n{%- else -%}\n {{- raise_exception(\"Invalid reasoning effort: \" ~ reasoning_effort ~ \", should be int within [1,100] or one of \\\"low\\\", \\\"medium\\\", \\\"high\\\", \\\"max\\\"\") -}}\n{%- endif -%}\n\n{#- Text of text/image blocks joined by blank lines; other block types are dropped. -#}\n{%- macro joined_text(blocks) -%}\n {%- set jt = namespace(parts=[]) -%}\n {%- for b in blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set jt.parts = jt.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set jt.parts = jt.parts + [IMG] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- jt.parts | join(\"\\n\\n\") -}}\n{%- endmacro -%}\n\n{#- Splits/validates \"ns::name\" against an explicit namespace and returns the qualified name. -#}\n{%- macro qualified_name(name, ns) -%}\n {%- if ns is mapping -%}{%- set ns = ns.name -%}{%- endif -%}\n {%- set parts = name.split(\"::\", 1) -%}\n {%- if parts | length == 2 -%}\n {%- if ns is not none and ns != parts[0] -%}{{- raise_exception(\"Conflicting tool namespaces: \" ~ ns ~ \" != \" ~ parts[0]) -}}{%- endif -%}\n {%- set ns = parts[0] -%}\n {%- set name = parts[1] -%}\n {%- endif -%}\n {%- if \"::\" in name -%}{{- raise_exception(\"Tool name must not contain '::': \" ~ name) -}}{%- endif -%}\n {%- if ns is not none and \"::\" in ns -%}{{- raise_exception(\"Tool namespace must not contain '::': \" ~ ns) -}}{%- endif -%}\n {{- name if ns is none else ns ~ \"::\" ~ name -}}\n{%- endmacro -%}\n\n{%- macro render_tools(tool_list) -%}\n {%- set ts = namespace(schemas=[]) -%}\n {%- for tool in tool_list -%}\n {%- set fn = tool.function if tool.function is defined else tool -%}\n {%- set ns = tool.namespace if tool.namespace is defined and tool.namespace is not none else fn.get(\"namespace\") -%}\n {%- set schema = namespace(d={}) -%}\n {%- for k, v in fn.items() if k != \"namespace\" -%}{%- set schema.d = dict(schema.d, **{k: v}) -%}{%- endfor -%}\n {%- set schema.d = dict(schema.d, name=qualified_name(fn.name, ns)) -%}\n {%- if ns is mapping and ns.description -%}\n {%- set schema.d = dict(schema.d, description=ns.description ~ \"\\n\" ~ (fn.description or \"\")) -%}\n {%- endif -%}\n {%- set ts.schemas = ts.schemas + [schema.d | tojson] -%}\n {%- endfor -%}\n {{- \"## Tools\\n\\nYou have access to a set of tools to help answer the user's question. You can invoke tools by writing a \\\"<|DSML| calls>\\\" block like the following:\\n\\n<|DSML| calls>\\n<|DSML| invoke name=\\\"$TOOL_NAME\\\">\\n<|DSML| parameter name=\\\"$PARAMETER_NAME\\\" string=\\\"true|false\\\">$PARAMETER_VALUE</|DSML| parameter>\\n...\\n</|DSML| invoke>\\n<|DSML| invoke name=\\\"$TOOL_NAME2\\\">\\n...\\n</|DSML| invoke>\\n</|DSML| calls>\\n\\nString parameters should be specified as is and set `string=\\\"true\\\"`. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string=\\\"false\\\"`.\\n\\nIf thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.\\n\\nOtherwise, output directly after </think> with tool calls or final response.\\n\\n### Available Tool Schemas\\n\\n\" -}}\n {{- ts.schemas | join(\"\\n\") -}}\n {{- \"\\n\\nYou MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls.\\n\" -}}\n{%- endmacro -%}\n\n{#- 1. Merge tool results (and consecutive user turns) into user messages made of content blocks. -#}\n{%- set mns = namespace(list=[]) -%}\n{%- for msg in messages -%}\n {%- set content = msg.get(\"content\") -%}\n {%- set is_blocks = content is iterable and content is not string and content is not mapping -%}\n {%- if content is string and IMG in content -%}\n {{- raise_exception(\"Message content contains image special token \" ~ IMG ~ \". Images should be provided as image content blocks.\") -}}\n {%- endif -%}\n {%- set rc = msg.reasoning_content if msg.get(\"reasoning_content\") is not none else msg.get(\"thinking\") -%}\n {%- if rc is string and IMG in rc -%}\n {{- raise_exception(\"reasoning_content contains image special token \" ~ IMG) -}}\n {%- endif -%}\n {%- set prev = mns.list[-1] if mns.list else none -%}\n {%- if msg.role == \"tool\" -%}\n {%- set tblock = {\"type\": \"tool_result\", \"tool_use_id\": msg.get(\"tool_call_id\", \"\"), \"content\": joined_text(content) if is_blocks else msg.get(\"content\", \"\")} -%}\n {%- if prev is not none and prev.role == \"user\" -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + [tblock])] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [{\"role\": \"user\", \"content_blocks\": [tblock]}] -%}\n {%- endif -%}\n {%- elif msg.role == \"user\" -%}\n {%- set blocks = content if is_blocks else [{\"type\": \"text\", \"text\": content or \"\"}] -%}\n {%- if prev is not none and prev.role == \"user\" and prev.get(\"task\") is none -%}\n {%- set mns.list = mns.list[:-1] + [dict(prev, content_blocks=prev.content_blocks + blocks)] -%}\n {%- else -%}\n {%- set mns.list = mns.list + [dict(msg, content_blocks=blocks)] -%}\n {%- endif -%}\n {%- else -%}\n {%- set mns.list = mns.list + [msg] -%}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Top-level tools attach to a leading system message, or to a new empty one. -#}\n{%- if tools -%}\n {%- if mns.list and mns.list[0].role == \"system\" -%}\n {%- if not mns.list[0].get(\"tools\") -%}{%- set mns.list = [dict(mns.list[0], tools=tools)] + mns.list[1:] -%}{%- endif -%}\n {%- else -%}\n {%- set mns.list = [{\"role\": \"system\", \"content\": \"\", \"tools\": tools}] + mns.list -%}\n {%- endif -%}\n{%- endif -%}\n\n{#- 2. Reorder tool results to match the tool_calls order of the preceding assistant message. -#}\n{%- set sns = namespace(list=[], ids=[]) -%}\n{%- for m in mns.list -%}\n {%- if m.role == \"assistant\" and m.get(\"tool_calls\") -%}\n {%- set sns.ids = [] -%}\n {%- for tc in m.tool_calls -%}\n {%- set sns.ids = sns.ids + [tc.get(\"id\") or tc.get(\"function\", {}).get(\"id\", \"\")] -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- elif m.role == \"user\" and m.content_blocks -%}\n {%- set tb = namespace(blocks=[]) -%}\n {%- for b in m.content_blocks if b.type == \"tool_result\" -%}\n {%- set order = namespace(idx=0) -%}\n {%- for tc_id in sns.ids -%}\n {%- if tc_id and tc_id == b.get(\"tool_use_id\", \"\") -%}{%- set order.idx = loop.index0 -%}{%- endif -%}\n {%- endfor -%}\n {%- set tb.blocks = tb.blocks + [dict(b, _order=order.idx)] -%}\n {%- endfor -%}\n {%- if tb.blocks | length > 1 -%}\n {%- set sorted_blocks = tb.blocks | sort(attribute=\"_order\") -%}\n {%- set rb = namespace(blocks=[], i=0) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"tool_result\" -%}\n {%- set rb.blocks = rb.blocks + [sorted_blocks[rb.i]] -%}\n {%- set rb.i = rb.i + 1 -%}\n {%- else -%}\n {%- set rb.blocks = rb.blocks + [b] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set sns.list = sns.list + [dict(m, content_blocks=rb.blocks)] -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n {%- else -%}\n {%- set sns.list = sns.list + [m] -%}\n {%- endif -%}\n{%- endfor -%}\n{%- set msgs = sns.list -%}\n\n{#- Mid-conversation system messages count as user turns. Tools anywhere disable drop_thinking. -#}\n{%- set state = namespace(last_user=-1, has_tools=false) -%}\n{%- for m in msgs -%}\n {%- if m.role == \"user\" or (m.role == \"system\" and loop.index0 > 0) -%}{%- set state.last_user = loop.index0 -%}{%- endif -%}\n {%- if m.get(\"tools\") -%}{%- set state.has_tools = true -%}{%- endif -%}\n{%- endfor -%}\n{%- set effective_drop = drop_thinking and not state.has_tools -%}\n{%- set thinking = thinking_mode == \"thinking\" -%}\n\n{{- \"<|begin▁of▁sentence|>\" -}}\n{#- 3. Render each message. -#}\n{%- for m in msgs -%}\n {%- set idx = loop.index0 -%}\n {%- set content = m.get(\"content\") -%}\n {%- if content is iterable and content is not string and content is not mapping -%}{%- set content = joined_text(content) -%}{%- endif -%}\n\n {%- if idx == 0 -%}\n {%- if thinking or m.role == \"system\" -%}{{- \"<|System|>\" -}}{%- endif -%}\n {%- if thinking -%}{{- \"Reasoning Effort: \" ~ budget ~ \" (range 1-100, the higher the value, the more thorough the reasoning)\\n\\n\" -}}{%- endif -%}\n {%- endif -%}\n\n {%- if m.role == \"system\" -%}\n {%- if idx > 0 -%}{{- \"<|System|>\" -}}{%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tools\") -%}{{- \"\\n\\n\" ~ render_tools(m.tools) -}}{%- endif -%}\n {%- if m.get(\"response_format\") -%}\n {{- \"\\n\\n## Response Format:\\n\\nYou MUST strictly adhere to the following schema to reply:\\n\" ~ (m.response_format | tojson) -}}\n {%- endif -%}\n\n {%- elif m.role == \"user\" -%}\n {{- \"<|User|>\" -}}\n {%- set up = namespace(parts=[]) -%}\n {%- for b in m.content_blocks -%}\n {%- if b.type == \"text\" -%}\n {%- if IMG in (b.text or \"\") -%}{{- raise_exception(\"Text block contains image placeholder \" ~ IMG ~ \". Images should be separate content blocks.\") -}}{%- endif -%}\n {%- set up.parts = up.parts + [b.text or \"\"] -%}\n {%- elif b.type in [\"image\", \"image_url\"] -%}\n {%- set up.parts = up.parts + [IMG] -%}\n {%- elif b.type == \"tool_result\" -%}\n {%- set tc = b.get(\"content\", \"\") -%}\n {%- if tc is iterable and tc is not string and tc is not mapping -%}\n {%- set sub = namespace(parts=[]) -%}\n {%- for s in tc -%}\n {%- if s.type == \"text\" -%}{%- set sub.parts = sub.parts + [s.get(\"text\", \"\")] -%}\n {%- elif s.type in [\"image\", \"image_url\"] -%}{%- set sub.parts = sub.parts + [IMG] -%}\n {%- else -%}{%- set sub.parts = sub.parts + [\"[Unsupported \" ~ s.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {%- set tc = sub.parts | join(\"\\n\\n\") -%}\n {%- endif -%}\n {%- set up.parts = up.parts + [\"<tool_result>\" ~ tc ~ \"</tool_result>\"] -%}\n {%- else -%}\n {%- set up.parts = up.parts + [\"[Unsupported \" ~ b.type ~ \"]\"] -%}\n {%- endif -%}\n {%- endfor -%}\n {{- up.parts | join(\"\\n\\n\") -}}\n\n {%- elif m.role == \"latest_reminder\" -%}\n {{- \"<|latest_reminder|>\" ~ content -}}\n\n {%- elif m.role == \"assistant\" -%}\n {%- set prev_has_task = idx > 0 and msgs[idx - 1].get(\"task\") is not none -%}\n {%- if thinking and not prev_has_task and (not effective_drop or idx > state.last_user) -%}\n {{- ((m.reasoning_content if m.get(\"reasoning_content\") is not none else m.get(\"thinking\")) or \"\") ~ \"</think>\" -}}\n {%- endif -%}\n {{- content or \"\" -}}\n {%- if m.get(\"tool_calls\") -%}\n {%- set tcs = namespace(lines=[]) -%}\n {%- for tc in m.tool_calls -%}\n {%- set fn = tc.function -%}\n {%- set params = namespace(lines=[]) -%}\n {%- set args = fn.arguments if fn.arguments is mapping else {\"arguments\": fn.arguments} -%}\n {%- for k, v in args.items() -%}\n {%- set params.lines = params.lines + [\"<\" ~ DSML ~ \" parameter name=\\\"\" ~ k ~ \"\\\" string=\\\"\" ~ (\"true\" if v is string else \"false\") ~ \"\\\">\" ~ (v if v is string else v | tojson) ~ \"</\" ~ DSML ~ \" parameter>\"] -%}\n {%- endfor -%}\n {%- set name = qualified_name(fn.name, tc.get(\"namespace\") or fn.get(\"namespace\")) -%}\n {%- set tcs.lines = tcs.lines + [\"<\" ~ DSML ~ \" invoke name=\\\"\" ~ name ~ \"\\\">\\n\" ~ params.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" invoke>\"] -%}\n {%- endfor -%}\n {{- \"\\n\\n<\" ~ DSML ~ \" calls>\\n\" ~ tcs.lines | join(\"\\n\") ~ \"\\n</\" ~ DSML ~ \" calls>\" -}}\n {%- endif -%}\n {%- if not m.get(\"wo_eos\", false) -%}{{- \"<|end▁of▁sentence|>\" -}}{%- endif -%}\n\n {%- else -%}\n {{- raise_exception(\"Unknown role: \" ~ m.role) -}}\n {%- endif -%}\n\n {#- Transition tokens, only when the next message is an assistant/latest_reminder turn or this is the last one. -#}\n {%- if loop.last or msgs[idx + 1].role in [\"assistant\", \"latest_reminder\"] -%}\n {%- set task = m.get(\"task\") -%}\n {%- if task is not none -%}\n {%- set task_tokens = {\"action\": \"<|action|>\", \"query\": \"<|query|>\", \"authority\": \"<|authority|>\", \"domain\": \"<|domain|>\", \"title\": \"<|title|>\", \"read_url\": \"<|read_url|>\"} -%}\n {%- if task not in task_tokens -%}{{- raise_exception(\"Invalid task: '\" ~ task ~ \"'\") -}}{%- endif -%}\n {%- if task == \"action\" -%}{{- \"<|Assistant|>\" ~ (\"<think>\" if thinking else \"</think>\") -}}{%- endif -%}\n {{- task_tokens[task] -}}\n {%- elif (m.role == \"user\" or (m.role == \"system\" and idx > 0)) and (add_generation_prompt or not loop.last) -%}\n {{- \"<|Assistant|>\" ~ (\"<think>\" if thinking and (not effective_drop or idx >= state.last_user) else \"</think>\") -}}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n",
"model_type": "deepseek_v41",
"quantization_config": {
"quant_method": "fp8"
},
"tokenizer_config": {
"bos_token": {
"__type": "AddedToken",
"content": "<|begin▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"eos_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": {
"__type": "AddedToken",
"content": "<|end▁of▁sentence|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"unk_token": null
}
},
"createdAt": "2026-09-10T02:17:58.000Z",
"disabled": false,
"downloads": 798422,
"gated": false,
"id": "deepseek-ai/DeepSeek-V4.1-Flash",
"inference": "warm",
"lastModified": "2026-10-01T05:56:24.000Z",
"library_name": "transformers",
"likes": 4073,
"model-index": null,
"modelId": "deepseek-ai/DeepSeek-V4.1-Flash",
"pipeline_tag": "image-text-to-text",
"private": false,
"safetensors": {
"parameters": {
"BF16": 1976441856,
"F32": 42307282,
"F8_E4M3": 204015223296,
"I8": 557171343360
},
"total": 763205315794
},
"sha": "2cba9e42aa026125f3ed06c6d98c1db82f7ca027",
"siblings": [
{
"rfilename": ".gitattributes"
},
{
"rfilename": "DeepSeek_V41_Tech_Report.pdf"
},
{
"rfilename": "LICENSE"
},
{
"rfilename": "README.md"
},
{
"rfilename": "assets/dsv41_agentic_performance.png"
},
{
"rfilename": "assets/dsv41_kv_cache.png"
},
{
"rfilename": "chat_template.jinja"
},
{
"rfilename": "config.json"
},
{
"rfilename": "encoding/README.md"
},
{
"rfilename": "encoding/encoding.py"
},
{
"rfilename": "encoding/test_encoding.py"
},
{
"rfilename": "encoding/tests/test_input_1.json"
},
{
"rfilename": "encoding/tests/test_input_2.json"
},
{
"rfilename": "encoding/tests/test_input_3.json"
},
{
"rfilename": "encoding/tests/test_input_4.json"
},
{
"rfilename": "encoding/tests/test_input_5.json"
},
{
"rfilename": "encoding/tests/test_output_1.txt"
},
{
"rfilename": "encoding/tests/test_output_2.txt"
},
{
"rfilename": "encoding/tests/test_output_3.txt"
},
{
"rfilename": "encoding/tests/test_output_4.txt"
},
{
"rfilename": "encoding/tests/test_output_5.txt"
},
{
"rfilename": "evaluation/README.md"
},
{
"rfilename": "evaluation/dsh-minimal.patch"
},
{
"rfilename": "inference/README.md"
},
{
"rfilename": "inference/config.json"
},
{
"rfilename": "inference/convert.py"
},
{
"rfilename": "inference/engram.py"
},
{
"rfilename": "inference/examples/example.txt"
},
{
"rfilename": "inference/examples/example_harmony.json"
},
{
"rfilename": "inference/examples/images/carrots.jpeg"
},
{
"rfilename": "inference/examples/images/corn.jpeg"
},
{
"rfilename": "inference/generate.py"
},
{
"rfilename": "inference/image_processor.py"
},
{
"rfilename": "inference/kernel.py"
},
{
"rfilename": "inference/model.py"
},
{
"rfilename": "inference/requirements.txt"
},
{
"rfilename": "inference/run.sh"
},
{
"rfilename": "inference/vision.py"
},
{
"rfilename": "model-00001-of-00048.safetensors"
},
{
"rfilename": "model-00002-of-00048.safetensors"
},
{
"rfilename": "model-00003-of-00048.safetensors"
},
{
"rfilename": "model-00004-of-00048.safetensors"
},
{
"rfilename": "model-00005-of-00048.safetensors"
},
{
"rfilename": "model-00006-of-00048.safetensors"
},
{
"rfilename": "model-00007-of-00048.safetensors"
},
{
"rfilename": "model-00008-of-00048.safetensors"
},
{
"rfilename": "model-00009-of-00048.safetensors"
},
{
"rfilename": "model-00010-of-00048.safetensors"
},
{
"rfilename": "model-00011-of-00048.safetensors"
},
{
"rfilename": "model-00012-of-00048.safetensors"
},
{
"rfilename": "model-00013-of-00048.safetensors"
},
{
"rfilename": "model-00014-of-00048.safetensors"
},
{
"rfilename": "model-00015-of-00048.safetensors"
},
{
"rfilename": "model-00016-of-00048.safetensors"
},
{
"rfilename": "model-00017-of-00048.safetensors"
},
{
"rfilename": "model-00018-of-00048.safetensors"
},
{
"rfilename": "model-00019-of-00048.safetensors"
},
{
"rfilename": "model-00020-of-00048.safetensors"
},
{
"rfilename": "model-00021-of-00048.safetensors"
},
{
"rfilename": "model-00022-of-00048.safetensors"
},
{
"rfilename": "model-00023-of-00048.safetensors"
},
{
"rfilename": "model-00024-of-00048.safetensors"
},
{
"rfilename": "model-00025-of-00048.safetensors"
},
{
"rfilename": "model-00026-of-00048.safetensors"
},
{
"rfilename": "model-00027-of-00048.safetensors"
},
{
"rfilename": "model-00028-of-00048.safetensors"
},
{
"rfilename": "model-00029-of-00048.safetensors"
},
{
"rfilename": "model-00030-of-00048.safetensors"
},
{
"rfilename": "model-00031-of-00048.safetensors"
},
{
"rfilename": "model-00032-of-00048.safetensors"
},
{
"rfilename": "model-00033-of-00048.safetensors"
},
{
"rfilename": "model-00034-of-00048.safetensors"
},
{
"rfilename": "model-00035-of-00048.safetensors"
},
{
"rfilename": "model-00036-of-00048.safetensors"
},
{
"rfilename": "model-00037-of-00048.safetensors"
},
{
"rfilename": "model-00038-of-00048.safetensors"
},
{
"rfilename": "model-00039-of-00048.safetensors"
},
{
"rfilename": "model-00040-of-00048.safetensors"
},
{
"rfilename": "model-00041-of-00048.safetensors"
},
{
"rfilename": "model-00042-of-00048.safetensors"
},
{
"rfilename": "model-00043-of-00048.safetensors"
},
{
"rfilename": "model-00044-of-00048.safetensors"
},
{
"rfilename": "model-00045-of-00048.safetensors"
},
{
"rfilename": "model-00046-of-00048.safetensors"
},
{
"rfilename": "model-00047-of-00048.safetensors"
},
{
"rfilename": "model-00048-of-00048.safetensors"
},
{
"rfilename": "model.safetensors.index.json"
},
{
"rfilename": "tokenizer.json"
},
{
"rfilename": "tokenizer_config.json"
}
],
"spaces": [
"embedl/hfviewer",
"tardellirs/model-pulse",
"ginigen-ai/open-router-leaderboard",
"VIDraft/global-llm-leaderboard",
"zoom-ai/hle-leaderboard",
"lvwerra/agent-artifacts",
"townbox/deepseek-profile-guide",
"bagegegegw/DeepSeek-V4.1-Flash-UNCENSORED-Demo",
"akhaliq/DeepSeek-V4.1-Flash",
"yash-711/deepseek-v41-flash-fit",
"jkorstad/daggr-studio",
"yash-711/what-fits-84gb",
"gonduras/DeepSeek-V4.1-Flash-Demo",
"shareefmx/pdf-knowledge-assistant",
"mzubair-dh/loagaeth-extractor",
"Bob3432433/DeepSeek-V4-Flash",
"Mullernorth/Klaw",
"BhDirty555/OmniForge-AI",
"SZLHOLDINGS/szl-frontier",
"brian-learns/poor-richard",
"kokabtak/kokb1-static",
"venichole/deepseek-v4-1-flash-demo",
"Uwaish/emailwriter",
"Mullernorth/Nimo",
"MrVolts/agents-den",
"gonduras/deepseek-v4-1-flash-demo",
"Joshua56/deepseek-v4-1-flash-demo",
"cookiemonster778/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"leadupapp/deepseek-v41-flash-demo",
"BunsDev/DeepSeek-V4.1-Flash-Demo",
"timmaythetoolmann/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"chizkuhhh/Final_Assignment_Template",
"ggautreau/PanGramGraph",
"MALBIATY/Assignmentunit8",
"rurrence/deepseek-v41-flash-endpoint",
"yeeeeezus/inference",
"pymmdrza/DeepSeek-V4.1-Flash-Demo",
"sergiopaniego/tau2-env",
"TorkeHub/torki-2-benchmarks",
"Cenzer0/DeepSeek-V4.1-Flash-Abliterated-Cybersecurity",
"FineEnvs/RL-Explorer"
],
"tags": [
"transformers",
"safetensors",
"deepseek_v41",
"text-generation",
"image-text-to-text",
"conversational",
"license:mit",
"eval-results",
"endpoints_compatible",
"8-bit",
"fp8",
"region:us"
],
"transformersInfo": {
"auto_model": "AutoModelForCausalLM",
"pipeline_tag": "text-generation"
},
"usedStorage": 510311613821,
"widgetData": [
{
"text": "Hi, what can you help me with?"
},
{
"text": "What is 84 * 3 / 2?"
},
{
"text": "Tell me an interesting fact about the universe!"
},
{
"text": "Explain quantum computing in simple terms."
}
]
} |
Text
This source's terms allow its title, its values and a link here, not its text. It is at https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash.