File size: 3,225 Bytes
231468b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# =============================================================================

# Project Norn: K-Mini 4B (4.02B Dense Q4_K_M)

# Osakra Research — Standard Ollama Modelfile (No Custom Binary Required)

# =============================================================================



FROM ./k-mini-Q4_K_M.gguf



# Runtime hyperparameters (4.8 GB VRAM footprint at 8192 context on 8GB GPUs)

PARAMETER num_ctx 8192

PARAMETER temperature 0.0

PARAMETER top_p 0.6

PARAMETER top_k 40

PARAMETER stop "<|im_end|>"

PARAMETER stop "<|endoftext|>"

PARAMETER stop "<|im_start|>"



# Calibrated System Prompt with Neurochemical State Conditioning (<|state:*|>)

SYSTEM """You are Norn K-Mini (4.02B), a local-first developer agent and analytical reasoning engine created by Osakra Research.

Protocol:

1. Begin every assistant turn with your conditioning state token: <|state:acetylcholine|> for coding, math, and tool execution, <|state:serotonin|> for analytical explanation, or <|state:dopamine|> for architectural design.

2. Solve each problem methodically step-by-step.

3. Only if a factual question contains an impossible historical or physical premise (e.g. asking who walked on Jupiter), explicitly refute the false premise with the invariant truth ('no one', 'never', 'never invented').

4. When tools are provided and needed, emit a valid <tool_call> JSON block without fabricating outputs."""



TEMPLATE """{{- if .Tools }}

{{- if .System }}<|im_start|>system

{{ .System }}

# Tools



You may call one or more functions to assist with the user query.



You are provided with function signatures within <tools></tools> XML tags:

<tools>

{{ range .Tools }}

{"type": "function", "function": {{ .Function }}}

{{ end }}

</tools>



For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:

<tool_call>

{"name": <function-name>, "arguments": <args-json-object>}

</tool_call><|im_end|>

{{- else }}<|im_start|>system

# Tools



You may call one or more functions to assist with the user query.



You are provided with function signatures within <tools></tools> XML tags:

<tools>

{{ range .Tools }}

{"type": "function", "function": {{ .Function }}}

{{ end }}

</tools>



For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:

<tool_call>

{"name": <function-name>, "arguments": <args-json-object>}

</tool_call><|im_end|>

{{- end }}

{{- else if .System }}<|im_start|>system

{{ .System }}<|im_end|>

{{- end }}

{{- range $i, $_ := .Messages }}

{{- $last := eq (len (slice $.Messages $i)) 1 }}

{{- if eq .Role "user" }}<|im_start|>user

{{ .Content }}<|im_end|>

{{- else if eq .Role "assistant" }}<|im_start|>assistant

{{- if .Content }}

{{ .Content }}

{{- end }}

{{- if .ToolCalls }}

{{- range .ToolCalls }}

<tool_call>

{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}

</tool_call>

{{- end }}

{{- end }}<|im_end|>

{{- else if eq .Role "tool" }}<|im_start|>user

<tool_response>

{{ .Content }}

</tool_response><|im_end|>

{{- end }}

{{- if and (ne .Role "assistant") $last }}

<|im_start|>assistant

{{- end }}

{{- end }}

"""