Skip to main content

Shared Synth container and environment runtime substrate

Project description

synth-containers

The task contract for Synth optimizers and evals — wrap any task as a small HTTP service that optimizers can target without touching your code.

PyPI · Optimizers · Cookbooks

A Synth container is a small HTTP service around a task. It owns the dataset, the scoring/verifier logic, the mutable prompt or policy fields, and the policy-model credential boundary. An optimizer like synth-optimizers GEPA sees one URL and a typed rollout contract — it never imports your task package or reads private evaluator state. The same contract works whether the task is a classifier, a coding agent, or a live game environment, and in Python, Rust, or TypeScript.

Install

pip install synth-containers
# or
uv add synth-containers

Latest daily dev build:

pip install --pre synth-containers==0.2.0.dev202605312141
uv add --prerelease allow synth-containers==0.2.0.dev202605312141

Local Better SDK Dev

This branch pair expects:

  • containers: package synth-containers==0.2.0.dev202605312141
  • optimizers: package synth-optimizers==0.2.0.dev202605312141

Install both editable checkouts with uv (sibling repos under your workspace):

cd optimizers
uv sync --group dev
uv pip install -e ../containers
uv pip install -e .

Verify import paths and versions:

uv run python -c "import importlib.metadata as m, synth_containers, synth_optimizers; print(synth_containers.__file__); print(m.version('synth-containers')); print(synth_optimizers.__version__)"

The SDK validation examples (Banking77, TBLite, Crafter, MiniGrid) live in local optimizers/dev_examples/ (gitignored — not shipped in the repo).

The contract

Route Method Purpose
/metadata GET contract version + capabilities
/program GET mutable prompt fields + seed candidate
/dataset GET split names + row counts
/dataset/rows POST rows for a requested seed list
/rollout POST run a candidate on a row → reward + usage
/health GET liveness

The Python SDK also provides Container, Container.serve(), ContainerHandle, and ContainerConnection for URL-only optimizer handoff. Use generic route hints and capability metadata here; optimizer-specific GEPA settings belong in synth-optimizers.

Example

from fastapi import Body, FastAPI
from synth_containers import GEPA_OPTIMIZER_CONTRACT_VERSION

app = FastAPI()

@app.post("/rollout")
def rollout(payload: dict = Body(...)) -> dict:
    candidate, row = payload["candidate"], payload["row"]
    # run the task with the candidate's mutable fields, score it with a real verifier
    return {"reward": ..., "usage": ...}

See the cookbooks for complete containers: Banking77, HotpotQA, MiniGrid, TBLite, and Crafter.

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synth_containers-0.2.0.20260604.tar.gz (64.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synth_containers-0.2.0.20260604-py3-none-any.whl (78.7 kB view details)

Uploaded Python 3

File details

Details for the file synth_containers-0.2.0.20260604.tar.gz.

File metadata

File hashes

Hashes for synth_containers-0.2.0.20260604.tar.gz
Algorithm Hash digest
SHA256 57c3f409315be8d85e549222f33f8cf5f18f6f985c65876458b21180f6974ed0
MD5 b62d21be6c559ffd51649df07501ed4f
BLAKE2b-256 29807fe92744f3ab529003d0fad1e0caf561ef9c00d26d70fd4040d72c50ff63

See more details on using hashes here.

File details

Details for the file synth_containers-0.2.0.20260604-py3-none-any.whl.

File metadata

File hashes

Hashes for synth_containers-0.2.0.20260604-py3-none-any.whl
Algorithm Hash digest
SHA256 9f347191078975a51b2b2433c6349ae23663fe97e9233529ab66d84dc9131488
MD5 8cdced348463817fd5182d4706c24eef
BLAKE2b-256 2f793c4831bc334cb24074f88c9e71dd241bcd85b12b5608e945ec0991fd37b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page