# Prompt Optimizer

> Rewrite, test and compare prompts in a workbench that runs entirely on your side

- Category: App Orchestration / Prompt Programming
- Language: TypeScript
- Licence: AGPL-3.0-only
- Repository: https://github.com/linshenkx/prompt-optimizer
- Website: https://prompt.always200.com
- Canonical page: https://ai-tldr.dev/tools/prompt-optimizer/

## In short

Prompt Optimizer is an open-source workbench for improving prompts. It sits in the Prompt Programming category of the App Orchestration tools and is open-source, written in TypeScript and licensed AGPL-3.0-only. To get started: try the hosted version.

## Overview

Prompt Optimizer is an open-source workbench for improving prompts. You bring a prompt — written by hand, taken from a template, imported from a file, or pulled from the project's Prompt Garden — and the tool rewrites it, optionally over several rounds, then lets you run the original and the rewritten version so you can judge whether the change actually helped. It handles system prompts and user prompts as two distinct modes, because the two are optimized for different things.

The part that separates it from a one-shot 'improve my prompt' box is the evaluation loop. It supports single-result analysis, side-by-side compare evaluation of two results, and an evaluation-driven rewrite that feeds the judgement back into the next revision. An advanced testing mode adds context variables you can swap per run, multi-turn conversation testing, and function-calling support, so a prompt can be checked under conditions closer to how it will actually be used.

It runs as a pure client-side application: your prompts and API keys stay in the browser or desktop app and talk to the model provider directly, with no intermediate server of the project's own. That shape lets it ship in four forms — the hosted web app, an installable desktop app, a Chrome extension, and a self-hosted Docker image — plus an MCP server so MCP-compatible clients can call the optimizer as a tool. It works with OpenAI, Gemini, DeepSeek, Grok, Zhipu AI, SiliconFlow, MiniMax and other mainstream providers, and also covers text-to-image and image-to-image prompts.

## What it does

- One-click optimization with multi-round iterative refinement, in separate system-prompt and user-prompt modes
- Analysis, single-result evaluation and side-by-side compare evaluation, plus evaluation-driven smart rewrite
- Advanced testing mode with context variables, multi-turn conversation testing and function-calling support
- Image-prompt modes for text-to-image, image-to-image and multi-image generation with per-model parameters
- Smart favorites: save prompts as reusable assets with version history, examples, source binding, and full export/import
- Four deployment shapes (web, desktop, Chrome extension, Docker) plus an MCP server, with optional password protection for shared deployments

## Getting started

The fastest path is the hosted web app, which is pure frontend — everything stays in your browser. Self-hosting is a single Docker command. Bring your own model provider API key either way.

1. Try the hosted version

   Open prompt.always200.com. It is a pure frontend project, so prompts and keys are stored locally in the browser and are not uploaded to a server.

2. Self-host with Docker

   Run the published image. Add an access password if the deployment is reachable by anyone else.

```bash
docker run -d -p 8081:80 --restart unless-stopped \
  --name prompt-optimizer linshen/prompt-optimizer
```

3. Or run it with a key and password baked in

   Environment variables configure the model provider and gate access.

```bash
docker run -d -p 8081:80 \
  -e VITE_OPENAI_API_KEY=your_key \
  -e ACCESS_USERNAME=your_username \
  -e ACCESS_PASSWORD=your_password \
  --restart unless-stopped \
  --name prompt-optimizer \
  linshen/prompt-optimizer
```

4. Install the desktop app or extension

   Desktop builds are on GitHub Releases as installers (.exe, .dmg, .AppImage — these auto-update) or archives. The desktop app has no browser CORS limits, so it can talk to any provider API including a local Ollama. The Chrome extension is in the Chrome Web Store.

5. Deploy to Vercel or Cloudflare

   The repo ships one-click deploy buttons for both. Do not preconfigure API keys on a public frontend deployment: VITE_* values are exposed in the browser bundle. Use ACCESS_PASSWORD, or keep keys client-side.

## When to use it

- Reach for it when a prompt underperforms and you want a structured rewrite plus evidence that the rewrite is actually better
- Use it to build a reusable prompt library, with version history and worked examples attached to each saved prompt
- Good for testing a prompt against swapped context variables and multi-turn conversations before it goes into an app
- Useful for image prompts too, turning a one-line idea into a directable text-to-image or image-to-image prompt
