EZAI is a tool designed to manage and deploy machine learning models with ease. It uses Celery workers, SageMaker, and a structured relational database to facilitate efficient model management, allowing users to register and deploy models, track job statuses, and manage model endpoints.
Note: All the data are user generated content. Therefore you'll be shown an empty database upon hosting it.
- Python 3.9 or higher
- Redis and RabbitMQ for Celery
- AWS SageMaker with appropriate permissions
- PostgreSQL
- Docker (for containerization)
-
Clone the Repository:
git clone https://github.com/fishpain/ezai.git cd ezai
-
Environment Configuration:
- Copy the
.env.example
file to.env
:cp .env.example .env
- Update
.env
with your environment-specific variables, such asDATABASE_URI
,RABBITMQ_URI
, and AWS credentials for SageMaker.
Note: Email 2302705 at sit.singaporetech.edu.sg for env file.
- Copy the
-
Build Application, RabbitMQ, Database through:
cd hf_api/docker && docker compose -f docker-compose-local-x86.yml up -d
Note: Above command is to build for X86 platform, aka windows. To build on ARM achitechture, you have to edit the
requirements.txt
file and chooselibs/h5py-3.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
instead. Then build thedocker-compose-local-arm.yml
instead.
- Website URL available at
localhost:5051/
- Swagger API Available at
localhost:5051/v1/docs/
Application supports Chrome and Safari. Not IE.
- Users authenticate via a token-based system. Provide a valid token for operations that require user-specific access.
Note: Please enable cookie and javascript on your browser.
- Call the
/register
endpoint or use theregister_model_worker
task to register a new model with SageMaker. This will:- Create an entry in the
MLModel
table. - Register the model version in
ModelRegistryModel
. - Deploy the model to an endpoint on SageMaker.
- Create an entry in the
- Deploy registered models to SageMaker by triggering the
register_model_worker
task, which handles the creation and deployment to the appropriate endpoint.
- Monitor job statuses via
JobsModel
. The system automatically updates job statuses as tasks progress. - View contributions and model statistics via the
get_model_run_counts_with_details
function.
-
Database Connection Issues: Ensure that
DATABASE_URI
is correctly configured and that your database server is running. -
Celery Worker Not Responding:
- Verify that RabbitMQ and Redis are accessible.
- Check the worker logs for specific errors.
-
AWS SageMaker Permissions:
- Ensure your AWS role has sufficient permissions for deploying and managing models in SageMaker.
-
401 Unauthorized Error:
- Ensure you provide a valid JWT token in the
Authorization
header.
- Ensure you provide a valid JWT token in the
-
Database Access:
- Ensure that the worker user has restricted access to sensitive tables.
- Use separate database users for different parts of the system for fine-grained access control.
-
Token Management:
- Store the
SECRET_KEY
securely. - Rotate the JWT secret regularly for enhanced security.
- Store the
For further support, please contact the development team or refer to the official documentation on GitHub at GitHub Repository.