moriarty
Moriarty is a set of components for building asynchronous inference cluster.
Relying on cloud vendors or self-built global queue services, asynchronous inference clusters can be built without exposing ports to the public.
Why asynchronous inference, why moriarty?
- Preventing client timeout.
- Avoid HTTP disconnection due to network or other issues.
- Reducing HTTP queries with queues.
- Deploy on Multi/Hybrid/Private cloud, even on bare metal.
Alternatives
This project came from my deep use of Asynchronous Inferenc for AWS Sagemaker, and as far as I know, only AWS and Aliyun provide asynchronous inference support.
For open source projects, there are many deployment solutions, but most of them are synchronous inference (based on HTTP or RPC).I don't find any alternative for async inference. Maybe Kubeflow pipeline can be used for asynchronous inference. But without serving support(Leave model in GPU as a service, not load per job), there is a significant overhead of GPU memory cache and model load time.
Architecture Overview
Key Components:
- Matrix: single producer, multiple consumers.
Connectoras producer, provide HTTP API for Backend Service and push invoke request to the global Job Queue.Operatoras consumer, pull tasks from the Job Queue and push them to local queue. Pulling or not depends on the load of inference cluster. And also,Operatorwill autoscale inference container if needed. - Endpoint: Deploy a function as an HTTP service.
- Sidecar: Proxy and transform queue message into HTTP request.
- Init: Init script for inference container
CLIs:
moriarty-matrix: Manager matrix componentsmoriarty-operator: Start the operator componentmoriarty-connector: Start the connector componentmoriarty-sidecar: Start the sidecar componentmoriarty-deploy: Requestoperator's API or database for deploy inference endpoint.
Install
pip install moriarty[matrix] for all components.
Or use docker image
docker pull wh1isper/moriarty or docker pull ghcr.io/wh1isper/moriarty
docker pull wh1isper/moriarty:devfor developing version
Develop
Install pre-commit before commit
pip install pre-commit
pre-commit install
Install package locally with test dependencies
pip install -e .[test]
Run tests with pytest
pytest -v tests/
Metadata
Release files for moriarty 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| moriarty-1.0.0.tar.gz | 190.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moriarty-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 253.6 kB
Release files / moriarty-1.0.0.tar.gz
| Download URL | moriarty-1.0.0.tar.gz |
|---|---|
| Size | 190.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bf0db6185781f80a54eaed1dcba3aab6a90520493cb4deb2e778b8112f409a8
|
|
BLAKE2b-256 checksum How to use checksums |
18d7004a9a4f085c079fb23386d2271b963ee898d2583014b9fbc8b97b41028b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / moriarty-1.0.0-py3-none-any.whl
| Download URL | moriarty-1.0.0-py3-none-any.whl |
|---|---|
| Size | 63.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b4cf11c4b82476b61b609debe282d79fcd8ab3c9cfef4f3478a23b0482176b9
|
|
BLAKE2b-256 checksum How to use checksums |
ee66d637c8624ae0b293863aba0d08abf4027d0401b491d7da8e454577ba5dfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for moriarty 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.