23.6K 7 months ago

DeepSeek's first-generation of reasoning models with comparable performance to OpenAI-o1, including six dense models distilled from DeepSeek-R1 based on Llama and Qwen. With Tool Calling support.

tools 1.5b 7b 8b 14b 32b 70b 671b
a3723e8242d3 · 1.3kB
{{- if .Messages }}
{{- if or .System .Tools }}
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}
You are a helpful assistant with tool calling capabilities. When you receive a tool call response, use the output to format an answer to the original user's question.
{{- end }}
{{- end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}
User:
{{- if and $.Tools $last }}
Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
{{ $.Tools }}
{{- end }}
{{ .Content }}
{{- if $last }}Assistant:{{ end }}
{{- else if eq .Role "assistant" }}
Assistant:
{{- if .ToolCalls }}
{{- range .ToolCalls }}
{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}
{{- end }}
{{- else }}
{{ .Content }}
{{- if not $last }}{{ end }}
{{- end }}
{{- else if eq .Role "tool" }}
{{ .Content }}
{{- if $last }}Assistant:{{ end }}
{{- end }}
{{- end }}
{{- else }}
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Prompt }}
User:
{{ .Prompt }}
{{- end }}
Assistant:
{{ .Response }}
{{- if .Response }}{{ end }}
{{- end }}