.hu File Syntax¶
.hu (human) files are plain-text prompt templates. They contain no Python -- just the text you want to send to an LLM, with optional parameter placeholders and file-context references.
Each .hu file is automatically a callable function whose name matches the filename. You call .hu functions from .lm files -- .lm files are the orchestration layer that ties everything together.
Quick example¶
summarize.hu
Summarize the following article: {@article.txt}
Focus on {aspect} and keep it under {max_words} words.
pipeline.lm
Run with:
Parameter placeholders¶
Use {name} to define parameters. They are auto-detected -- no declaration needed.
When called, all parameters must be passed as keyword arguments:
Missing parameters raise an error:
To include a literal brace in the text, double it:
File context references¶
Use {@filename} to inject the contents of a local file into the prompt. This uses the same file-context resolution as .lm files -- fuzzy matching, absolute paths, and with files() scoping all work.
See the File Context documentation for details on search strategies and error handling.
Return types¶
.hu files are return-type agnostic. The return type is specified by the caller in the .lm file using the -> syntax:
# Returns validated HTML
page = generate_landing_page(product="Lamia") -> HTML
# Returns a Pydantic model extracted from HTML
quote = get_stock_data(ticker="AAPL") -> HTML[StockQuote]
# Writes output to a file
generate_docs(project="lamia") -> File(Markdown, "docs.md")
If called without a return type, the raw LLM response text is returned.
Calling conventions¶
.hufunctions are called from.lmfiles like regular functions- All parameters must be keyword arguments
.hufiles cannot call other.hufiles -- use.lmfiles as the glue- Filename (without
.huextension) must be unique across the project
Standalone execution¶
You can run a .hu file directly from the CLI:
This sends the prompt (with no parameters) to the default model and prints the response. Parameterized .hu files require a .lm wrapper to pass arguments.
Comparison with .lm files¶
| Feature | .hu files |
.lm files |
|---|---|---|
| Content | Plain text prompt | Python + Lamia syntax |
| Parameters | {name} placeholders |
Python function arguments |
| Return type | Set by caller | Declared with -> Type |
| Python code | Not supported | Full Python support |
| Imports | Not needed | Implicit Lamia imports |
Can call .hu |
No | Yes |
Can call .lm |
No | Yes |
| Filename = function | Yes | No (uses def names) |