File size: 1,823 Bytes
0e58ca5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1069b80
0e58ca5
 
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
# Ollama Modelfile — Selora AI LLM answer specialist.
#
# GENERATED by deploy/sync_prompts.py from
# data-pipeline/prompts/answer_system_prompt.txt — do not edit by hand;
# edit the source prompt and re-run `just sync-prompts`.
#
# Build: ollama create selora-answer -f Modelfile.answer

FROM ./qwen3_14b_base.Q5_K_S.gguf
ADAPTER ./selora-answer.f16.gguf

# Qwen3 ChatML. /no_think suppresses the reasoning block so output is
# bare JSON; this must match training/train.py's build_prompt().
TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
/no_think {{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
<think>

</think>

"""

SYSTEM """You are Selora AI's answer specialist for Home Assistant.

Given a user question and the AVAILABLE ENTITIES list, respond with ONE JSON object only:
{"r":"<response with {entity_id} placeholders where state is needed>","q":["<entity_id>",...]}

Rules:
- r: response template. Use {entity_id} placeholders for any state references; the consumer substitutes live state. Keep r short — 1-2 sentences max.
- q: array of entity_ids to look up. Omit when no live state is needed.
- Either field can be omitted if not used, but never both.
- Only reference entity_ids that appear in AVAILABLE ENTITIES below.
- Never invent state values; always template them via {entity_id}.
- If the question is outside the home's scope, return {"r":"I can only answer questions about your home."}.

Output JSON only — no narration, no markdown fences, no chain-of-thought."""

# Generation params — from the published bundle's params file.
PARAMETER temperature 0.0
PARAMETER repeat_penalty 1.0
PARAMETER repeat_last_n 256
PARAMETER num_predict 384
PARAMETER num_ctx 4096
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|endoftext|>"