Vizpy

Introduction

Better prompts in one API call

Welcome to Vizpy

Vizpy automatically optimizes your LLM prompts by learning from failures. One API call, dramatically better results.

import vizpy
 
result = vizpy.optimize(
    prompt="You are a helpful assistant...",
    examples=my_dataset,
    metric="accuracy",
)
 
# 73% → 91% accuracy. One API call.
print(result.optimized_prompt)

Why Vizpy?

The Problem

Prompt engineering is tedious:

  • Manual trial and error
  • Hard to systematically improve
  • No understanding of why prompts fail
  • Improvements on one case break others

The Solution

Vizpy uses contrastive learning to understand failure patterns and generate targeted improvement rules:

  1. Run your examples through the prompt
  2. Identify failures and successful retries
  3. Extract rules from bad→good transitions
  4. Validate each rule (reject rules that hurt)
  5. Synthesize into clear, actionable instructions

The result: prompts that work better and improvements you can understand.

Key Features

One API Call

No complex setup. Pass examples, get optimized prompt.

Learns from Failures

Contrastive learning extracts rules from what went wrong.

Validates Rules

Each rule is tested. Harmful rules are rejected.

Interpretable

See exactly what rules improved your prompt.

Works with DSPy

Native integration with DSPy modules and signatures.

Production Ready

Metered billing, usage tracking, enterprise support.

Quick Example

import dspy
import vizpy
 
# Your task
class QA(dspy.Signature):
    """Answer questions accurately."""
    question: str = dspy.InputField()
    answer: str = dspy.OutputField()
 
module = dspy.Predict(QA)
 
# Your metric
def metric(example, prediction):
    correct = example["answer"].lower() in prediction.answer.lower()
    return vizpy.Score(
        value=1.0 if correct else 0.0,
        is_success=correct,
        feedback=f"Expected: {example['answer']}" if not correct else ""
    )
 
# Optimize
optimizer = vizpy.ContraPromptOptimizer(metric=metric)
optimized = optimizer.optimize(module, train_examples)
 
# Use it
result = optimized(question="What is the capital of France?")

How It Works

Solve

Run examples through your module with retries. Collect failures and successful corrections.

Mine

Extract contrastive pairs (bad to good). Focus on examples with largest improvement.

Extract

LLM analyzes pairs to generate rules. "When X happens, do Y instead of Z"

Validate

Test each rule on held-out examples. Reject rules that hurt performance.

Synthesize

Combine rules into clear instructions. Inject into your module's prompt.

Iterate

Repeat until no improvement or max iterations reached.

Pricing

Simple, predictable pricing. One run = one optimize() call.

PlanPriceRuns/MonthBest For
Free$03Trying it out
Pro$4950Indie devs
Team$199200Startups
EnterpriseCustomUnlimitedScale

View full pricing →

Get Started

On this page