dslai
make any llm speak your dsl
dslai makes an LLM reliably produce your custom DSL. You give it your language's grammar — the same EBNF/GBNF-style rules you'd write for a parser — and dslai compiles it into a decoding constraint, so generated output is syntactically valid by construction rather than valid if you're lucky. The same grammar drops straight into a hosted open model in production.
It pairs that with a deterministic validator: a real generated parser that returns valid or invalid plus the exact position and what it expected, like a compiler error instead of a confidence score. Fine-tuning is an optional upsell for hard semantic cases, not the foundation — so there's nothing to train and no GPU to babysit to try it.
how it works
- 01
bring your grammar
Paste your DSL's grammar — no training set required.
- 02
constrain the model
dslai compiles it into a decoding mask, so output stays inside your language.
- 03
generate & validate
Generate snippets that always parse, and validate input with a real parser.
a look inside
a few of the screens you'll actually use.
- grammar-constrained output
- deterministic validation
- free · no account
a real generated parser returns valid/invalid plus the exact position — a compiler error, not a confidence score.
one grammar, playground to production
the guarantee follows your grammar from the browser to a hosted open model.
dslai guides
Ways to use dslai, and how it compares.
- comparisonConstrained decoding vs fine-tuning: the right way to get valid DSL out of an LLMFine-tuning teaches a model your DSL and hopes it sticks. Constrained decoding makes invalid output impossible. Here's why constraining the grammar beats fine-tuning on cost, speed, and correctness — and where fine-tuning still helps.
- how toHow to make an LLM output valid DSL every time (without fine-tuning)Getting an LLM to reliably emit your custom DSL is a grammar problem, not a prompting problem. Here's the practical recipe: turn your grammar into a decoding constraint and a deterministic validator with dslai.
- use caseValidate your DSL in CI: reject malformed config in a pull requestMalformed DSL shouldn't reach production. dslai generates a deterministic validator from your grammar so you can fail a pull request on invalid DSL with a precise, reproducible error — not an LLM's guess.
- use caseFine-tuning an LLM on your DSL: when it's worth it, and when it isn'tFine-tuning is the first thing people reach for to get an LLM writing their DSL — and usually the wrong first move. Here's when fine-tuning genuinely helps, and the cheaper wedge to try before it.
- use caseStructured LLM output for your own language — guaranteed, not hoped forJSON mode and schemas cover common formats. For your own DSL or config language, dslai constrains generation to your grammar so structured output is valid by construction — and validates it deterministically.