PHPackages                             helgesverre/synapse - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. helgesverre/synapse

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

helgesverre/synapse
===================

A modern PHP library for LLM orchestration with executors, prompts, parsers, and tool calling

1.0.0(3mo ago)10MITPHPPHP ^8.2

Since Feb 4Pushed 2mo agoCompare

[ Source](https://github.com/HelgeSverre/synapse)[ Packagist](https://packagist.org/packages/helgesverre/synapse)[ RSS](/packages/helgesverre-synapse/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

Synapse
=======

[](#synapse)

A modern PHP 8.2+ library for LLM orchestration with executors, prompts, parsers, streaming, and tool calling. Inspired by [llm-exe](https://github.com/gregreindel/llm-exe).

Features
--------

[](#features)

- **Executor Pattern**: Composable execution pipeline with lifecycle hooks
- **Prompt System**: Template-based prompts with helpers, partials, and history
- **Parser System**: Extract structured data from LLM responses (JSON, boolean, lists, enums, code blocks)
- **Tool/Function Calling**: Built-in support for multi-step tool calling
- **State Management**: Conversation history and context tracking
- **Streaming**: Token streaming and streaming tool calls
- **Multi-Provider**: OpenAI, Anthropic, Google/Gemini, Mistral, xAI, Groq, Moonshot
- **Embeddings**: Unified embedding providers (OpenAI, Mistral, Jina, Cohere, Voyage)
- **Runtime Modules**: Trace bridge/exporters, checkpoints, memory store, workflow engine, and evaluation suite
- **Event Hooks**: Lifecycle events for logging, metrics, and debugging
- **PSR Standards**: PSR-4, PSR-7, PSR-17, PSR-18 compatible

Installation
------------

[](#installation)

```
composer require helgesverre/synapse
```

You'll also need an HTTP client (PSR-18) and HTTP factories (PSR-17). Synapse can auto-discover Guzzle or Symfony HTTP client if installed:

```
composer require guzzlehttp/guzzle
```

If you prefer Symfony:

```
composer require symfony/http-client
```

Quick Start
-----------

[](#quick-start)

```
