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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file symphonai-0.2.4.tar.gz.

File metadata

  • Download URL: symphonai-0.2.4.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for symphonai-0.2.4.tar.gz
Algorithm Hash digest
SHA256 8f564db0cdc6db0b958fd707ae735cd0d20ed665ae525450d86693a32762454c
MD5 740d35c25c1e4f1e1f3566434daaf773
BLAKE2b-256 dd07fc20b5b4c2dbb627f64f163356e4daed609be87bbcf7e5e2cce831562ccc

See more details on using hashes here.

File details

Details for the file symphonai-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: symphonai-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for symphonai-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a8a3e3d2bf25fde2f6317c732165ea2dd6d6f34f450abd946741958111090380
MD5 c4504fa0beeff16902b36de0c04be1a4
BLAKE2b-256 e277a7dedb9068dadc488b083e7a77fa870250cde80ff1a69e06fdece34130ee

See more details on using hashes here.

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