CludeMem-e4b / gguf /Modelfile
sebs-clude's picture
CludeMem-E4B v3: adapter, GGUF Q8_0/Q4_K_M, Modelfile, prompts, card
817dc1b verified
Raw History Blame Contribute Delete
1.65 kB
# CludeMem-E4B for Ollama: the CludeMem adapter merged into google/gemma-4-e4b-it (text weights only).
#
# ollama create cludemem-e4b-v3 -f Modelfile
#
# FROM expects the GGUF next to this file. For the 8-bit build (preferred for RECONCILE), change it to
# ./cludemem-e4b-v3.Q8_0.gguf.
#
# The template renders the prompt the adapter was trained with, i.e. the Hugging Face tokenizer's
# apply_chat_template([system, user], add_generation_prompt=True, enable_thinking=True):
#
# <bos><|turn>system\n<|think|>\n{system}<turn|>\n<|turn>user\n{user}<turn|>\n<|turn>model\n
#
# <bos> is not written here: the GGUF sets tokenizer.ggml.add_bos_token=true, so the runtime prepends it.
# The <|think|> line is part of the training prompt; the model does not emit a thinking block, it replies
# with one JSON object. No SYSTEM is baked in: each operation sends its own instruction as the system message.
# The template covers the one-system, one-user shape every operation uses; send content without leading or
# trailing whitespace.
#
# Ollama 0.34: `ollama create` attaches its built-in gemma4 renderer and parser, and /api/chat renders with
# them. Leave "think" unset: the prompt is then token-identical to the training prompt, while "think": false
# drops the <|think|> line.
FROM ./cludemem-e4b-v3.Q4_K_M.gguf
TEMPLATE """<|turn>system
<|think|>
{{ .System }}<turn|>
{{- range .Messages }}{{- if ne .Role "system" }}
<|turn>{{ if eq .Role "assistant" }}model{{ else }}{{ .Role }}{{ end }}
{{ .Content }}<turn|>
{{- end }}{{- end }}
<|turn>model
"""
PARAMETER temperature 0
PARAMETER stop "<turn|>"
PARAMETER stop "<eos>"
PARAMETER num_ctx 8192