Prompt Optimizer — Analyze & Locally Rewrite LLM Prompts

Instant browser-only analysis: structure checks, redundancy findings, heuristic score, and token waste. Opt in to a local Qwen rewrite with honest on-device labeling — no API keys. Pair with the token counter, context window calculator, JSON to TOON, and text diff tools.

…
Privacy-first prompt analysis
Layer 1 heuristics run entirely in your browser. Layer 2 downloads a local Qwen model only after explicit consent — no cloud LLM API calls.

How analysis works

Layer 1 (default): rule-based structure checks, redundancy detection, a 0–100 heuristic score, and token waste using the same exact/estimate tiering as the token counter. Layer 2 (opt-in): after you confirm, WebLLM loads Qwen 1.5B in a Web Worker and rewrites your prompt using Layer 1 findings — labeled honestly as local-model quality.

Key features

  • Instant heuristic analysis without download
  • Token waste with honest exact/estimate badges
  • API-messages per-role findings cards
  • Opt-in local Qwen rewrite via WebLLM
  • Consent + real download progress
  • Rewrite pane with token delta — no auto-replace

Local AI rewrite

Requires WebGPU and a one-time model download (IndexedDB cache on repeat visits). The rewrite never auto-replaces your input — copy or apply manually. Not equivalent to GPT-4 or Claude.

Privacy

No server processing. No BYOK in v1. Prompt text is not sent to FastMinify or third-party inference APIs.

Limitations

The score is a checklist heuristic, not output-quality judgment. Redundancy detection catches exact/near-duplicate text, not paraphrased repetition. Local rewrite quality is bounded by the small on-device model. Maximum input is about 512 KiB of UTF-8 text.

Related LLM & text tools

Pair analysis with the LLM token counter, check fit with the context window calculator, compress tabular data via JSON to TOON, or compare rewrite versions in text diff.

Options that change the analysis or rewrite

Model
Sets exact vs estimate tier for token waste numbers and optional USD framing.
Input format
API messages mode runs role-specific structure checks and per-role cards. Raw text uses section heuristics.
Redundancy sensitivity
Low/medium/high adjusts Jaccard and n-gram thresholds — directly changes which duplicate findings surface.
Show token waste
Shows or hides the recoverable token waste block and per-suggestion token savings badges.
Include cost estimate
Shows or hides USD for wasted tokens using the maintained pricing table.
Rewrite model size
Local rewrite uses Qwen 1.5B (~840 MB download) before the first on-device generation.

FAQ

Analysis, rewrite, and privacy

Does this rewrite my prompt with AI?

Only if you explicitly opt in to Layer 2. Layer 1 never rewrites — it measures and suggests.

How accurate is the score?

It is checklist-based (six criteria, equal weighting), not a guarantee of model output quality. Non-English prompts may score differently.

Does it catch every redundancy?

No. v1 detects exact and near-duplicate text blocks, not paraphrased repetition.

What is the maximum input size?

About 512 KiB of UTF-8 text. Larger inputs show an error card and are not analyzed.

Is my prompt sent to OpenAI or Anthropic?

No. Analysis runs locally. The optional rewrite runs in a browser Web Worker after you confirm a model download.

What if WebGPU is unavailable?

Layer 1 remains fully usable. Layer 2 shows an honest message and does not download a model.

Will the rewrite replace my input?

Never automatically. You copy or apply the rewrite yourself.

Token counting, pricing estimates, and context-window fit — 100% browser-local.