Prompt Optimizer: Write Better AI Prompts in Seconds

7月21日 Published inPrompt Engineering Tools

Prompt Optimizer refines your instructions to ensure AI models grasp your intent precisely. It is available as a web app, desktop application, Chrome extension, or Docker container—choose the setup that best fits your workflow.

The tool transforms vague prompts into clear, structured directions. Whether you are building a role-play persona, extracting entities for a knowledge graph, or composing poetry, it provides the necessary clarity. For role-play, a tightened prompt helps smaller models maintain character consistency. For knowledge graphs, it ensures smaller models produce clean, predictable JSON. For creative writing, it converts a loose idea into a concrete creative brief.

Core Features

  1. Iterative Refinement. Click "Optimize" to let the tool rework your prompt until the AI's output improves. You can run multiple passes for deeper refinement.
  2. System and User Prompts. The tool handles both instruction levels. Tweak the model’s underlying system behavior or sharpen a single user query.
  3. Side-by-Side Testing. Compare the original and optimized prompts in a split-screen view. Run both versions simultaneously to evaluate the results directly.
  4. Broad Model Compatibility. Works with OpenAI, Gemini, DeepSeek, Zhipu AI, SiliconFlow, and other major providers.
  5. Privacy-First Architecture. Data is processed client-side. Your prompts and API keys travel directly from your device to the AI provider; no intermediate server intercepts your information.
  6. Cross-Platform Availability. Use the hosted web app, install the desktop version, add the Chrome extension, or deploy via Docker.
  7. Access Security. If you choose to self-host, you can set a password to keep your deployment private.

How to Use It

Hosted Web App (Recommended)

Visit prompt.always200.com. The site runs entirely in your browser. All prompts and settings stay on your local machine and are never uploaded to a remote server.

Deploying on Vercel

  • Option 1: One-Click. Deploy directly to Vercel for a fast setup. Note that you must manually pull future updates.
  • Option 2: Fork and Import.
    1. Fork the repository on GitHub.
    2. Import your fork into Vercel.
    3. Configure environment variables, such as ACCESS_PASSWORD for security and VITE_OPENAI_API_KEY for your model keys.

The fork method allows you to sync upstream changes and keep your deployment up to date.

Desktop Application

Download the installer or portable ZIP from the GitHub Releases page. The installer version supports automatic updates, while the portable version does not. The desktop app bypasses CORS restrictions entirely, allowing you to call any API endpoint directly without browser-imposed limitations.

Chrome Extension

Install the optimizer from the Chrome Web Store. Once installed, click the icon to launch the tool. Note that the Web Store version may occasionally lag behind the latest GitHub release.

Docker

For a basic setup:

docker run -d -p 80:80 --restart unless-stopped --name prompt-optimizer linshen/prompt-optimizer

To include API keys and a password at launch:

docker run -d -p 80: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

Users in China can use the Alibaba Cloud registry instead: registry.cn-guangzhou.aliyuncs.com/prompt-optimizer/prompt-optimizer.

Docker Compose

git clone https://github.com/linshenkx/prompt-optimizer.git
cd prompt-optimizer

# Create .env file (optional)
cat > .env << EOF
VITE_OPENAI_API_KEY=your_openai_api_key
VITE_GEMINI_API_KEY=your_gemini_api_key
VITE_DEEPSEEK_API_KEY=your_deepseek_api_key
VITE_ZHIPU_API_KEY=your_zhipu_api_key
VITE_SILICONFLOW_API_KEY=your_siliconflow_api_key
ACCESS_USERNAME=your_username
ACCESS_PASSWORD=your_password
EOF

docker compose up -d
docker compose logs -f

Configuring API Keys

  • UI Method (Preferred): Click the gear icon (⚙️) in the top right and navigate to "Model Management." Select your model and enter the key. You can also set advanced parameters via the llmParams field. For example: {"temperature": 0.7, "max_tokens": 4096, "timeout": 60000}.
  • Environment Variables: Use the -e flags during Docker deployment as shown in the examples above.

Local Development

git clone https://github.com/linshenkx/prompt-optimizer.git
cd prompt-optimizer
pnpm install

# Run the full environment (builds core/ui and serves the web app)
pnpm dev

# Serve the web app only
pnpm dev:web

# Perform a clean reset and restart
pnpm dev:fresh

Troubleshooting

  • CORS Errors: Browsers block direct calls to APIs that lack proper CORS headers. This is the most common reason a model fails even with a valid key.
  • Local Ollama Setup: Set OLLAMA_ORIGINS=* to allow requests from any origin. If issues persist, set OLLAMA_HOST=0.0.0.0:11434 to ensure it listens on all interfaces.
  • Commercial API CORS: If using the hosted app or a Vercel deployment, enable "Use Vercel Proxy" in the model settings. Alternatively, use a self-hosted proxy like OneAPI and point the optimizer to your custom endpoint.
  • Vercel Proxy Issues: Some providers block Vercel IP ranges to prevent proxy abuse. If your requests are blocked, switch to a self-hosted proxy.
  • Mixed Content (HTTPS vs. HTTP): The hosted web app uses HTTPS. Browsers will block requests from secure pages to insecure http:// addresses (common for local models). To resolve this, use the desktop app, Chrome extension, or Docker version, as these environments do not enforce the same mixed-content restrictions.