Skip to content

Latest commit

 

History

History
120 lines (92 loc) · 4.02 KB

01-templates.org

File metadata and controls

120 lines (92 loc) · 4.02 KB

LLM Template Examples

Template Setup

Note: These blocks are marked with :llm nil as they are one-time setup operations.

Python Function Template

llm --system "Write a clean, well-documented Python function that follows PEP 8 style guide. Include type hints, docstring with parameters and return value, and example usage in comments." --extract --save python-function

JavaScript Function Template

llm --system "Write a modern JavaScript function using ES6+ features. Include JSDoc documentation with parameters, return type, and example usage." --extract --save js-function

Rust Function Template

llm --system "Write a safe Rust function with proper error handling. Include documentation comments, type annotations, and example usage." --extract --save rust-function

Go Function Template

llm --system "Write an idiomatic Go function following Go style conventions. Include documentation comments and example usage." --extract --save go-function

Clojure Function Template

llm --system "Write a pure Clojure function following functional programming principles. Include docstring with specs, parameters, return value, and example usage." --extract --save clojure-function

Scheme Function Template

llm --system "Write a Scheme function following R6RS conventions. Include documentation with parameters, return value, and example usage." --extract --save scheme-function

Elisp Function Template

llm --system "Write an Emacs Lisp function following elisp conventions. Include docstring with interactive form if needed, parameters, return value, and example usage." --extract --save elisp-function

Template Usage Examples

Python Examples

llm -m llama3.2 -t python-function "implement binary search" -x

Rust Examples

llm -m llama3.2 -t rust-function "implement quicksort" -x

Go Examples

llm -m llama3.2 -t go-function "implement http server" -x

Clojure Examples

llm -m llama3.2 -t clojure-function "dfs [graph start]" -x

Scheme Examples

llm -m llama3.2 -t scheme-function "implement (append (l1 l2))" -x

Elisp Examples

llm -m llama3.2 -t elisp-function "wrap the llm eco tools from curl+ strip-tags or files-to-prompt, ttok, and llm in a library" -x

Advanced Usage

Custom Context Example

llm -m llama3.2 -t python-function --system "optimize for memory usage" "implement matrix multiplication" -x

Template Modification

Note: Template modifications are setup operations, marked with :llm nil

llm --system "Write a Python function optimized for numerical computations using NumPy" --extract --save python-numpy