Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· openaiHugging Face Suzhen/CodeChat

Give complete solution for the below project stepwise Project: AI Toolchain is a…

  1. User

    Give complete solution for the below project stepwise Project: AI Toolchain is a collection of tools for quickly building and deploying machine learning models for various use cases. Currently, the toolchain includes a text translation model, and more models may be added in the future. It abstracts the dirty details of how a model works similar to Huggingface and gives a clean API that you can orchestrate at aenter code here BFF level.

    Features to be implemented Abstract the layer of deployment for AI Tools. Anyone should be easily add a new model to the stack without thinking about deployments. We should be able to deploy AI Tools in such a way where each model (every model can be packaged as a container) should be independently scalable. As a user, I should be able to access APIs associated with any model.

    Product Set Up https://github.com/Samagra-Development/ai-tools#setup

    Github Information: ReadME: AI Toolchain AI Toolchain is a collection of tools for quickly building and deploying machine learning models for various use cases. Currently, the toolchain includes a text translation model, and more models may be added in the future.

    How to Run To deploy all models, simply execute the deploy.sh script located in the root folder. This script calls the deployment files of each model. Note that the toolchain may switch to using Docker in the future for deployment.

    To create a new model class, use the template_batch_model.py file as a starting point. Your new model class should implement the method mentioned in the template file.

    To create a new request class, use the template_model_request.py file as a starting point. This class is used to map the incoming request to the data needed by the model.

    To add your new model and request to the API, modify the repository dictionary in api.py.

    Repository The repository is structured as follows

    Setup To set up the AI Toolchain environment, follow these steps:

    python3 -m venv venv source venv/bin/activate pip install poetry poetry install quart --app api --debug run Poetry Fixes poetry lock --no-update Contributing Contributions to AI Toolchain are welcome! To contribute, please follow these guidelines:

    Fork the repository and create a new branch for your feature or bug fix. Write tests for your changes. Submit a pull request describing your changes and why they are needed. Thank you for considering contributing to AI Toolchain!

    Files: .github/workflows Lower case repo name for GH Packages 2 months ago benchmarks Fix add test 3 weeks ago flake8 Fix: module/folder names 2 months ago src Merge pull request #100 from rishav-eulb/rishav-eulb-patch-2 last week .flake8 Fixes: #29 2 months ago .gitignore Initial Commit 2 months ago .gitpod.Dockerfile Included installation of Git last week .gitpod.yml Corrected .gitpod.yml last week Dockerfile Added Gitpod last week README.md docs: readme updated last month api.py Moved restart and watch functions to separate file last week contribution.md Corrected Gitpod button last week deploy.sh deploy.sh_error last month docker-compose.yml Added Gitpod last week poetry.lock Feat: Reload debug server on changes to src folder last week prometheus.yml add prometheus.yml 2 weeks ago pyproject.toml Feat: Reload debug server on changes to src folder last week repository_data.json Feat: Azure translation 3 weeks ago sample.env Fix: Add sample env 2 months ago template_batch_model.py added repo structure and translation model 2 months ago template_model_request.py added repo structure and translation model 2 months ago test.py Fix add test 3 weeks ago watch_folder.py Moved restart and watch functions to separate file last week

  2. Assistant

    Step 1: Set up your development environment

    1. Install Python 3.8 or higher on your system.
    2. Install Git, Docker, and Docker Compose.

    Step 2: Clone the AI Toolchain repository

    1. Fork the AI Toolchain repository on Github.
    2. Clone your forked repository to your local machine.

    Step 3: Set up the virtual environment and install required dependencies

    1. Open your terminal, change to the project directory, and run the following commands:
    python3 -m venv venv
    source venv/bin/activate
    pip install poetry
    poetry install
    

    This will set up a virtual environment, activate it, and install the required dependencies using Poetry.

    Step 4: Add your machine learning model

    1. Create a new model class based on the template_batch_model.py file.
    2. Ensure your new model class implements the method mentioned in the template file.
    3. Create a new request class based on the template_model_request.py file.
    4. This class will map the incoming request to the data needed by the model.

    Step 5: Create deployment scripts and package your model as a container

    1. Create a Dockerfile for your model, specifying its dependencies, and exposing the desired API ports.
    2. Modify the docker-compose.yml file to include the container for your new model.
    3. Create a deployment script for your model, similar to deploy.sh provided in the repository.

    Step 6: Modify the API to include your new model

    1. Update the repository dictionary in api.py to include your new model and request class.
    2. Double-check that your model's API has been successfully added and is accessible to users.

    Step 7: Deploy your ML model

    1. Run the deploy.sh script to deploy your model(s) along with the existing models using Docker:
    ./deploy.sh
    
    1. The script will deploy all the models and create a clean API for each model.
    2. Independently scale your models by modifying the container settings inside the docker-compose.yml file.

    Step 8: Test your new model and API

    1. Use Postman or similar tools to send requests to your new model's API and verify if it's working correctly.
    2. Perform extensive testing to ensure your model behaves as expected.

    Step 9: Contribute your changes back to the main repository

    1. Write tests for your changes and add them to the test.py file.
    2. Submit a pull request describing your changes and why they are needed.
    3. Your contribution will be reviewed and merged by the project maintainers if approved.