Skip to main content

RIDER — Autonomous Prompt Optimization

PyPI Python License: MIT

Python client for RIDER (Reflective Iterative Diversity-Enhanced Reasoning) — a metaheuristic prompt optimization engine that evolves prompts through evolutionary algorithms, multi-armed bandits, and error-directed refinement.

17 WIN / 0 LOSE across 6 benchmarks (GSM8K, AG_News, SQuAD 2.0, CommonGen, XSum, CodeSearchNet) on 3 LLM models (Claude Haiku 4.5, GPT-4.1, DeepSeek V3.2). Published at FSE 2026 (CORE A*) and FRUCT 39 (IEEE).


See it in action

🔴 Before — 3 words, vague, unusable

Write a summary

🟢 After RIDER — 185 words, structured, production-ready

ROLE: Expert technical writer specializing in distilling complex content
EXPERIENCE: 10+ years in information architecture and content strategy

TASK: Create a comprehensive yet concise summary of the provided content

METHODOLOGY:
  1. Identify the core thesis and 3-5 key supporting arguments
  2. Extract critical data points, statistics, and evidence
  3. Prioritize information by actionability and impact
  4. Structure using inverted pyramid (most important first)
  5. Verify no critical information is lost in compression

FORMAT: 3-5 sentences. Lead with the conclusion.
TONE: Neutral, factual, no editorializing

CONSTRAINTS:
  - No filler phrases ("In this article...", "It is worth noting...")
  - No personal opinions or subjective assessments
  - Preserve all numerical data and proper nouns exactly
  - If the source contradicts itself, note the contradiction

ANTI-PATTERNS:
  - Do NOT start with "This article discusses..."
  - Do NOT use bullet points (prose only)
  - Do NOT add information not present in the source

Result: 185 words · +6000% expansion · +167% quality improvement
Another example: "fix the bug" → full debugging framework

Before

fix the bug

After RIDER

ROLE: Senior software debugging specialist with 15+ years of experience
      in systematic root cause analysis.

TASK: Diagnose and fix the reported bug using a structured methodology.

METHODOLOGY:
  1. REPRODUCE:  Identify exact steps to trigger the bug; document
                 expected vs. actual behavior.
  2. DIAGNOSE:   Binary-search through recent changes; check logs,
                 stack traces, and recent commits.
  3. FIX:        Implement the minimal targeted fix; add a regression
                 test that would have caught it.
  4. VERIFY:     Run the full test suite and check adjacent edge cases
                 before closing the issue.

CONSTRAINTS:
  - Do not silence errors with try/except — address the root cause.
  - Do not add defensive code for scenarios that cannot happen.
  - The fix must not break any existing tests.

Result: 120 words · +3900% expansion

Try it yourself: riderprompt.com has a live demo that runs RIDER on your prompt in under 30 seconds.


Installation

pip install riderprompt

Quick Start

Get your API key at riderprompt.com, then:

from rider import Rider

client = Rider(api_key="rider_sk_...")

result = client.optimize(
    prompt="Write a summary of this article",
    mode="standard",
)

print(result.optimized_prompt)
print(f"Improvement: {result.improvement:.1f}%")
print(f"Fitness score: {result.fitness:.2f}")
print(f"Duration: {result.duration_seconds:.1f}s")

Optimization Modes

Mode Time API Calls Best For
light ~15 sec 5 Quick rewrite, 2 strategies compete
blitz ~30 sec 11 4 strategies + merge + error refinement
standard ~1 min 19 Full 3-phase PHASE REACTOR (default)
ultra ~2 min 25 4 phases + adversarial review

Features

  • 🧬 Evolutionary algorithms — 9 operators (EDA mutation, differential evolution, genetic crossover, semantic paraphrase, etc.)
  • 🎰 Adaptive operator selection — Windowed Thompson Sampling with Bayesian elimination
  • 🎯 Error-directed evolution — feeds misclassified examples back into generation
  • ⚡ Evaluate-first (μ+λ) retention — diversity tiebreaking
  • 🔄 8 exclusive protocols — PRISM, NEXUS, PHASE REACTOR, OPERATOR FORGE, ECHO, CHIMERA, VORTEX, MARS CONFIG

Examples

Optimize a prompt with custom validation data

result = client.optimize(
    prompt="Classify this text as positive or negative",
    mode="ultra",
    validation_examples=[
        {"input": "I love this!", "expected": "positive"},
        {"input": "This is terrible", "expected": "negative"},
    ],
)

Async usage with multiple prompts

import asyncio
from rider import AsyncRider

async def optimize_many(prompts):
    client = AsyncRider(api_key="rider_sk_...")
    tasks = [client.optimize(p, mode="light") for p in prompts]
    results = await asyncio.gather(*tasks)
    return results

Pricing

  • Free — 3 optimizations/day (Light + Blitz modes)
  • Pro ($9.99/mo) — 50/day, all 4 modes, REST API
  • Ultra ($29.99/mo) — Unlimited, priority queue

See pricing

Citation

If you use RIDER in your research, please cite:

@inproceedings{dragomirov2026rider,
  title={{RIDER}: Evolutionary Prompt Optimization with Adaptive Operator Selection for Software Engineering},
  author={Dragomirov, Daglar and Kulin, Nikita and Muravyov, Sergey and Makarov, Ilya and Sukhorukov, Daniil and Mozikov, Mikhail},
  booktitle={Companion Proceedings of the 34th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (FSE Companion '26)},
  year={2026},
  doi={10.1145/3803437.3807393},
}

License

MIT License — see LICENSE file.

Metadata

Release files for riderprompt 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for riderprompt 0.1.2
File Size Uploaded Provenance
riderprompt-0.1.2.tar.gz 15.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for riderprompt 0.1.2
File Interpreter ABI Platform
riderprompt-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.1 kB

Release files / riderprompt-0.1.2.tar.gz

Download URL riderprompt-0.1.2.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f7cddaf7aabe56d7bf6d409e919d75e498ef281abcddae928a1d26e516a4cb06
BLAKE2b-256 checksum
How to use checksums
176dbea3633a91e87d585ddf4cb10f81c4e8362f7895fa5f94f7091fa7b3b863
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.4

Release files / riderprompt-0.1.2-py3-none-any.whl

Download URL riderprompt-0.1.2-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
684b321901d31cdf713b965d58f49438867947eab54d26062e38356aed61ceef
BLAKE2b-256 checksum
How to use checksums
3dadd95e0216ad0180df3ec59a3437fabfd7e33976a13501b80b73323cb46464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.4

Security for riderprompt 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page