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: packagesynth-containers==0.2.0.dev202605312141optimizers: packagesynth-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
- Optimizers — GEPA on this contract
- Cookbooks — runnable containers
- Agent skill — drop into a coding agent to build and debug containers
- Contract OpenAPI
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synth_containers-0.2.0.dev202605312141.tar.gz.
File metadata
- Download URL: synth_containers-0.2.0.dev202605312141.tar.gz
- Upload date:
- Size: 64.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6397f7d2367dbe53f48a4603ab3add890e1c4eca52b4d894b2f967c0760c9dd5
|
|
| MD5 |
111ff764c45ea6b844ad18000da35607
|
|
| BLAKE2b-256 |
90e03eec07a8919e81a3739a8780e6e8df041bc01aeca4e425e3a67a59c88d6e
|
File details
Details for the file synth_containers-0.2.0.dev202605312141-py3-none-any.whl.
File metadata
- Download URL: synth_containers-0.2.0.dev202605312141-py3-none-any.whl
- Upload date:
- Size: 78.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
559acf296090f292dd6e0e7b26ff73511ac083e6837c934df69b2352f7d0822b
|
|
| MD5 |
8f52e93acc92072e922ff598421b41c0
|
|
| BLAKE2b-256 |
e35059f3bf99af16ed315eb39eba6e4baa07c400ff31f5a80072dffcf2b2c8ca
|