Environment Variables
HF_TOKEN(string): HuggingFace API token with read permissions, used to download gated models. Read more about HuggingFace tokens here.MODEL_ID(string): ID of the model to be used for inference. Supported HuggingFace models are shown here.
Install the Vast.ai SDK
Ensure you have thevastai pip package installed
Ensure API key is set
Configure the environment variableVAST_API_KEY to contain your Vast.ai Serverless API key
Using /generate/
Python
Using /generate_stream/
Python