Warning: The Autoscaler is currently in Beta, and is subject to changes, 'quirks', and downtime.
The https://run.vast.ai/route/ endpoint is called to get a worker to send a request to.
endpoint: The name of the endpoint group to use
api_key: The vast.ai api_key associated with the account that controls the endpoint group
cost: The estimated compute resources of the request.
url: The address of the worker instance to send the request to
reqnum: The request number corresponding to this worker instance. Note that the worker expects to recieve requests in roughly the same order as these reqnums, but there is flexibility on this due to potential out of order requests caused by concurrency, or small delays on the proxy server.
signature: The signature signed by the private key corresponding to the public key associated with the autoscaler, which is availble at https://run.vast.ai/pubkey/.
endpoint: same as input parameter to /route/
cost: same as input parameter to /route/
Here is an example of calling the route endpoint in python, and then calling generate on the returned worker:
Or here is an example of calling route with curl
For a more complete test example see the example test_LLM.py script here: https://github.com/vast-ai/vast-pyworker/blob/main/test_LLM.py
python3 test_LLM.py "https://run.vast.ai" API_KEY "Llama-2-70b-chat" "What is Deep Learning?" 1 --generate_stream