modelz-py with aiohttp
Basically, aioclient.py implements the async / aiohttp versions of Modelz*
classes,
and client.py wraps around them with asyncio.run()
calls.
This is the recommended installation method if you only want to use the CLI.
$ pipx install aiomodelz
$ pip install aiomodelz
$modelz --help
usage: modelz [-h] {inference,metrics,build} ...
modelz CLI
positional arguments:
{inference,metrics,build}
options:
-h, --help show this help message and exit
echo "cute cat" | modelz inference $PROJECT --serde msgpack --write-file cat.jpg --read-stdin
# use dotenv to load env
from dotenv import load_dotenv
load_dotenv()
# example .env:
# MODELZ_API_KEY=mzi-*****
# MODELZ_HOST=https://{}.cloud.modelz.dev/ # use this if you're using the dev modelz cluster
# MODELZ_SSL_VERIFY=0 # disable ssl verification
from modelz import AioModelzClient, ModelzClient
...
$ git clone https://github.com/tddschn/aiomodelz.git
$ cd aiomodelz
$ pdm install