Skip to main content

gibbs

Scale your ML workers asynchronously across processes and machines

GitHub release Test status Lint status Coverage status Docs licence

Description • Install • Usage • FAQ • Contribute
Documentation

Description

gibbs is a python package that helps you scale your ML workers (or any python code) across processes and machines, asynchronously.

gibbs is :

  • ⚡️ Highly performant
  • 🔀 Asynchronous
  • 🐥 Easy-to-use

Install

Install gibbs by running :

pip install gibbs

Usage

After defining your awesome model :

import time

class MyAwesomeModel:
    def __init__(self, wait_time=0.25):
        super().__init__()
        self.w = wait_time

    def __call__(self, x):
        time.sleep(self.w)
        return x**2

You can simply start a few workers serving the model :

from gibbs import Worker

for _ in range(4):
    Worker(MyAwesomeModel).start()

And send requests through the Hub :

from gibbs import Hub

hub = Hub()

# In an async function
await hub.request(34)

And that's it !


Make sure to check the documentation for a more detailed explanation.

Or you can run some examples from the examples/ folder.

FAQ

❓ How gibbs works ?

gibbs simply run your model code in separate processes, and send requests to the right process to ensure requests are treated in parallel.

gibbs uses a modified form of the Paranoid Pirate Pattern from the zmq guide.

❓ Why the name "gibbs" ?

Joshamee Gibbs is the devoted first mate of Captain Jack Sparrow.
Since we are using the Paranoid Pirate Pattern, we needed a pirate name !

Contribute

To contribute, install the package locally, create your own branch, add your code (and tests, and documentation), and open a PR !

Pre-commit hooks

Pre-commit hooks are set to check the code added whenever you commit something.

If you never ran the hooks before, install it with :

pre-commit install

Then you can just try to commit your code. If you code does not meet the quality required by linters, it will not be committed. You can just fix your code and try to commit again !


You can manually run the pre-commit hooks with :

pre-commit run --all-files

Tests

When you contribute, you need to make sure all the unit-tests pass. You should also add tests if necessary !

You can run the tests with :

pytest

Pre-commit hooks will not run the tests, but it will automatically update the coverage badge !

Documentation

The documentation should be kept up-to-date. You can visualize the documentation locally by running :

mkdocs serve

Metadata

Release files for gibbs 0.2.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 gibbs 0.2.0
File Size Uploaded Provenance
gibbs-0.2.0.tar.gz 9.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gibbs 0.2.0
File Interpreter ABI Platform
gibbs-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / gibbs-0.2.0.tar.gz

Download URL gibbs-0.2.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8ea005c236fae74ab672f214fd396edf20694f921c1ce6691570f32289124fce
BLAKE2b-256 checksum
How to use checksums
a103a1408c4109273626a4031bbc0b833ae0eb1c70dcf0178fe61b0de710bf29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / gibbs-0.2.0-py3-none-any.whl

Download URL gibbs-0.2.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c53b4b20591a643a7ea108cb2d90de0134c9708b4ed2a31b07276e489788656f
BLAKE2b-256 checksum
How to use checksums
d4e168670f2f96d907a90646c1eb322dba70bae33fec5d3ce0b09320cb0a51f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for gibbs 0.2.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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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