Documentation
deepctl cli tool
Contents
deepctl cli tool
deepctl is the official command line tool by DeepInfra. It is an advanced tool. You can use it to do many tasks without the need of additional dependecies or the web UI. You can also integrate it with other command line tools.
Let's start by installing the deepctl
command line tool.
curl https://deepinfra.com/get.sh | sh
You can also download deepctl from Releases.
You need a Github account to use deepctl. This command will open a Github Sign-on page in your browser.
deepctl auth login
DeepInfra requires an API token to access any of its APIs. You can view yours with
deepctl auth token
or in the dashboard.
Deployments of AI models are created automatically for you the first time you run an inference request. You can see all your deployments with
deepctl deploy list
Output:
[
{
"created_at": "2023-01-26T19:33:23",
"deploy_id": "DpM4BkrjEspUwmTa",
"fail_reason": "",
"model_name": "openai/whisper-small",
"status": "running",
"task": "automatic-speech-recognition",
"updated_at": "2023-01-26T19:33:23"
}
]
To see the logs for a particular deployment use its deploy_id
deepctl log -f DpM4BkrjEspUwmTa
Deleteing a deployment is trivial using its deploy_id
deepctl deploy delete DpM4BkrjEspUwmTa
You can always use
deepctl help
to view more information on any command.
deepctl version check
deepctl version update
You can use deepctl
to do inference. Below you can find a few basic examples. For more details and more examples
you should visit the API section of the models that you would like to run inference on.
Text generation with meta-llama/Meta-Llama-3-8B-Instruct
deepctl infer \
-m 'meta-llama/Meta-Llama-3-8B-Instruct' \
-i 'input="<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\nHello!<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"' \
-i 'stop=["<|eot_id|>"]'
Creating vector embeddings with BAAI/bge-large-en-v1.5
deepctl infer \
-m 'BAAI/bge-large-en-v1.5' \
-i 'inputs=["I like chocolate"]'
Image generation with stabilityai/stable-diffusion-2-1
deepctl infer \
-m 'stabilityai/stable-diffusion-2-1' \
-i 'prompt=A photo of a prince riding a horse on Mars.'
Image classification with google/vit-base-patch16-224
deepctl infer \
-m 'google/vit-base-patch16-224' \
-i image=@image.jpg