Skip to content

0xJonHoldsCrypto/promptforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PromptForge

PromptForge Hero

Tests License Platforms TypeScript

An AI prompt optimizer geared towards local AI being run on personal hardware.

Features

  • Core Library: Shared logic for prompt optimization and API payload generation.
  • CLI Tool: Optimize prompts from the command line.
  • Web Interface: Modern Next.js application for visual optimization.

🚀 Installation

Ensure you have Node.js (v18+) and pnpm installed.

# Clone the repository
git clone https://github.com/0xJonHoldsCrypto/promptforge.git
cd promptforge

# Install dependencies
pnpm install

# Build the project
pnpm build

💻 Usage

CLI Tool

The CLI allows you to optimize prompts directly from your terminal.

Basic Optimization

# Run the optimizer on a simple string
node packages/cli/dist/index.js optimize "Could you please write me a python script for snake?"

JSON Output Useful for piping into other tools or scripts.

node packages/cli/dist/index.js optimize "Fix this bug" --json

Options

Option Description
-j, --json Output results as structured JSON
-m, --model Target specific model (openai, anthropic, gemini)
--no-strip Disable the automatic removal of "fluff" words

Web Interface

The web interface provides a rich, dark-mode UI for visual optimization and API payload generation.

  1. Start the development server:

    cd packages/web
    pnpm dev
  2. Open your browser: Navigate to http://localhost:3000

  3. Features:

    • Split View: Input on the left, optimized results on the right.
    • Tabs: Switch between readable text, raw JSON, and ready-to-use API payloads.
    • Real-time: format conversion and token estimation.

📦 Packages structure

  • @promptforge/core: The brain. detailed prompt optimization logic and types.
  • @promptforge/cli: The terminal interface. Built with Commander.js.
  • @promptforge/web: The visual interface. Built with Next.js & Tailwind.

About

An AI prompt optimizer geared towards local AI being run on personal hardware.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors