Download the PHP package helgesverre/synapse without Composer

On this page you can find all versions of the php package helgesverre/synapse. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package synapse

Synapse

A modern PHP 8.2+ library for LLM orchestration with executors, prompts, parsers, streaming, and tool calling. Inspired by llm-exe.

Features

Installation

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:

If you prefer Symfony:

Quick Start

If you want to configure transport manually:

Core Concepts

Executors

Executors are the core building blocks that orchestrate the LLM pipeline.

Prompts

Prompts use {{variable}} syntax for template replacement. Note: addUserMessage() defaults to parseTemplate: false, so pass parseTemplate: true when you want template rendering.

Template Features

Parsers

Extract structured data from LLM responses.

Tool/Function Calling

Use createToolRegistry() to register tools for function calling.

Streaming

Streaming requires a stream-capable transport (for example GuzzleStreamTransport).

See examples/streaming-cli.php and examples/streaming-chat-cli.php for full demos.

Example Index

Key examples to start with:

Production-oriented patterns:

State Management

Event Hooks

Embeddings

Providers

useLlm() supports the following provider prefixes:

You can set model either inline (prefix.model) or in options (['model' => '...']). Do not provide conflicting model values in both places.

OpenAI

Anthropic

Google (Gemini)

Mistral

xAI (Grok)

Groq

Moonshot

Ollama (local)

Run open-weights models locally — no API key required. Synapse uses Ollama's OpenAI-compatible endpoint at http://localhost:11434/v1.

Embeddings work the same way:

See examples/ollama-react-agent.php for a manual ReAct loop with tools running entirely against local Gemma.

Custom Provider

Implement LlmProviderInterface:

Architecture

Testing

Running Tests

Integration Tests

Integration tests require valid API keys set as environment variables:

Tests will automatically skip if the required API key is not set.

License

MIT


All versions of synapse with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package helgesverre/synapse contains the following files

Loading the files please wait ...