frob/ kimi-k2.5-prism-reap:530b-a32b-q8_0

106 3 weeks ago

50% REAP expert-pruned version of moonshotai/Kimi-K2.5, built from the PRISM variant.

vision tools thinking
090321876089 · 1.6kB
{{- $lastNonToolAssistantIndex := -1 }}
{{- range $index, $_ := .Messages }}
{{- if and (eq .Role "assistant") (not .ToolCalls) }}{{ $lastNonToolAssistantIndex = $index }}{{ end }}
{{- end }}
{{- if .Tools -}}
<|im_system|>tool_declare<|im_middle|>
{{- .Tools | json -}}
<|im_end|>
{{- end -}}
<|im_system|>system<|im_middle|>
{{- if .System }}
{{- .System }}
{{- else -}}
You are Kimi, an AI assistant created by Moonshot AI.
{{- end -}}
<|im_end|>
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1}}
{{- $role_name := .Role }}{{/* {{- if .Name }}{{ $role_name = .Name }}{{ end }} */}}
{{- if eq .Role "user" }}<|im_user|>{{ $role_name }}<|im_middle|>
{{- .Content -}}
{{- end }}
{{- if eq .Role "assistant" }}<|im_assistant|>{{ $role_name }}<|im_middle|>
{{- if or (le $i $lastNonToolAssistantIndex) (and $.IsThinkSet (not $.Think)) -}}
<think></think>
{{- else -}}
<think>{{ .Thinking }}</think>
{{- end }}
{{- .Content }}
{{- if .ToolCalls -}}
<|tool_calls_section_begin|>
{{- range .ToolCalls -}}
<|tool_call_begin|>{{ .ID }}<|tool_call_argument_begin|>{{ .Function.Arguments }}<|tool_call_end|>
{{- end -}}
<|tool_calls_section_end|>
{{- end -}}
{{- end }}
{{- if eq .Role "tool" }}<|im_system|>{{ $role_name }}<|im_middle|>{{ `` -}}
## Return of {{ .ToolCallID }}
{{ .Content -}}
{{- end -}}
{{- if or (eq .Role "user") (eq .Role "tool") (and (not $last) (eq .Role "assistant")) -}}
<|im_end|>
{{- end }}
{{- if and (ne .Role "assistant") $last }}<|im_assistant|>assistant<|im_middle|><think>
{{- if and $.IsThinkSet (not $.Think) }}</think>{{ end }}
{{- end }}
{{- end -}}