Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

Synapse — The AI Application Runtime

pip install synapse-runtime

Not a framework. Not a wrapper. The missing AI layer for your Python stack.

30-Second Demo

from synapse import agent, tool, workflow, step

@tool
def search_web(query: str) -> list[str]:
    """Search the web. Returns top results."""
    ...  # your implementation

@agent(model='gpt-4o', fallback='ollama/llama3')
async def researcher(topic: str) -> str: ...

@agent(model='claude-3-5-sonnet')
async def writer(content: str) -> str: ...

# Chain agents with >>
pipeline = researcher >> writer
result   = await pipeline.run('AI application runtimes')

That's it. No subclassing. No boilerplate. No JSON schema by hand.


The Four Primitives (v0.1)

@tool — Auto-generated schemas

@tool
def send_email(to: str, subject: str, body: str = '') -> bool:
    """Send an email. Returns True on success."""
    ...

Synapse reads the type annotations and docstring. The JSON schema is generated automatically — no BaseTool, no {type: "function", function: {…}} by hand.

Pass tools explicitly to the agents that need them:

@agent(model='gpt-4o', tools=[search_web])   # only this agent can call search_web
async def researcher(topic: str) -> str: ...

@agent(model='gpt-4o')                        # clean — no tools injected
async def writer(draft: str) -> str: ...

Each agent only receives the schemas you declare. No global bleed between agents.

@agent — Any model, same API

@agent(model='gpt-4o')                  # OpenAI
@agent(model='claude-3-5-sonnet')       # Anthropic
@agent(model='gemini/gemini-pro')       # Google
@agent(model='ollama/llama3')           # Local (free)

Powered by litellm — 100+ providers, one decorator.

Add guardrails:

@agent(
    model='gpt-4o',
    fallback='ollama/llama3',
    must_not=['PII', 'speculation'],
    token_budget=2000,
)
async def safe_agent(prompt: str) -> str: ...

>> — Readable pipelines

pipeline = researcher >> writer >> reviewer
result   = await pipeline.run(topic='climate change')

LangGraph needs nodes and edges. Synapse uses >>.

@workflow + step() — Composable pipelines

@workflow
async def research_pipeline(topic: str) -> str:
    data  = await step(researcher, topic)
    draft = await step(writer, data)
    return await step(reviewer, draft)

Zero-Cost Testing

from synapse import MockLLM

def test_my_agent():
    with MockLLM("expected response") as mock:
        result = await my_agent("prompt")
    assert result == "expected response"
    assert mock.call_count == 1

MockLLM patches litellm. No API calls. No tokens spent.


Synapse vs the alternatives

Feature Synapse LangChain OpenAI SDK LangGraph
Any LLM provider ✅ ✅ ❌ OpenAI only ✅
Schema from annotations ✅ ❌ manual ❌ manual ❌ manual
>> chaining ✅ ❌ verbose ❌ ❌
Built-in guardrails ✅ ⚠️ external ❌ ❌
Readable 3-line agent ✅ ❌ subclass ❌ ❌
MockLLM for tests ✅ ❌ ❌ ❌

Roadmap

Version Name Ships
v0.1 The Tiny Core @agent, @tool, >>, MockLLM ← you are here
v0.3 Useful Projects Memory API, streaming, prompt templates, CLI
v0.5 AI Runtime Workflow engine, checkpointing, observability, guardrails
v0.8 Synapse Identity Prompt debugger, multi-agent graphs, human-in-the-loop
v1.0 Production Multi-tenancy, audit trail, intent routing

Install

pip install synapse-runtime

# For local LLM (free, no API key needed):
# Install Ollama → https://ollama.ai
ollama pull llama3

MIT License · Built in public · Issues welcome

Metadata

Release files for synapse-runtime 0.1.1

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

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for synapse-runtime 0.1.1
File Size Uploaded Provenance Actions
synapse_runtime-0.1.1.tar.gz 15.2 kB Without provenance Details for synapse_runtime-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for synapse-runtime 0.1.1
File Interpreter ABI Platform Actions
synapse_runtime-0.1.1-py3-none-any.whl Python 3 none any Details for synapse_runtime-0.1.1-py3-none-any.whl

Total release size: 29.0 kB

Release files / synapse_runtime-0.1.1.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL synapse_runtime-0.1.1.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a5b3bf5a274277c1f19c9702724da9df68121355170288edb6df8d8bdc6a94e8
BLAKE2b-256 checksum
How to use checksums
ddcf257a2a3ccaacac1b2658e96ce63b05a55b7de256ee964faa828e0c6213ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / synapse_runtime-0.1.1-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL synapse_runtime-0.1.1-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c13876776be88b8522de54deecd53ad4e4a3bb8911accff8d1d7cbf601444d1
BLAKE2b-256 checksum
How to use checksums
7a9fd8c57af4949286a1147681f6987786fcb83bf2bb8164646093e199559d96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for synapse-runtime 0.1.1

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.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.1.0 2 files With provenance
  • Added 0.1.1 2 files Without provenance

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Loss of provenance

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