Spin up a New Global Dispatcher
Prerequisites
Spinning up a new global dispatcher requires the following prerequisites:
- A machine which is reachable by all the workers in the network (visible ip address, and make sure all ports are open).
- The hardware requirement is not high, as the global dispatcher is only responsible for routing the requests to the workers. A machine with 2 CPU cores and 4GB memory should be sufficient (but more memory is preferred).
- Make sure you have
make
installed on your machine.
Install Open Compute Framework
Install by Downloading the Binary
- Download the binary from the release page. There are pre-built binaries for both
amd64
andarm64
architectures.
(Alternatively) Install by Building from Source
- To build from source, you need to have
go
(and we only tested withgo-1.22.5
) installed on your machine. Full installation guide can be found here. On Linux, you can installgo
by running the following command:
and verify the installation by
- Clone the repository:
It will automatically resolve the dependencies and build the binary. The binary will be generated in the bin/
directory.
Run the Global Dispatcher
Start the global dispatcher with the following command (under the directory where you have the binary):
It will start the global dispatcher on port 8092
and show the following output:
You can find your peer ID in the output. Remember to keep it as it will be used by the workers to connect to the global dispatcher.
Connect Workers to the Global Dispatcher
To connect the workers to the global dispatcher, you need to start the workers (on the worker node) with the following command:
Once connected, you can view all connected workers by visiting the following URL in your browser: http://
Next Steps
You have successfully spun up a new global dispatcher and connected workers to it. You can now start using the global dispatcher to route requests to the workers. For example, to use OpenAI-compatible APIs, you can setup the OpenAI Client as:
(triteia is an old name of a ML inference service, and it is used as an example here. You can replace it with the actual service name.)