BAML
Type-safe prompt programming language & LLM function compiler
BAML is a domain-specific language that turns complex LLM prompts into strongly-typed functions with automatic client generation.
Kom hurtigt i gang
extract.baml
Kom i gang med BAML i dit projekt.
// Define structured types in BAML
class DanishCompany {
name string
cvr int
industry string
}
function ExtractCompany(text: string) -> DanishCompany {
client GPT4o
prompt #"
Extract the Danish company details:
{{ text }}
{{ ctx.output_format }}
"#
}Om BAML
BAML (Basically A Made-up Language) brings software engineering rigor to prompt engineering. Write typed schemas and prompts in `.baml` files, test them with live preview in VS Code, and compile them into zero-overhead, type-safe clients for Python, TypeScript, and Go.
DK
Danske data- og produkt-guides
Hvordan udviklere og agenter bruger BAML til at tilgå dansk digital infrastruktur.
Compile Type-Safe Danish Address & CPR Parsing Functions
Define strict BAML schemas for Danish municipal forms and generate TypeScript clients that parse messy user inputs with guaranteed types.
Nøglefunktioner
Compiles prompts into native TypeScript, Python, and Go SDKs
4x token savings over verbose JSON schema formats
Schema-Aligned Parsing (SAP) heals malformed LLM responses
Interactive VS Code playground with hot-reloading testing