Chapter 60

stub/templates

github.com/openfluke/welvet/stub/templates🚧


Why it exists

Chat prompts must match model families (ChatML, Llama3, BitNet) without app-specific string glue.

What it is

Template.BuildPrompt; presets ChatML, Llama3, BitNetInstruction, MicrosoftBitNetChat.

Go example

examples/60-stub-templates/main.go

Run:cd welvet/examples/60-stub-templates && source ../env.sh && go run .
package main

import (
	"fmt"

	"github.com/openfluke/welvet/stub/templates"
)

func main() {
	p := templates.ChatML.BuildPrompt(nil, "You are helpful.", "Say hi")
	fmt.Println(p)
}

Output

Run python3 _gen_welvet_book.py --run to capture output.