Skip to main content

Serverless Posttraining for Agents - Core AI functionality and tracing

Project description

Synth

Python PyPI PyPI Dev License Coverage Tests

Serverless Posttraining APIs for Developers

Shows a bar chart comparing prompt optimization performance across Synth GEPA, Synth MIPRO, GEPA (lib), DSPy MIPRO, and DSPy GEPA with baseline vs optimized.

Average accuracy on LangProBe prompt optimization benchmarks.

Highlights

  • 🚀 Train across sft, RL, and prompt opt by standing up a single cloudflared Fastapi wrapper around your code. No production code churn.
  • ⚡️ Parallelize training and achieve 80% GPU util. via PipelineRL
  • 🗂️ Train prompts and models across multiple experiments
  • 🛠️ Spin up experiment queues and datastores locally for dev work
  • 🔩 Run serverless training via cli or programmatically
  • 🏢 Scales gpu-based model training to 64 H100s seemlessly
  • 💾 Use GEPA-calibrated verifiers for fast, accurate rubric scoring
  • 🖥️ Supports HTTP-based training across all programming languages
  • 🤖 CLI utilities tuned for use with Claude Code, Codex, Opencode

Getting Started

# Use with OpenAI Codex
uvx synth-ai codex
# Use with Opencode
uvx synth-ai opencode

Synth is maintained by devs behind the MIPROv2 prompt optimizer.

Documentation

docs.usesynth.ai

In-Process Runner (SDK)

Run GEPA/MIPRO/RL jobs against a tunneled task app without the CLI:

import asyncio
import os
from synth_ai.sdk.task import run_in_process_job

result = asyncio.run(
    run_in_process_job(
        job_type="prompt_learning",
        config_path="configs/style_matching_gepa.toml",
        task_app_path="task_apps/style_matching_task_app.py",
        overrides={"prompt_learning.gepa.rollout.budget": 4},
        backend_url=os.getenv("TARGET_BACKEND_BASE_URL"),  # resolves envs automatically
    )
)
print(result.job_id, result.status.get("status"))

Zero-Shot Verifiers (SDK)

Run a built-in verifier graph with rubric criteria passed at runtime:

import asyncio
import os
from synth_ai.sdk.graphs import VerifierClient

async def run_verifier():
    client = VerifierClient(
        base_url=os.environ["SYNTH_BACKEND_BASE"],
        api_key=os.environ["SYNTH_API_KEY"],
    )
    result = await client.evaluate(
        job_id="zero_shot_verifier_single",
        session_trace={"session_id": "s", "event_history": []},
        rubric={
            "event": [{"id": "accuracy", "weight": 1.0, "description": "Correctness"}],
            "outcome": [{"id": "task_completion", "weight": 1.0, "description": "Completed task"}],
        },
        options={"event": True, "outcome": True, "model": "gpt-5-nano"},
        policy_name="my_policy",
        task_app_id="my_task",
    )
    return result

asyncio.run(run_verifier())

You can also call arbitrary graphs directly:

from synth_ai.sdk.graphs import GraphCompletionsClient

client = GraphCompletionsClient(base_url="https://api.usesynth.ai", api_key="...")
resp = await client.run(
    graph={"kind": "zero_shot", "verifier_type": "zero_shot_verifier_mapreduce"},
    input_data={"session_trace": {"session_id": "s", "event_history": []}, "rubric": {"event": [], "outcome": []}},
)

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

synth_ai-0.4.1.tar.gz (719.3 kB view details)

Uploaded Source

Built Distribution

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

synth_ai-0.4.1-py3-none-any.whl (868.3 kB view details)

Uploaded Python 3

File details

Details for the file synth_ai-0.4.1.tar.gz.

File metadata

  • Download URL: synth_ai-0.4.1.tar.gz
  • Upload date:
  • Size: 719.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for synth_ai-0.4.1.tar.gz
Algorithm Hash digest
SHA256 183914482a6307c1c64b47a8ec8f55f5e1bb14e59888019eeefbe00dda8f806e
MD5 b5ae928be07200455a8bb802fd84d32e
BLAKE2b-256 463e248a796335fe6aae6f6d322b40111b4707dc4904936fa4fb93479fa12433

See more details on using hashes here.

File details

Details for the file synth_ai-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: synth_ai-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 868.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for synth_ai-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 463206b4c30c9e5df794808c757da5d30289277ae4852e56d20ee5f1ef0f7a05
MD5 69e7529cc8f53bf4230b9b3d467869ee
BLAKE2b-256 883785cf4dea0464c043f3b11e468e8d557cf654394e802e70595e4213f57710

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