redisai-py is the Python client for RedisAI. Checkout the documentation for API details and examples
- Install Redis 5.0 or above
- Install RedisAI
- Install the Python client
$ pip install redisai
- Install serialization-deserialization utility (optional)
$ pip install ml2rt
- Assuming you have virtualenv installed, create a virtualenv to manage your python dependencies, and activate it.
`virtualenv -v venv; source venv/bin/activate`
- Install [pypoetry](https://python-poetry.org/) to manage your dependencies.
`pip install poetry`
- Install dependencies.
`poetry install --no-root`
[tox](https://tox.readthedocs.io/en/latest/) runs all tests as its default target. Running tox by itself will run unit tests. Ensure you have a running redis, with the module loaded.
Contributing
Prior to submitting a pull request, please ensure you've built and installed poetry as above. Then:
- Run the linter.
`tox -e linters.`
- Run the unit tests. This assumes you have a redis server running, with the [RedisAI module](https://redisai.io) already loaded. If you don't, you may want to install a [docker build](https://hub.docker.com/r/redislabs/redisai/tags).
`tox -e tests`
RedisAI example repo shows few examples made using redisai-py under python_client folder. Also, checkout ml2rt for convenient functions those might help in converting models (sparkml, sklearn, xgboost to ONNX), serializing models to disk, loading it back to redisai-py etc.