code-completion command - github.com/zerfoo/zerfoo/examples/code-completion - Go Packages
Command code-completion demonstrates using a language model for code completion.
It reads a code snippet (from a flag or stdin), appends a completion prompt, and generates the continuation. This pattern works with any code-capable GGUF model (e.g., CodeLlama, DeepSeek Coder, Qwen 2.5 Coder).
Usage:
go build -o code-completion ./examples/code-completion/
./code-completion --model path/to/model.gguf --code "func fibonacci(n int) int {"
echo "func add(a, b int) int {" | ./code-completion --model path/to/model.gguf