Freeform Markup Language (FML) is a lightweight, expressive markup language designed to write prompts for large language models (LLMs) using structured XML-style tags and Mustache-style variables. It’s designed for developers who want readable, reusable, and modular prompts without the chaos of raw strings.
- 🧩 Mustache-style variable interpolation:
{{ name }} - 🔁
<include>tag for nesting other.fmlfiles - 🧪 Simple, testable, and transformable prompt formats
npm install @devgertschi/fml-sdkFML uses angle-bracketed XML-style tags:
| Tag | Purpose |
|---|---|
<include src="..."/> |
Imports other .fml files |
<system>
You are a helpful assistant.
</system>
<user>
Hello, what can you do?
</user>
<assistant>
I can help with a variety of tasks including answering questions and writing code.
</assistant>Use {{ variable_name }} syntax for dynamic substitution:
Tell me a story about {{ animal }} who learns to {{ skill }}.
Modularize prompts using <include>:
<include src="common/system-prompt.fml" />
Hello there!You can configure the parser to use BBCode-style tags (e.g., [include src="..." ]) instead of XML-style tags by passing the tagStyle option:
import { parseFML } from '@devgertschi/fml-sdk';
const message = await parseFML('bbcode-include.fml', undefined, { tagStyle: 'bbcode' });Example BBCode-style FML:
[include src="common/system-prompt.fml"]
Hello there!
import { parseFML } from 'fml-sdk'
const message = await parseFML('onboarding-prompt.fml', {
variables: { name: 'David' }
})- Extension:
.fml - UTF-8 encoding
Built with ❤️ by David Pichsenmeister to make prompting a bit more human.
Heard about in a talk @viennajs, tried, forked and probably improved by devgertschi.