Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Eyas logo

Eyas — Automatic Prompt Optimization for Multimodal Models

Train sharp-eyed prompts for multimodal models.

Eyas is a performance-first framework for automatic prompt optimization (APO) on multimodal models: bring a task, a seed prompt and a round budget (run.max_steps), and Eyas runs a real optimization loop (hill climbing, evolutionary search, gradient-style rewriting) and hands you back a better prompt, with the cost accounting to prove what it spent.

The story, in one table

TextVQA (scene-text QA, rule-scored, no LLM judge), Qwen3.5-9B, held-out test split (n = 100), mean ± σ over the fixed seeds 42/43/44:

raw (seed prompt) opro (optimized prompt) Δ (pp)
0.736 ± 0.004 0.788 ± 0.029 +5.2

No weights touched: the search replaced one sentence of the prompt, and the held-out gain above is what it bought, measured with the story config you are about to run, against a self-hosted OpenAI-compatible endpoint. At n = 100 a single reading carries a ±4 to 5 pp noise band, so the table quotes three-seed means; every seed lifted, and the σ shows the loop's real run-to-run spread. The published in-process-vLLM wave of the same configs tells the same story with an unusually tight three-seed cluster (+8.7 pp, docs/07 §E2, the three-seed effect table); the commands and every artifact are walked end to end in Getting started.

The full published scoreboard, 7 models × 6 datasets × 8 methods × 3 seeds (1008 completed runs, judge-channel and token accounting on every cell), is the bench benchmark.

Supported methods: five published SOTA baselines, three framework baselines

Eyas reproduces five state-of-the-art prompt optimization methods from the literature — APE, OPRO, EvoPrompt, ProTeGi, SPO — plus three framework baselines, all eight running on one strategy contract at equal budgets. Δ is the published TextVQA test gain over the seed prompt (mean ± σ over seeds 42/43/44, quickstart tier, machine-regenerated from the run dirs); each row links its method card, and every paper method carries a conformance record against the official repo pinned at commit level (baseline fidelity).

Method Published as Algorithmic identity Δ vs raw
opro OPRO — Yang et al., Optimization by PROmpting, ICLR 2024 (arXiv:2309.03409) keeps an (instruction, score) trajectory in context; the model proposes its successor from the ranking +8.7 pp
spo SPO — Xiang et al., Self-Supervised Prompt Optimization, Findings of EMNLP 2025 (arXiv:2502.06855) reference-free answer voting: ABBA pairwise ballots, the selection channel never sees a gold label +6.4 pp
evoprompt EvoPrompt — Guo et al., ICLR 2024 (arXiv:2309.08532) evolves a prompt population with LLM-run genetic / differential-evolution operators +5.8 pp
ape APE — Zhou et al., Large Language Models Are Human-Level Prompt Engineers, ICLR 2023 (arXiv:2211.01910) one-shot forward induction: induce instructions from demo pools, score the whole pool, keep the best +5.6 pp
protegi ProTeGi — Pryzant et al., EMNLP 2023 (arXiv:2305.03495) textual gradients on sampled errors + beam search + UCB bandit candidate selection +1.3 pp
hill_climb framework baseline (classic iterative refinement) greedy local search over a fixed edit menu +0.2 pp
cot framework baseline (chain-of-thought rendering) identity lives in the rendered prompt, not the loop −42.8 pp on this judgeless QA task — the published anti-pattern row
raw framework baseline (evaluation floor) evaluates the seed prompt once; every Δ above is measured against it 0

Picking between them is a documented decision, not folklore: which method should I pick? maps task shape and budget to a starting method.

Run the story

Requires Python: core 3.12–3.14; vLLM extra verified on 3.12. Install with uv:

uv venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
uv pip install "eyas[api,prepare]"     # the story path: HTTP client + dataset prep

Extras compose; pick one inference shape and add prepare once to build datasets — the primary block above is exactly that (eyas[api,prepare]):

Install What you get Notes
uv pip install "eyas[vllm]" In-process vLLM engine Recommended default; brings its own torch/transformers
uv pip install "eyas[api]" OpenAI-compatible HTTP client Lightest option; rendering happens server-side
uv pip install "eyas[prepare]" eyas prepare dataset download/convert Needed once per dataset; heavy reader stack (datasets, pyarrow)

Smoke-test the install before touching data: this built-in demo_shapes task generates its own PNGs (no dataset, no GPU), so the whole loop runs wherever you have an endpoint. The config points at a local server; export EYAS_API_KEY with your key and point base_url at any OpenAI-compatible endpoint to run it for real:

export EYAS_API_KEY="${EYAS_API_KEY:-local-placeholder}"   # any non-empty value for a local server
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT
cat > "$tmp" <<'YAML'
run:
  name: demo_shapes
  seed: 42

task:
  name: demo_shapes   # built-in zero-data task: generates solid-color square PNGs
  params: {}

protocol:
  name: identity

backend:
  name: openai
  params:
    base_url: http://localhost:8000/v1   # point this at any OpenAI-compatible endpoint
    model: qwen3.5-9b
    api_key_env: EYAS_API_KEY
    max_inflight: 16
  sampling:
    thinking: false

eval_model:
  name: absolute

budget:
  name: flat
  params: {}  # FlatBudget is parameterless: every candidate, full split

strategy:
  name: raw   # evaluate the seed prompt once: the fastest end-to-end check
YAML
uv run eyas run --config "$tmp" --output-dir outputs/eyas_smoke

Build the exact splits the story config points at:

uv run eyas prepare --dataset textvqa

Write quickstart_textvqa_opro.yaml — the experiment is the YAML, and the whole connection to your model is two lines:

run:
  name: quickstart_textvqa_opro
  seed: 42
  final_eval:
    split: test

task:
  name: vqa
  params:
    data_dir: datasets/quickstart/textvqa/data
    images_dir: datasets/quickstart/textvqa/images

backend:
  name: openai
  params:
    base_url: http://localhost:8000/v1   # any OpenAI-compatible endpoint
    model: qwen3.5-9b                    # the story model: your served model name
    api_key_env: EYAS_API_KEY            # the environment variable holding your key
    max_inflight: 16
  sampling:
    thinking: false

protocol:
  name: identity

eval_model:
  name: absolute

budget:
  name: flat
  params: {}  # FlatBudget is parameterless: every candidate, full split

strategy:
  name: opro
  params:
    rounds: 4

Then run it:

uv run eyas run --config quickstart_textvqa_opro.yaml

Each run writes a self-contained run directory under outputs/<run.name>/<timestamp> by default, holding result.json (best prompt, history, cost), checkpoint.json, and status.json (live phase / round / cost). One config, two backend shapes: keep backend.name: openai for any OpenAI-compatible endpoint (uv pip install "eyas[api]"), or switch it to vllm for the in-process engine (uv pip install "eyas[vllm]", the recommended default); the config's two lines base_url and api_key_env are the whole connection to your model. No endpoint yet? The guided tour executes the complete loop on a built-in synthetic task: zero downloads, zero keys, zero GPU.

The published cells — zero-file runs

The benchmark's dataset × method board ships inside the installed package as the config spec: eyas run --cell <dataset>/<method> assembles one published cell live and runs it — no YAML to write, no repo checkout. Preview any address offline first (assembles from the packaged spec, prints its digest, runs nothing):

uv run eyas run --cell pets/raw --dry-run

A real run resolves the cell's data paths relative to the current directory, so run it from where the datasets were built — after uv run eyas prepare --dataset both (pets + sroie), uv run eyas run --cell pets/raw just works. (Drop the uv run prefix throughout if eyas is already on your PATH — an activated venv, or a plain install.) The address inventory is the published board (quickstart benchmark, bench benchmark); eyas gen-configs exports a cell's exact effective YAML when you want to edit it.

Working on Eyas itself — a repo checkout with uv sync and the configs/, examples/ and scripts/ trees — starts with git clone https://github.com/Davidham3/eyas.git and is covered in CONTRIBUTING.

What every method shares

  • Eight methods on one strategy contract. raw, cot, hill_climb, evoprompt, opro, ape, protegi, spo: a method's algorithm identity lives only in its strategy's step decisions; the managed loop owns every invariant (budgets, evaluation, accounting, resume). That is what makes eight methods comparable on equal budgets, and writing your ninth a ~100-line exercise.
  • Every run bills the judge channel separately (judge_requests) and totals tokens; the published scoreboard reads accuracy against price.
  • A run directory is a self-contained checkpoint: per-sample evaluation records (SQLite in WAL (write-ahead logging) mode), content-addressed prompt identity, resumable and movable.

Modality is a sample-level choice, not a framework fork: the same loop covers text, image, video or any mix of the three, with shipped benchmark recipes for gsm8k, cub, pets, textvqa, sroie, nextqa and a mixed mixed_mcq.

Documentation

The docs site lives in docs/ (build: uv sync --group docs && uv run sphinx-build -b html docs docs/_build/html). Tutorials: getting started, guided tour, your first optimization, understanding results, custom tasks, custom optimization methods, inference backends, reproducing the benchmark. Runnable starter packages live in examples/. The contract-driven design is the authoritative architecture reference; the benchmark protocols are docs/07 and docs/08, and the per-method conformance contract is baseline fidelity.

Data, models and provenance

Eyas ships code, not data or weights: benchmark datasets are downloaded at prepare time from their upstream hosts, datasets/ is gitignored and nothing is redistributed. The Apache-2.0 license covers the code only, while each dataset and model checkpoint keeps its own license and terms, and several benchmark sets are research-use (sources and the model-checkpoint rule: Data and models).

Provenance note: every published number is script-generated from the runs' result.json files by scripts/aggregate_bench_results.py, so the published tables are measurements of runs you can reproduce. The GPU run directories themselves are not distributed; regenerate them with the benchmark tutorial and docs/08 §2-3.

Contributing

Two decorator-based registries cover the extension surface: Task / Backend / Judge / Protocol (what gets asked, where requests go, how responses become scores) and Strategy / EvalModel / Budget / PairwiseJudge (the method itself, its scoring semantics, its budget policy, pluggable pairwise judging); duplicate names fail fast. Start with Custom optimization methods; hill_climb in src/eyas/engine/strategies/ is the reference implementation, and every shipped strategy runs end-to-end on the framework's scripted in-repo test backend in CI (the fast suite is uv run pytest, zero GPU).

License

Apache-2.0, see LICENSE; it covers the code only (see Data, models and provenance).

Metadata

Release files for eyas 0.1.0rc2

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

Source distribution (sdist)

Source distribution for eyas 0.1.0rc2
File Size Uploaded Provenance Actions
eyas-0.1.0rc2.tar.gz 225.1 kB With provenance Details for eyas-0.1.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eyas 0.1.0rc2
File Interpreter ABI Platform Actions
eyas-0.1.0rc2-py3-none-any.whl Python 3 none any Details for eyas-0.1.0rc2-py3-none-any.whl

Total release size: 491.3 kB

Release files / eyas-0.1.0rc2.tar.gz

Download URL eyas-0.1.0rc2.tar.gz
Size 225.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4671aa1c0199793d4f5d39c6568da5970b757e0b0ed0ac9e492235c7b33eeb10
BLAKE2b-256 checksum
How to use checksums
f7f2ad3c9fbe26d7d35f189a860c311c201be16f3c2591b05537e96ab24cce8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / eyas-0.1.0rc2-py3-none-any.whl

Download URL eyas-0.1.0rc2-py3-none-any.whl
Size 266.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b74ca45c4d0edebbdff56b318b8f298da4c202449b1e5fbef2219aa93b29509
BLAKE2b-256 checksum
How to use checksums
d80c3c7bf19231d8e720344b62334593d6305f511396d9c349b43f93fd34012d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for eyas 0.1.0rc2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for eyas-0.1.0rc2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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