Shiva Communication Protocol
Project description
Shiva
Table of contents
Introduction
Message
The Shiva Message is a binary flow of the following chunks:
The protocol is based on a 'Send Message / Receive Message' flow. For each message sent from the client, the server will respond synchronously with another message. The format of the message is detailed in the following section, the content of the variable part of the message, i.e., tensors/metadata/namespace, is determined by the business logic and can be any data the application requires.
Chunks
Message chunks are made as follows:
:warning: All integers (uint32) in headers as well as tensors data are encoded in big endian during send and receive.
Magic Number & CRC
The magic number serves as a signal lock; it can be valuable in a byte streaming channel to indicate the start of a message. In the current implementation, the magic number is composed of 4 unsigned bytes: (6, 66, 11, 1).
The double CRC at the end of the header is useful for checking and validating the content of the header. Both CRCs are unsigned bytes, and their values are the sum modulo 256 of the preceding numbers. See python implementation for an example
Data
Metadata
The metadata is a generic JSON string.
Namespace (aka. Command)
The namespace is a generic string that can be used, for example, to route the message to the right handler.
Tensor
Each tensor can be a multi-dimensional array of any type. Hence, the tensor has a rank, a shape and a type. The rank is the number of dimensions, the shape is a list of integers, one per dimension, and the type is a string that can be one of the following map:
{
float16: 0,
float32: 1,
uint8: 3,
int8: 4,
uint16: 5,
int16: 6,
uint32: 7,
int32: 8,
uint64: 9,
int64: 10,
double: 11,
longdouble: 12,
longlong: 13,
complex64: 14,
complex128: 15,
bool: 17,
}
For example a (h,w,c) image of 8-bit unsigned integers will have a rank of 3, a shape of [h,w,c] and a type of 3 (uint8).
Examples
See Examples.
:whale2: Docker
To build the shiva image:
cd shiva/
docker build -f dockerfiles/Dockerfile -t shiva:latest .
To start a CLI session just run the provided compose:
docker compose -f dockerfiles/docker-compose.cli.yml run --service-ports --rm cli
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eyecan_shiva-0.6.0.tar.gz.
File metadata
- Download URL: eyecan_shiva-0.6.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbb0509cfc6f721c6f773e7c4a037190a1e7c54091973a907fef9f25e0ecf720
|
|
| MD5 |
0f19b4412052a82a272403faefe637e7
|
|
| BLAKE2b-256 |
e9b7bb81cc75c1c8f0170e80602949a04fde66cc5cc648c0ff7e2cc5b0f0190f
|
File details
Details for the file eyecan_shiva-0.6.0-py3-none-any.whl.
File metadata
- Download URL: eyecan_shiva-0.6.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a44aed07065c8fd8c193877bcbc10863efca51b493fb50c2953589dce560937
|
|
| MD5 |
f0c1d10d6defe688f7946417b73a9f38
|
|
| BLAKE2b-256 |
84b3b169c1c81fa0367a63585f25482ba948d651622ed0ff1d6462ef2efcc63f
|