prompt-optimizer README

The project's README from github.com/linshenkx/prompt-optimizer. As one markdown file: README.md.

Prompt Optimizer 🚀

English | 中文

GitHub stars Chrome Web Store Users

linshenkx%2Fprompt-optimizer | Trendshift

License Docker Pulls GitHub forks Deploy with Vercel

Website | Online Optimizer | Prompt Garden | Docs | Quick Start | Chrome Extension | 💖 Support

Development Docs | Vercel Deployment Guide | Cloudflare Deployment Guide | MCP Deployment Guide | DeepWiki Docs | ZRead Docs

📖 Project Introduction

Prompt Optimizer is a powerful AI prompt optimization tool that helps you write better AI prompts and improve the quality of AI outputs. It supports four usage methods: web application, desktop application, Chrome extension, and Docker deployment.

Prompts can start from manual writing, templates, local imports, or sources such as Prompt Garden. Prompt Optimizer is where those prompts are optimized, tested, evaluated, and saved as reusable prompt assets.

🎥 Feature Demonstration

1. Hard-Nosed Reviewer: Turn Agreement into Useful Critique

Starting from a minimal English role prompt, optimization pushes a small model away from generic pushback and toward a clearer, more structured review that surfaces weak assumptions, evidence gaps, and concrete revision advice.

Hard-nosed reviewer full-page demo

2. Marketplace Bargaining Reply: Let Variables Change the Strategy

With a single reusable prompt template, you can swap in item details, price anchors, buyer offers, tone, and negotiation goals for different marketplace conversations. After optimization, the same small model does a better job turning those variables into a clearer, more transaction-ready reply instead of a generic helper-style response.

Marketplace bargaining reply variable-mode demo

3. Text-to-Image: Optimize a One-Line Idea into a More Directable Key Visual Prompt

This is not just prompt expansion. Starting from a vague one-line idea, Prompt Optimizer adds clearer subject cues, spatial relationships, and mood anchors. The left side is simply “a floating library in the night sky,” while the optimized version gives the model a more directed fantasy composition that feels closer to a reusable key visual than a lucky generic image.

Floating library text-to-image demo

✨ Core Features

🚀 Advanced Features

Image Generation Mode

Prompt Sources & Smart Favorites

Advanced Testing Mode

For detailed usage instructions, please refer to the Image Mode Documentation

Quick Start

Direct access: https://prompt.always200.com

This is a pure frontend project with all data stored locally in your browser and never uploaded to any server, making the online version both safe and reliable to use.

2. Web Deployment

Vercel Deployment

Method 1: One-click deployment to your own Vercel: Deploy with Vercel

Method 2: Fork the project and import to Vercel (Recommended):

For more detailed deployment steps and important notes, please check:

Cloudflare Deployment

Deploy to Cloudflare

Use the Deploy to Cloudflare button for the quickest public-repository setup. It creates a repository under your GitHub/GitLab account and deploys with Workers Builds. For private repositories or stricter repository-access control, import your own repository manually; keep the default deploy commands and clear the build command if Cloudflare auto-fills pnpm run build, because wrangler.jsonc builds the Web frontend and publishes packages/web/dist as static assets.

For access control and analytics on Cloudflare, configure Cloudflare Access and Cloudflare Web Analytics in the Cloudflare dashboard. No frontend dependency or application-code change is required.

3. Download Desktop Application

Download the latest version from GitHub Releases. We provide both installer and archive formats for each platform.

Core Advantages of Desktop Application:

4. Install Chrome Extension

  1. Install from Chrome Web Store (may not be the latest version due to approval delays): Chrome Web Store
  2. Click the icon to open the Prompt Optimizer

5. Docker Deployment

Click to view Docker deployment commands ```bash # Run container (default configuration) docker run -d -p 8081:80 --restart unless-stopped --name prompt-optimizer linshen/prompt-optimizer

Run container (with API key configuration and password protection)

docker run -d -p 8081:80
-e VITE_OPENAI_API_KEY=your_key
-e ACCESS_USERNAME=your_username \ # Optional, defaults to "admin" -e ACCESS_PASSWORD=your_password \ # Set access password --restart unless-stopped
--name prompt-optimizer
linshen/prompt-optimizer

</details>

### 6. Docker Compose Deployment
<details>
<summary>Click to view Docker Compose deployment steps</summary>
```bash
# 1. Clone the repository
git clone https://github.com/linshenkx/prompt-optimizer.git
cd prompt-optimizer

# 2. Create .env file for API keys and authentication
cat > .env << EOF
# API Key Configuration
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_GROK_API_KEY=your_xai_api_key
VITE_ZHIPU_API_KEY=your_zhipu_api_key
VITE_SILICONFLOW_API_KEY=your_siliconflow_api_key

# Basic Authentication (Password Protection)
ACCESS_USERNAME=your_username  # Optional, defaults to "admin"
ACCESS_PASSWORD=your_password  # Set access password
EOF

# Because the compose file is under docker/, pass the root .env explicitly.

# 3. Start the service
docker compose --env-file .env -f docker/docker-compose.yml up -d

# 4. View logs
docker compose --env-file .env -f docker/docker-compose.yml logs -f

# 5. Access the service
Web Interface: http://localhost:8081
MCP Server: http://localhost:8081/mcp

You can also directly edit the docker/docker-compose.yml file to customize your configuration:

Click to view docker/docker-compose.yml example
services:
  prompt-optimizer:
    # Use Docker Hub image
    image: linshen/prompt-optimizer:latest
    container_name: prompt-optimizer
    restart: unless-stopped
    ports:
      - "8081:80"  # Web application port (MCP server accessible via /mcp path)
    environment:
      - VITE_OPENAI_API_KEY=your_openai_key
      - VITE_GEMINI_API_KEY=your_gemini_key
      - VITE_GROK_API_KEY=your_xai_key
      # Access Control (Optional)
      - ACCESS_USERNAME=admin
      - ACCESS_PASSWORD=your_password

7. MCP Server Usage Instructions

Click to view MCP Server usage instructions

Prompt Optimizer now supports the Model Context Protocol (MCP), enabling integration with AI applications that support MCP such as Claude Desktop.

When running via Docker, the MCP Server automatically starts and can be accessed via http://ip:port/mcp.

Environment Variable Configuration

MCP Server requires API key configuration to function properly. Main MCP-specific configurations:

# MCP Server Configuration
MCP_DEFAULT_MODEL_PROVIDER=openai  # Options: openai, gemini, anthropic, deepseek, grok, siliconflow, zhipu, dashscope, openrouter, modelscope, custom
MCP_LOG_LEVEL=info                 # Log level

Using MCP in Docker Environment

In a Docker environment, the MCP Server runs alongside the web application. You can access the MCP service through the same port as the web application at the /mcp path.

For example, if you map the container's port 80 to port 8081 on the host:

docker run -d -p 8081:80 \
  -e VITE_OPENAI_API_KEY=your-openai-key \
  -e MCP_DEFAULT_MODEL_PROVIDER=openai \
  --name prompt-optimizer \
  linshen/prompt-optimizer

The MCP Server will then be accessible at http://localhost:8081/mcp.

Claude Desktop Integration Example

To use Prompt Optimizer in Claude Desktop, you need to add the service configuration to Claude Desktop's configuration file.

  1. Find Claude Desktop's configuration directory:

    • Windows: %APPDATA%\Claude\services
    • macOS: ~/Library/Application Support/Claude/services
    • Linux: ~/.config/Claude/services
  2. Edit or create the services.json file, adding the following content:

{
  "services": [
    {
      "name": "Prompt Optimizer",
      "url": "http://localhost:8081/mcp"
    }
  ]
}

Make sure to replace localhost:8081 with the actual address and port where you've deployed Prompt Optimizer.

Available Tools

  • optimize-user-prompt: Optimize user prompts to improve LLM performance
  • optimize-system-prompt: Optimize system prompts to improve LLM performance
  • iterate-prompt: Iteratively improve mature prompts based on specific requirements

For more detailed information, please refer to the MCP Server User Guide.

⚙️ API Key Configuration

Click to view API key configuration methods
  1. Click the "⚙️Settings" button in the upper right corner
  2. Select the "Model Management" tab
  3. Click on the model you need to configure (such as OpenAI, Gemini, DeepSeek, Grok, etc.)
  4. Enter the corresponding API key in the configuration box
  5. Click "Save"

Supported models: OpenAI, Gemini, DeepSeek, Grok, Zhipu AI, SiliconFlow, Custom API (OpenAI compatible interface)

In addition to API keys, you can configure advanced LLM parameters for each model individually. These parameters are configured through a field called llmParams, which allows you to specify any parameters supported by the LLM SDK in key-value pairs for fine-grained control over model behavior.

Advanced LLM Parameter Configuration Examples:

  • OpenAI/Compatible APIs: {"temperature": 0.7, "max_tokens": 4096, "timeout": 60000}
  • Gemini: {"temperature": 0.8, "maxOutputTokens": 2048, "topP": 0.95}
  • DeepSeek: {"temperature": 0.5, "top_p": 0.9, "frequency_penalty": 0.1}

For more detailed information about llmParams configuration, please refer to the LLM Parameters Configuration Guide.

Method 2: Via Environment Variables

Configure environment variables through the -e parameter when deploying with Docker:

-e VITE_OPENAI_API_KEY=your_key
-e VITE_GEMINI_API_KEY=your_key
-e VITE_DEEPSEEK_API_KEY=your_key
-e VITE_GROK_API_KEY=your_key
-e VITE_ZHIPU_API_KEY=your_key
-e VITE_SILICONFLOW_API_KEY=your_key

# Multiple Custom Models Configuration (Unlimited Quantity)
-e VITE_CUSTOM_API_KEY_ollama=dummy_key
-e VITE_CUSTOM_API_BASE_URL_ollama=http://localhost:11434/v1
-e VITE_CUSTOM_API_MODEL_ollama=qwen2.5:7b

📖 Detailed Configuration Guide: See Multiple Custom Models Documentation for complete configuration methods and advanced usage

Local Development

For detailed documentation, see Development Documentation

Click to view local development commands
# 1. Clone the project
git clone https://github.com/linshenkx/prompt-optimizer.git
cd prompt-optimizer

# 2. Install dependencies
pnpm install

# 3. Start development server
pnpm dev               # Main development command: build core/ui and run web app
pnpm dev:web          # Run web app only
pnpm dev:fresh        # Complete reset and restart development environment

🗺️ Roadmap

For detailed project status, see Project Status Document

prompt-optimizer (linshenkx/prompt-optimizer)

Searching Database…

这是什么?Prompt Optimizer 是一款 AI 工具,帮你写出更好的提示词,从 AI 模型获得更好的结果。提供网页应用、桌面应用、Chrome 扩展和 Docker 部署等形式。
这是网页应用、桌面应用,还是浏览器扩展?以上都是,另外还有 Docker 选项。同一个优化器提供网页应用、原生桌面应用、Chrome 扩展,以及可自行托管的 Docker 容器。
我该怎么开始使用?最简单的方法是使用在线托管版本,它是纯前端应用,无需安装。如果要自行部署,可以一键部署到 Vercel 或 Cloudflare,从 GitHub Releases 下载桌面安装包,安装 Chrome 扩展,或通过 Docker / Docker Compose 运行。
我需要自己的 AI 服务商 API 密钥吗?需要。你可以在设置面板中为 OpenAI、Gemini、DeepSeek、Grok、Zhipu AI、SiliconFlow、MiniMax 等受支持的服务商配置 API 密钥,或者在运行 Docker 镜像时通过环境变量进行配置。
网页版有没有桌面应用没有的限制?有。基于浏览器的网页应用和扩展受 CORS 限制,因此连接本地 Ollama 实例或一些严格的商业 API 可能会失败;桌面应用则完全没有这一限制。
我能在 Windows、Mac 和 Linux 上使用桌面应用吗?可以。GitHub Releases 为各平台提供安装包和压缩包,例如 Windows 的 .exe、macOS 的 .dmg 和 Linux 的 .AppImage。
我的提示词和 API 密钥数据会去哪里?所有处理都在你的浏览器或本地应用中完成,并直接与 AI 服务商的 API 通信,没有任何中间服务器能看到你的提示词或密钥。
Prompt Garden 是什么?Prompt Garden 是可以导入的提示词来源之一,另外还有手动编写、模板和本地文件。它用来提供初始提示词,Prompt Optimizer 再对其进行优化,并允许你将其保存为可重复使用的收藏。
我能在 Claude Desktop 里使用它吗?可以。它实现了模型上下文协议(MCP),并提供 optimize-user-prompt、optimize-system-prompt、iterate-prompt 等工具,Claude Desktop 或任何兼容 MCP 的应用都可以直接调用。
它能生成或编辑图片,而不只是文本提示词吗?能。除了优化文本提示词,它还支持文生图、图生图和多图生成,可使用 Gemini、Seedream、Grok 等模型,包括基于参考图片的风格迁移。
我把提示词标记为收藏后会怎样?智能收藏会把它们保存为可重复使用的资产,包含版本历史、可复现的示例、媒体支持和来源绑定,方便你在以后的工作中重新应用。
Creator
linshenkx
Size
45.5 MB
Stars
38.4K
Age
1y
Commits · 90 Days