Skip to content
p promptel. github ↗
/// features

One source, every provider.

promptel is a small, declarative framework for production LLM prompts. Author once in the DSL or YAML, pick the technique as a block, and run across OpenAI, Anthropic, or Groq from the same file. Grouped by what you're doing.

author

Two equivalent surfaces for writing a prompt, both parsing to the same AST.

.prompt DSL

A curly-brace DSL for prompts

Write prompts in a small declarative DSL with the .prompt extension, parsed by a Chevrotain grammar. Blocks — meta, context, params, body, constraints, output, hooks — are legible in a diff and reviewable line by line.

YAML

An equivalent YAML surface

The same prompt in plain YAML, parsed with js-yaml. Convert in either direction with FormatConverter (promptToYaml / yamlToPrompt) — the DSL is for humans reading review, the YAML is for schema validation and codegen.

type

Params are declared, typed, and bound before any token leaves your machine.

params

Typed params with defaults

Declare params with a type, optionality, and a default: code: string, language?: string = "javascript". The executor refuses to run a prompt whose params do not bind, catching a class of runtime failures at parse time.

constraints

Constraints as structure

maxTokens, temperature, topP, and stop live in a constraints block rather than being threaded through call sites. Output format and schema are declared in an output block.

techniques

Prompt techniques become nodes in the AST, not folklore pasted between repos.

six techniques

Chain-of-Thought, Few-Shot, and more

chainOfThought, fewShot, zeroShot, treeOfThoughts, reAct, and selfConsistency are first-class technique blocks inside body.technique. Reviewers can see which technique is in play without reading the whole string.

harmony

Harmony multi-channel responses

A harmony block declares reasoning effort and channels ("final", "analysis", "commentary"). Multi-channel responses are surfaced as structured fields on the result rather than parsed out of prose.

run

Provider-portable execution from a library API or the CLI.

providers

One prompt, three provider SDKs

A provider abstraction wires in OpenAI, Anthropic Claude, and Groq via their official SDKs. Select with executePrompt(src, params, { provider }); switch by changing a flag, not by rewriting templates. Keys come from PROMPTEL_API_KEY or the provider-native env var.

cli

Execute and convert from the terminal

The promptel CLI executes a prompt (-f file -p provider --params …) or converts between .prompt and YAML (--convert yaml). Pipe results into evals, feed CI, or spot-check a change without owning the runtime in your test harness.

See it run end to end

The quickstart writes and runs a prompt in a few commands; the architecture page shows how the DSL becomes a provider call.