AI Leader · Solution Architect · TPM

Skip to main content

Prompt engineering

LLM Prompt & Cost Optimization Simulator

Paste a sample prompt or workflow. Get rule-based optimization suggestions, a clearer rewrite, and before/after token and cost estimates — no API key required.

Paste a prompt → run analysis → compare before/after tokens and monthly cost. All rules run in your browser.

  • Client-side only — prompts never leave your browser for analysis
  • Transparent heuristics (role, structure, constraints, examples)
  • Educational pricing bands for frontier / mid / local routing
Your prompt

Paste a real prompt or workflow instruction. Sample loads by default so you can click Analyze immediately.

How the model works

  1. Tokens ≈ characters ÷ 4 (English heuristic).
  2. Pattern checks score role, task clarity, constraints, format, examples, filler, reasoning cue, and success criteria.
  3. Rewrite builds a structured prompt from the original intent plus missing sections.
  4. Retry factor — weak prompts assume more regenerations (default ~2.4×); strong prompts ~1.15×.
  5. Cost = (input + output tokens) × band price × retry factor × runs/month.
  6. Optimized output length assumes ~20% less rambling when format + constraints exist.

Pricing bands ship in config/tools_data/prompt_cost.php — update there when your FinOps table changes.

Unlock printable summary

Work email unlocks Print / Save as PDF — findings, score, and cost delta for your platform team.

FAQ

How does the Prompt Cost Simulator work?

You paste a prompt. The browser runs rule-based checks (role, task clarity, constraints, format, examples, filler, success criteria). It builds a structured rewrite and estimates tokens with a characters÷4 heuristic, then applies educational pricing bands and a retry multiplier for before vs after monthly cost.

Does this call an LLM API?

No. Analysis and rewrite patterns run entirely in your browser. Nothing is sent to a model vendor for this tool.

Are token and dollar figures exact?

No. Token counts are educational estimates. Prices are illustrative bands for frontier, mid-tier, and local routing — not live vendor quotes. Use them for relative before/after impact, then validate with your gateway bills.

Why might the optimized prompt be longer?

Structure (role, format, constraints) can add input tokens while cutting retries and messy long outputs. The cost model includes a quality/retry factor so net monthly spend can still fall.

Can I share the results?

Yes. Copy the optimized prompt, screenshot the metrics, or unlock a printable summary with a work email. Book an architecture review if you want prompt standards wired into a production gateway.