TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/itsubaki/gpt/llms.txt
Use this file to discover all available pages before exploring further.
cmd/chat command wraps the SFT (supervised fine-tuning) trained model with the Alpaca instruction format. Before running generation it automatically prepends ### Instruction:\n{prompt}\n\n### Response:\n to the user’s input, framing it as an instruction the model was trained to follow. The model then generates the response portion autoregressively until the end token is produced.
CLI usage
Thecmd/chat command shares the same generation flags as cmd/generate but loads the SFT model by default via -sft-model-path.
| Flag | Default | Description |
|---|---|---|
-merge-rules-path | testdata/merge_rules.gob | Path to the BPE merge rules file |
-sft-model-path | testdata/model_gpt_sft.gob | Path to the SFT fine-tuned model file |
-prompt | Write loop | Instruction to send to the model |
-temperature | 1.0 | Sampling temperature |
-max-new-tokens | 256 | Maximum number of new tokens to generate |
-count | 1 | Number of generation runs to perform |
Example outputs
Writing a Python function —--prompt 'Write is_prime function':
--prompt 'Hi, who are you?':
--prompt '3+9':
Alpaca format
The chat command usesdataloader.AlpacaFormat() to wrap the user prompt before passing it to GenerateChan. This matches the format used during SFT training, so the model knows where the instruction ends and where to begin generating its response.
cmd/chat/main.go, the wrapped prompt is passed directly to generation:
### Response: marker, so the decoded output includes the full Alpaca-formatted exchange.
Library usage
Usedataloader.AlpacaFormat together with model.GenerateText or model.GenerateChan to chat with the SFT model from your own Go program:
### Instruction: and ### Response: headers, followed by the generated Python code.
The
chat command loads testdata/model_gpt_sft.gob — the supervised fine-tuned model. Use the generate command with testdata/model_gpt.gob if you want to run the base pre-trained model without instruction formatting.