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
- Make sure docker and docker compose plugin are installed:
sudo apt install docker-ce docker-compose-plugin
- install SymphonAI using pip
pip3 install git+https://github.com/svenschultze/symphonai
- (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
- Set up a new Project
mkdir myproject
cd myproject
sym setup
- Create new nodes sender and receiver in environment python3
sym create sender python3
sym create receiver python3
- 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;
}
- Build your environments
sym build
- 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)
- 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
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f564db0cdc6db0b958fd707ae735cd0d20ed665ae525450d86693a32762454c |
|
MD5 | 740d35c25c1e4f1e1f3566434daaf773 |
|
BLAKE2b-256 | dd07fc20b5b4c2dbb627f64f163356e4daed609be87bbcf7e5e2cce831562ccc |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8a3e3d2bf25fde2f6317c732165ea2dd6d6f34f450abd946741958111090380 |
|
MD5 | c4504fa0beeff16902b36de0c04be1a4 |
|
BLAKE2b-256 | e277a7dedb9068dadc488b083e7a77fa870250cde80ff1a69e06fdece34130ee |