prompt-optimizer

linshenkx活跃维护

帮你把随手写的提示词改写成结构清晰、效果更好的版本,还能对比测试不同提示词的效果,适合经常和 LLM 打交道的人。

An AI prompt optimizer for writing better prompts and getting better AI results.

v2.15.2发布于 2026-11-09 12:56 UTC41,071star +274 / 7 天4,617fork同步于 2026-11-10 11:19 UTC

怎么上手

由 README 提炼,执行前请确认
docker run -d -p 8081:80 --restart unless-stopped --name prompt-optimizer linshen/prompt-optimizer
硬件要求按 README 说明

README 未说明本地硬件要求;桌面版可直连本地部署的 Ollama,也可使用在线版或 Docker 部署,无需自备 GPU。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一个帮你把提示词写得更清楚、让 AI 输出更稳定的多端提示词优化工具

帮你把随手写的提示词改写成结构清晰、效果更好的版本,还能对比测试不同提示词的效果,适合经常和 LLM 打交道的人。

核心能力

  • 一键优化提示词并支持多轮迭代改进
  • 区分系统提示词与用户提示词双模式优化
  • 提供分析、单结果评估与多结果对比评估
  • 集成 OpenAI、Gemini、DeepSeek 等多家模型
  • 支持文生图、图生图与多图生成

容易踩的坑

首次使用需先在模型管理里配置一个可用的文本模型才能优化;公开前端部署不要预置 VITE_* API Key,这些值会暴露在浏览器资源中;Docker 默认映射 8081 端口,需按需修改。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.15.2
  1. v2.15.2最新正式版2026-11-09 · 2026-11-09 12:56 UTC

    English

    Summary

    This patch restores automatic wrapping and Stop controls for streaming output, updates two security-sensitive dependencies, and includes Garden browsing improvements and optional GPT Image 2.6 GIF output added since v2.15.1.

    Highlights

    • Read long streamed responses and source views without horizontal overflow.
    • Stop an individual text stream in ordinary workspaces and fullscreen views.
    • Search and browse Garden inspiration and Arena evaluation prompts in place.
    • Select GIF output for compatible GPT Image 2.6 endpoints while retaining PNG as the default.

    Product Updates

    Desktop
    • Apply the shared output, Garden browsing and image-output improvements.
    Web
    • Switch between recommended and all Garden prompts, search the catalog, load additional results and retry failed requests.
    • Preserve browsing position and loaded results when closing and reopening the popover in the same workspace and language.
    Extension
    • Apply the shared output and Garden browsing improvements.
    Core/Infra
    • Preserve animated GIF data through image previews, storage and downloads. Compatible endpoints can use optional frame-count and frame-delay parameters.
    • Pin Vue I18n to 11.4.14 and override transitive Hono Node Server to 2.1.3, including its MCP SDK dependency path.

    Fixes

    • Enable CodeMirror line wrapping for streamed and read-only source output, including long paragraphs and URLs. Fixes #374.
    • Restore the default Stop-button policy through embedded, fullscreen and core output components. Explicitly disabled channels, including non-cancellable Arena channels, remain disabled.
    • Include the output architecture regressions in the daily browser gate so optimization history, independent cancellation, terminal-state persistence and concurrent rendering are checked continuously.
    • Improve Garden image cards, source expansion, responsive popover sizing and pagination recovery.
    • Update Vue I18n and Hono Node Server to the patched releases for GHSA-83rm-6c8r-g728, GHSA-8rc2-428q-7ww3 and GHSA-rmxm-3fg6-px4f.

    Breaking Changes / Upgrade Notes

    • No breaking changes or backup-format migration.
    • Garden catalog browsing requires a Garden service with the public catalog endpoint. GIF generation requires an endpoint that supports the requested format and optional animation parameters.
    • Extension ZIP version is 2.15.2; installation remains manual, without an extension-store submission.
    • The stable release workflow builds desktop, extension and Docker images from the same tagged commit. Stable Docker aliases are promoted only after the image checks succeed.

    Developer Notes

    • Browser coverage includes 1440px and 390px output layouts, streaming and completed source views, long URLs, the final line and exact source copying.
    • Cancellation unit coverage checks omitted and explicitly disabled settings through both output wrappers. Existing browser regressions retain optimization-history and cancellation assertions.
    • The release workflow runs repository, core, UI, Web and browser gates before publishing. Simulated CPU throttling and background/freeze tests do not replace acceptance on every native desktop or low-end device.

    Installation guide: English | 中文 Source release notes (EN)


    中文

    概括

    本补丁恢复流式输出自动换行和停止按钮,升级两项安全相关依赖,并收录 v2.15.1 之后的 Garden 浏览改进与 GPT Image 2.6 可选 GIF 输出支持。

    亮点

    • 长段落流式输出和原文视图按面板宽度换行,避免横向溢出。
    • 普通工作区及全屏视图恢复单路文本流的停止操作。
    • 就地搜索和浏览 Garden 灵感与竞技场测评题。
    • 兼容的 GPT Imag
  2. v2.15.12026-11-03 · 2026-11-03 14:46 UTC
    查看更新说明

    English

    Summary

    This patch fixes Function Models selectors collapsing into vertically wrapped text. It also includes the shared HTML/SVG preview fixes and Prompt Garden evaluation-prompt integration already merged after v2.15.0.

    Highlights

    • Restore readable Function Models selectors on desktop and narrow screens.
    • Expand a single HTML/SVG preview in fullscreen and surface preview execution errors.
    • Open common model-evaluation prompts from Prompt Garden directly in Arena.

    Product Updates

    Desktop
    • Apply the shared selector layout and HTML/SVG preview improvements.
    Web
    • Add the evaluation-prompt entry in Arena and support imports from Prompt Garden, including selected example variables and reference images.
    • Preserve test columns and previous results when importing; imports do not automatically start model requests.
    Extension
    • Apply the shared selector and preview improvements, including error reporting from the packaged preview sandbox.
    Core/Infra
    • Reuse existing session and preview components for Garden imports and result rendering.

    Fixes

    • Give Function Models selectors a stable layout wrapper so scoped width rules reach the intended element; keep placeholder text on one line.
    • Recognize standalone SVG and SVG code fences, and fit fixed-size SVG graphics to the preview viewport.
    • Let a single HTML/SVG artifact use the available fullscreen area.
    • Display errors reported by preview scripts, modules, resources and unhandled promises, with frame and preview-revision checks.

    Breaking Changes / Upgrade Notes

    • No breaking changes or backup-format migration.
    • Extension ZIP version is 2.15.1; installation remains manual, without an extension-store submission.
    • Desktop uses the stable update channel. Docker publishes 2.15.1 and promotes the verified image to latest in both registries.

    Developer Notes

    • Selector validation includes 16 existing component tests, the UI bundle build, lint, and rendered checks at desktop and 390px widths.
    • Shared preview and Garden import changes passed the existing master CI before this patch release was prepared.
    • The release workflow runs the existing repository and browser gates, then builds desktop, extension and both multi-architecture images from the same tagged commit before publication.

    Installation guide: English | 中文 Source release notes (EN)


    中文

    概括

    本补丁修复功能模型选择框被挤成竖排的问题,同时收录 v2.15.0 之后已合入的共用 HTML/SVG 预览修复与 Prompt Garden 竞技场测评题集成。

    亮点

    • 恢复桌面与窄屏下功能模型选择框的正常宽度。
    • 单个 HTML/SVG 预览充分使用全屏空间,并显示预览执行错误。
    • 从 Prompt Garden 快速选用常见模型测评提示词,在竞技场中比较模型表现。

    产品更新

    Desktop
    • 应用共用模型选择框布局与 HTML/SVG 预览改进。
    Web
    • 在竞技场增加测评题入口,支持从 Prompt Garden 导入所选示例的变量及参考图片。
    • 导入时保留测试栏和已有结果,不自动发起模型请求。
    Extension
    • 应用共用选择框与预览改进,支持显示打包预览页面报告的错误。
    Core/Infra
    • Garden 导入与结果显示沿用已有会话和预览组件。

    修复

    • 为功能模型选择框提供稳定的布局容器,确保宽度样式生效,并让占位文本保持单行。
    • 识别独立 SVG 文档及 SVG 代码块,让固定尺寸图形适应预览区域。
    • 让单个 HTML/SVG 内容在全屏时使用可用空间。
    • 显示预览脚本、模块、资源及未处理 Promise 报告的错误,并校验消息来源和预览版本。

    破坏性变更 / 升级说明

    • 无破坏性变更,无需迁移备份格式。
    • 扩展 ZIP 版本为 2.15.1,继续供手动安装,本次不提交扩展商店。
    • 桌面发布进入稳定更新渠道;Docker 发布 2.15.1,验证后将同一镜像提升为两个仓库的 latest。

    开发者说明

    • 选择框修复已通过 16 项已有组件测试、UI 构建、代码检查,以及桌面和 390px 窄屏的实际页面检查。
    • 共用预览与 Garden 导入变更在准备本补丁版本前已通过 master 上的现有 CI。
    • 发布流程执行现有仓库与浏览器门禁,从同一标签提交构建桌面、扩展及双仓库多架构镜像,全部成功后再公开版本。

    安装文档:English | 中文 仓库版本说明(中文)


    macOS note: if macOS reports the app as damaged or cannot verif

  3. v2.15.02026-11-03 · 2026-11-03 03:01 UTC
    查看更新说明

    English

    Summary

    This release adds Arena: enter one prompt and optional reference images, then compare responses from text or image models in parallel test columns. Each column selects its own connection and model, supports individual or batch testing, and reuses existing output, session recovery and backup features.

    Highlights

    • One input, multiple models: add independent test columns for text or image generation. Run all selected columns together, or test one column individually.
    • Keep comparisons side by side: desktop columns share the available width, while phones retain two visible columns. Additional columns scroll horizontally, with a visible scrollbar when needed.
    • Familiar controls: reuse existing input, model selection and result components, including Preview, Source, Copy, reasoning display and fullscreen controls.
    • Recover your tests: restore inputs, model choices and previous results through existing sessions. Reference and generated images use the shared asset and backup mechanisms.

    Product Updates

    Desktop
    • Add the Arena entry and forward each column's selected connection and model through the existing desktop service bridge.
    • Capture the selected model configuration for each request without rewriting shared connection settings when switching test models.
    Web
    • Add an Arena workspace with the prompt, reference images and shared actions in a compact input area.
    • Support desktop columns, a two-column phone layout and horizontal scrolling for additional columns, with a direct delete action for each test column.
    • Continue requests across workspace navigation so results remain available when returning to Arena.
    Extension
    • Add the shared Arena entry and test columns to the extension interface.
    • Reuse existing Preview, Source, Copy, fullscreen and empty-state components.
    Core/Infra
    • Add request-local model selection to keep concurrent columns' model choices and outputs independent.
    • Integrate Arena with Session Manager, backup transfer and image asset maintenance.
    • Identify text and image generation models with type labels and icons while retaining the shared selector style.

    Fixes

    • Organize Arena's input, model actions and results to reduce excess whitespace and fit controls into narrow columns.
    • Show a scrollbar when columns overflow and bring newly added columns into view.
    • Unify model menus and result panels across workspaces by removing redundant scope and previous-result copy while retaining save-validity checks.
    • Isolate retries and late callbacks so a stopped request cannot overwrite a newer result.

    Breaking Changes / Upgrade Notes

    • Existing workspaces and backup formats are retained. Important data can be exported with the existing backup tools before upgrading.
    • Each test column makes its own model request, billed by the selected service. Cancellation follows the underlying service's capabilities.
    • The extension uses numeric version 2.15.0 without a prerelease display name. Install the ZIP manually, including when moving from the beta to this stable release; this release does not submit an extension-store update.
    • Docker images use the 2.15.0 tag and promote the verified image to latest in both registries. The desktop release enters the stable update channel.

    Developer Notes

    • Arena reuses existing input, model selection, output document and image asset components, with execution state managed by the session layer.
    • Regression coverage includes concurrent requests, model isolation, retries after cancellation, late callbacks, refresh recovery and image backups. Existing CI also runs workspace and extension browser regressions.
    • The complete automated gate and platform builds have been verified. Arena-specific end-to-end acceptance on native Electron, physical phones and real image providers remains unverified.
    • The release workflow builds desktop, extension and matching multi-architecture images for both
  4. v2.15.0-beta.1pre-release2026-11-03 · 2026-11-03 02:20 UTC
    查看更新说明

    English

    Summary

    This preview adds Arena: enter one prompt and optional reference images, then compare responses from text or image models in parallel test columns. Each column selects its own connection and model, supports individual or batch testing, and reuses existing output, session recovery and backup features.

    Highlights

    • One input, multiple models: add independent test columns for text or image generation. Run all selected columns together, or test one column individually.
    • Keep comparisons side by side: desktop columns share the available width, while phones retain two visible columns. Additional columns scroll horizontally, with a visible scrollbar when needed.
    • Familiar controls: reuse existing input, model selection and result components, including Preview, Source, Copy, reasoning display and fullscreen controls.
    • Recover your tests: restore inputs, model choices and previous results through existing sessions. Reference and generated images use the shared asset and backup mechanisms.

    Product Updates

    Desktop
    • Add the Arena entry and forward each column's selected connection and model through the existing desktop service bridge.
    • Capture the selected model configuration for each request without rewriting shared connection settings when switching test models.
    Web
    • Add an Arena workspace with the prompt, reference images and shared actions in a compact input area.
    • Support desktop columns, a two-column phone layout and horizontal scrolling for additional columns, with a direct delete action for each test column.
    • Continue requests across workspace navigation so results remain available when returning to Arena.
    Extension
    • Add the shared Arena entry and test columns to the extension interface.
    • Reuse existing Preview, Source, Copy, fullscreen and empty-state components.
    Core/Infra
    • Add request-local model selection to keep concurrent columns' model choices and outputs independent.
    • Integrate Arena with Session Manager, backup transfer and image asset maintenance.
    • Identify text and image generation models with type labels and icons while retaining the shared selector style.

    Fixes

    • Organize Arena's input, model actions and results to reduce excess whitespace and fit controls into narrow columns.
    • Show a scrollbar when columns overflow and bring newly added columns into view.
    • Unify model menus and result panels across workspaces by removing redundant scope and previous-result copy while retaining save-validity checks.
    • Isolate retries and late callbacks so a stopped request cannot overwrite a newer result.

    Breaking Changes / Upgrade Notes

    • This is a prerelease for trying the feature and providing feedback. Important data can be exported with the existing backup tools before upgrading; existing workspaces and backup formats are retained.
    • Each test column makes its own model request, billed by the selected service. Cancellation follows the underlying service's capabilities.
    • The extension uses numeric version 2.15.0 and display version 2.15.0-beta.1. Install the ZIP manually; this release does not submit an extension-store update.
    • Docker images use the full 2.15.0-beta.1 tag. This prerelease does not promote stable latest image tags or change the stable desktop update channel.

    Developer Notes

    • Arena reuses existing input, model selection, output document and image asset components, with execution state managed by the session layer.
    • Regression coverage includes concurrent requests, model isolation, retries after cancellation, late callbacks, refresh recovery and image backups. Existing CI also runs workspace and extension browser regressions.
    • Arena-specific end-to-end acceptance on native Electron, physical phones and real image providers remains unverified; preview feedback will help validate those surfaces.
    • The release workflow builds desktop, extension and matching multi-architecture images for both regi
  5. v2.14.02026-11-02 · 2026-11-02 06:14 UTC
    查看更新说明

    English

    Summary

    This release adds local-service discovery and guided model setup, unifies workspace controls and model selection, and reorganizes data management and cloud backups. It also adds prompt-source hover previews and fixes configuration fields that could not be cleared reliably, category-parent clearing, and delayed hover previews covering the full-prompt dialog.

    Highlights

    • Discover local model services: the text model manager identifies supported reachable services and offers a shortcut to the existing connection editor, with provider-specific setup guidance.
    • Clearer workspace controls: consistent icons, compact source and model selectors, and responsive toolbars make configuration and output actions easier to find.
    • Inspect the prompt being tested: hover to read a source preview on desktop, or open its full content directly. Source labels and model selection stay tied to the corresponding workspace.
    • Organized data management: review device storage, export or restore a local file, and manage cloud backups through distinct sections with clearer connection and loading states.

    Product Updates

    Desktop
    • Add controlled local-service probes through the desktop bridge and guided model connection setup.
    • Preserve explicit field clears across desktop IPC when saving model configurations.
    • Apply the shared workspace, source-preview and data-management improvements, including saved cloud-backup connection credentials and read-only connection/list operations.
    Web
    • Discover supported reachable Ollama, Magpie, CLIProxyAPI, LiteLLM and llama.cpp services. Offer Chrome AI integration where the browser exposes the required capability.
    • Prefill connection drafts and provide service-specific connection help. Model refresh, credentials, model selection and saving remain explicit user actions.
    • Deduplicate already configured local addresses and keep model choices isolated between workspaces.
    • Present device data, local files and cloud backups in a shared responsive data-management interface.
    Extension
    • Use the updated workspace controls, model selectors and prompt-source previews in the extension interface.
    • Keep multiple inline HTML previews independently interactive across preview/source switching and page lifecycle changes.
    • Refine narrow-screen actions and the shared data-management and backup controls.
    Core/Infra
    • Add local-service identification, model-catalog normalization and the Magpie adapter.
    • Preserve explicit configuration clears through IPC serialization and model-update handling.
    • Expand regression coverage for local discovery, connection drafts, workspace model isolation, backup workflows and source-preview interactions.

    Fixes

    • Save a cleared category parent correctly so a category can be moved back to the root.
    • Preserve explicitly cleared model configuration fields, including API keys, through the desktop service bridge.
    • Ignore stale hover callbacks after a source menu closes, Escape cancels a pending preview, or the full-prompt dialog opens. The hover card no longer reopens over the dialog's controls.
    • Restore clear prompt-source labels, keep workspace model selections independent, and fit compact action labels within available space.
    • Persist cloud-backup credentials, retain existing lists after a refresh error, and ignore responses superseded by newer connection settings or authorization.
    • Keep cloud connection checks and directory lookup read-only; creation and restoration remain separate actions.

    Breaking Changes / Upgrade Notes

    • Export a backup of important application data before upgrading; the existing backup format and remote directories are retained.
    • Local discovery does not read or create API keys, automatically import models, or make inference requests. Authenticated services still require the user's own client key. Browser access remains subject to CORS and local-network access rules.
    • LM Studio and CC

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Prompt Optimizer 🚀

    English | 中文

    GitHub stars Chrome Web Store Users

    License Docker Pulls GitHub forks Deploy with Vercel

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

    First-time Tutorial | 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

    ✨ Core Features

    • 🎯 Intelligent Optimization: One-click prompt optimization with multi-round iterative improvements to enhance AI response accuracy
    • 📝 Dual Mode Optimization: Support for both system prompt optimization and user prompt optimization to meet different usage scenarios
    • 🔄 Analysis and Compare Evaluation: Supports analysis, single-result evaluation, and multi-result compare evaluation to help determine whether a prompt has truly improved
    • 🤖 Multi-model Integration: Support for mainstream AI models including OpenAI, Gemini, DeepSeek, Grok, Zhipu AI, SiliconFlow, MiniMax, etc.
    • 🖼️ Image Generation: Support for Text-to-Image (T2I), Image-to-Image (I2I), and Multi-Image generation with models like Gemini, Seedream, Grok
    • 🌱 Prompt Sources: Start from manual writing, templates, local imports, or Prompt Garden import codes
    • ⭐ Smart Favorites: Resource-aware prompt assets with version history, reproducible examples, media support, source binding, and workspace application
    • 📊 Advanced Testing Mode: Context variable management, multi-turn conversation testing, Function Calling support
    • 🔒 Secure Architecture: Pure client-side processing with direct data interaction with AI service providers, bypassing intermediate servers
    • 📱 Multi-platform Support: Available as web application, desktop application, Chrome extension, and Docker deployment
    • 🔐 Access Control: Password protection feature for secure deployment
    • 🧩 MCP Protocol Support: Supports Model Context Protocol (MCP), enabling integration with MCP-compatible AI applications like Claude Desktop

    🚀 Advanced Features

    Image Generation Mode

    • 🖼️ Text-to-Image (T2I): Generate images from text prompts
    • 🎨 Image-to-Image (I2I): Transform and optimize images based on local files
    • 🖼️ Multi-Image Generation: Use multiple input images to constrain subject relationships, sequential semantics, and final generation goals
    • 🔌 Multi-model Support: Integrated with mainstream image generation models like Gemini, Seedream, Grok
    • ⚙️ Model Parameters: Support model-specific parameter configuration (size, style, etc.)
    • 📥 Preview & Download: Real-time preview of generated results with download support
    • 🔄 Style Transfer: Learn style, composition, and color from reference images

    Prompt Sources & Smart Favorites

    • 🌱 Optional Prompt Sources: Bring prompts from manual writing, templates, local files, or Prompt Garden
    • 📥 Import & Collect: Import prompts with metadata, media, examples, and source binding when available
    • ⭐ Resource-aware Assets: Save stable prompts as reusable favorites with version history
    • 🔗 Source Binding: Track prompt origins and maintain reproducible examples without requiring a specific source
    • 📦 Complete Backup: Export and import favorites with all referenced resources

    Advanced Testing Mode

    • 📊 Context Variable Management: Custom variables, batch replacement, variable preview
    • 💬 Multi-turn Conversation Testing: Simulate real conversation scenarios to test prompt performance in multi-turn interactions
    • 🛠️ Function Calling Support: Function Calling integration with support for OpenAI and Gemini tool calling
    • 🔍 Analysis and Evaluation Pipeline: Supports analysis, evaluation, compare evaluation, and evaluation-driven smart rewrite in text modes

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

    Quick Start

    1. Use Online Version (Recommended)

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

    The online app stores its app data in your browser. Model requests go directly to the provider you configure. For your first run, connect one working text model in Model Manager, then follow the first-time tutorial to improve and copy a prompt.

    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):

    • First fork the project to your GitHub account
    • Then import the project to Vercel
    • This allows tracking of source project updates for easy syncing of new features and fixes
    • Configure environment variables:
      • ACCESS_PASSWORD: Set access password to enable access restriction
      • VITE_OPENAI_API_KEY etc.: Optional private-deployment model settings. Do not preconfigure API keys on public frontend deployments because VITE_* values are exposed in browser assets.

    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.

    • Installer (Recommended): Such as *.exe, *.dmg, *.AppImage, etc. Strongly recommended as it supports automatic updates.
    • Archive: Such as *.zip. Extract and use, but cannot auto-update.

    Core Advantages of Desktop Application:

    • ✅ No CORS Limitations: As a native desktop application, it completely eliminates browser Cross-Origin Resource Sharing (CORS) issues. This means you can directly connect to any AI service provider's API, including locally deployed Ollama or commercial APIs with strict security policies, for the most complete and stable functional experience.
    • ✅ Automatic Updates: Versions installed through installers (like .exe, .dmg) can automatically check and update to the latest version.
    • ✅ Independent Operation: No browser dependency, providing faster response and better performance.

    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

    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:

    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

    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

    Method 1: Via Interface (Recommended)

    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

    # 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

    • Basic feature development
    • Web application release
    • Chrome extension release
    • Internationalization support
    • Support for system prompt optimization and user prompt optimization
    • Desktop application release
    • MCP service release
    • Advanced mode: Variable management, context testing, function calling
    • Image generation: Text-to-Image (T2I) and Image-to-Image (I2I) support
    • Prompt favorites and template management
    • Support for workspace/project management

    For detailed project status, see Project Status Document

    📖 Related Documentation

    Star History

    FAQ

    API Connection Issues

    Q1: Why can't I connect to the model service after configuring the API key?

    A: Most connection failures are caused by Cross-Origin Resource Sharing (CORS) issues. As this project is a pure frontend application, browsers block direct access to API services from different origins for security reasons. Model services will reject direct requests from browsers if CORS policies are not correctly configured.

    Q2: How to solve Ollama connection issues?

    A: Ollama fully supports the OpenAI standard interface, just configure the correct CORS policy:

    1. Set environment variable OLLAMA_ORIGINS=* to allow requests from any origin
    2. If issues persist, set OLLAMA_HOST=0.0.0.0:11434 to listen on any IP address
    Q3: How to solve CORS issues with commercial APIs (such as Nvidia's DS API, ByteDance's Volcano API)?

    A: These platforms typically have strict CORS restrictions. Recommended solutions:

    1. Use Desktop Application (Most Recommended)

      • Desktop app has no CORS restrictions as a native application
      • Can directly connect to any API service, including locally deployed models
      • Provides the most complete and stable feature experience
      • Download from GitHub Releases
    2. Use Self-deployed API Proxy Service (Professional solution)

      • Deploy open-source API aggregation/proxy tools like OneAPI, NewAPI
      • Configure as custom API endpoint in settings
      • Request flow: Browser → Proxy service → Model service provider
      • Full control over security policies and access permissions

    Note: All web versions (including online version, Vercel deployment, Docker deployment) are pure frontend applications and subject to browser CORS restrictions. Only the desktop version or using an API proxy service can solve CORS issues.

    Q4: I have correctly configured CORS policies for my local model (like Ollama), why can't I still connect using the online version?

    A: This is caused by the browser's Mixed Content security policy. For security reasons, browsers block secure HTTPS pages (like the online version) from sending requests to insecure HTTP addresses (like your local Ollama service).

    Solutions: To bypass this limitation, you need to have the application and API under the same protocol (e.g., both HTTP). We recommend the following approaches:

    1. Use the desktop version: Desktop applications have no browser restrictions and are the most stable and reliable way to connect to local models
    2. Use Docker deployment (HTTP): Access via http://localhost:8081, both the app and local Ollama use HTTP
    3. Use Chrome extension: Extensions can bypass some security restrictions in certain situations

    macOS Desktop Application Issues

    Q5: macOS shows "damaged" or "unverified developer" when opening the app?

    A: This is because the application has not been signed with an Apple Developer certificate. Due to the high cost of Apple Developer accounts, the desktop application is currently unsigned.

    Solution: Run the following command in Terminal to remove the quarantine attribute:

    # For installed applications
    xattr -rd com.apple.quarantine /Applications/PromptOptimizer.app
    
    # For downloaded .dmg files (run before installation)
    xattr -rd com.apple.quarantine ~/Downloads/PromptOptimizer-*.dmg
    

    After running the command, you can open the application normally.

    🤝 Contributing

    1. Fork the repository
    2. Create a feature branch (git checkout -b feature/AmazingFeature)
    3. Commit your changes (git commit -m 'Add some feature')
    4. Push to the branch (git push origin feature/AmazingFeature)
    5. Open a Pull Request

    Tip: When developing with Cursor tool, it is recommended to do the following before committing:

    1. Use the "CodeReview" rule for review
    2. Check according to the review report format:
      • Overall consistency of changes
      • Code quality and implementation method
      • Test coverage
      • Documentation completeness
    3. Optimize based on review results before submitting

    👏 Contributors

    Thanks to all the developers who have contributed to this project!

    🙏 Acknowledgements

    This project was partly inspired by LangGPT in prompt engineering and structured prompt design. Thanks to the LangGPT project and community for their open-source sharing and continued exploration.

    📄 License

    This project is licensed under AGPL-3.0.

    In simple terms: You can freely use, modify, and commercialize this project, but if you turn it into a website or service for others, you must share your source code.

    What you can do:

    • ✅ Personal use, learning, and research
    • ✅ Internal company use (not offering public services)
    • ✅ Modify code for commercial projects
    • ✅ Charge for products or services

    What you must do:

    • 📖 If distributing software or offering network services, disclose source code
    • 📝 Preserve original author's copyright notices

    Core principle: Commercial use is allowed, but not closed-source.


    If this project is helpful to you, please consider giving it a Star ⭐️

    👥 Contact Us

    • Submit an Issue
    • Create a Pull Request
    • Join the discussion group