Skip to main content

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

Metadata

Release files for eyecan-shiva 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eyecan-shiva 0.6.0
File Size Uploaded
eyecan_shiva-0.6.0.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eyecan-shiva 0.6.0
File Interpreter ABI Platform
eyecan_shiva-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.5 kB

Release files / eyecan_shiva-0.6.0.tar.gz

Download URL eyecan_shiva-0.6.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dbb0509cfc6f721c6f773e7c4a037190a1e7c54091973a907fef9f25e0ecf720
BLAKE2b-256 checksum
How to use checksums
e9b7bb81cc75c1c8f0170e80602949a04fde66cc5cc648c0ff7e2cc5b0f0190f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / eyecan_shiva-0.6.0-py3-none-any.whl

Download URL eyecan_shiva-0.6.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a44aed07065c8fd8c193877bcbc10863efca51b493fb50c2953589dce560937
BLAKE2b-256 checksum
How to use checksums
84b3b169c1c81fa0367a63585f25482ba948d651622ed0ff1d6462ef2efcc63f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page