Prompt engineering
I write the output shape first, measure the prompt against each model's context window, and check replies against that shape.
Try it
The same model answers your task twice with identical settings: once with the bare task, once with an engineered prompt that sets a role, rules and a JSON contract. The engineered reply is validated, and gets one repair turn if it fails.
Public demo on Cloudflare Workers AI. Inputs are screened by Llama Guard 3 before any other model runs, requests are rate limited, and nothing here connects to a Luca or customer system.
How it works
- Write the output shapeI fix the required keys and allowed values before any wording, and the prompt states that shape word for word. The gateway has no provider schema mode, so the evaluation judge parses and checks its own reply. A reply with no JSON or a missing score raises an error, and the harness counts that item as a hard fail.
- Version the templatesReusable templates live in a versioned store with named double-brace placeholders. The render step lists the values that are still missing. Each edit raises the version number in the same database write as the change. The store does not keep earlier versions, so the number tracks edits and is not a rollback point.
- Compose per personaIn a layout editor I order the 13 prompt sources for each persona and switch each one on or off per channel. The editor lists 17 channels, but only system, chat and voice take effect at runtime. The rest are marked roadmap. The composer builds the prompt in process from stored data and makes no model call of its own.
- Budget the contextThe estimator reports characters and estimated tokens for each section, at about four characters per token. It checks the total against every model in the catalog and flags high usage. Persona document retrieval adds a capped number of passages. On Anthropic models the gateway marks the system prompt for prompt caching by default.
Tools
| Tool | What it does here | Status |
|---|---|---|
| Prompt composer and estimatorAvailable | Orders 13 prompt sources per persona and switches them per channel. Reports estimated tokens per section and checks the total against every model in the catalog. | Available |
| Prompt simulatorEarly access | Sends the composed prompt to several models or channels and sets the results side by side. Its model call does not return replies in production yet. | Early access |
| Versioned prompt templatesEarly access | Holds templates with named placeholders, lists missing values when rendering, and bumps the version on every update. Earlier versions are not kept. | Early access |
| LLM-judge evaluation harnessAvailable | Run by hand. A judge model scores French answers over a versioned dataset on four named dimensions, with hard-fail flags and a pass or fail exit code. | Available |
| Public prompting demoDemo only | Runs the comparison on this page on Cloudflare Workers AI, with Llama Guard 3 input screening, one model at fixed settings, a schema check and one repair turn. | Demo only |
Available means shipped and in use. Early access means built but not generally available. Roadmap means designed, not built. Demo only means it powers the public demo, not customer deployments.
The write-up has every step of how I deliver this at a customer, with the tools and their status.
Read the write-up on gusit.deThe other answers
Built by Gus Assuncao of Gus IT LLC for a Forward Deployed Engineer application. Luca is the AI platform Gus IT builds and operates. Contact gus@gusit.de. Claude is a product of Anthropic PBC. Cloudflare and Workers AI are trademarks of Cloudflare, Inc. Llama is a trademark of Meta Platforms, Inc. Other names are trademarks of their respective owners. Gus IT LLC is an independent engineering firm and is not affiliated with or endorsed by these companies.