Freeform Markup Language (FML) SDK for structured AI prompting using XML-style tags and variables.
npm install @devgertschi/fml-sdk- 🧩 Mustache-style variable interpolation: {{ name }}
- 🔁 tag for nesting other .fml files
- 🧪 Simple, testable, and transformable prompt formats
``bash`
npm install @devgertschi/fml-sdk
| Tag | Purpose |
| -- | -- |
| | Imports other .fml files |
`xml
You are a helpful assistant.
Hello, what can you do?
I can help with a variety of tasks including answering questions and writing code.
`
syntax for dynamic substitution:`
Tell me a story about {{ animal }} who learns to {{ skill }}.
`$3
Modularize prompts using :`xml
Hello there!
`$3
You can configure the parser to use BBCode-style tags (e.g., [include src="..." ]) instead of XML-style tags by passing the
tagStyle option:`ts
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!
`Example
`ts
import { parseFML } from 'fml-sdk'const message = await parseFML('onboarding-prompt.fml', {
variables: { name: 'David' }
})
`File Format
- Extension:
.fml`---
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.