Skip to main content

A tool to build and run docker images together

Project description

SymphonAI

SymphonAI is a container intercommunication framework based on gRPC and docker compose that makes it easy to orchestrate AI pipelines or complex structures of multi-agent systems.

Installation

  1. Make sure docker and docker compose plugin are installed:
sudo apt install docker-ce docker-compose-plugin
  1. install SymphonAI using pip
pip3 install git+https://github.com/svenschultze/symphonai
  1. (OPTIONAL) You may need to add ~/.local/bin to you path by adding this line to your ~/.bashrc and restarting your shell
export PATH="$HOME/.local/bin:$PATH"

Usage

  1. Set up a new Project
mkdir myproject
cd myproject
sym setup
  1. Create new nodes sender and receiver in environment python3
sym create sender python3
sym create receiver python3
  1. Define the open procedures using the gRPC protobuffer format for each node. Only the node where the procedure is served needs to have to corresponding proto file.

myproject/src/receiver/proto/receive.proto

syntax = "proto3";

service Hello {
  // Sends a greeting
  rpc SayHello (HelloRequest) returns (HelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}
  1. Build your environments
sym build
  1. Now, setup the method and call in the node.py files:

myproject/src/receiver/node.py

import sym

@sym.method("Hello")
def SayHello(name):
    print("Received hello from", name)
    return {
        "message": f"Hello {name}!"
    }

sym.serve()

myproject/src/sender/node.py

import sym
import time

SayHello = sym.call("receiver", "Hello", "SayHello")

while True:
  time.sleep(1)
  result = SayHello(name="Sender")
  print(result)
  1. Start your system
sym run

Generating Documentation

To generate documentation for all .proto files, run:

sym docs

This will create documentation html files in mypackage/docs/nodename

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

symphonai-0.2.4.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

symphonai-0.2.4-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page