{"id":22116145,"url":"https://github.com/blacksujit/ml-deploy-lite","last_synced_at":"2026-03-01T04:35:36.716Z","repository":{"id":263980485,"uuid":"891982975","full_name":"Blacksujit/ML-Deploy-Lite","owner":"Blacksujit","description":"ml-deploy-lite is a Python library designed to simplify the deployment of machine learning models. It allows developers to quickly turn their models into REST APIs or gRPC services with minimal configuration. The library integrates seamlessly with Docker and Kubernetes, providing built-in monitoring and logging for performance and error tracking.","archived":false,"fork":false,"pushed_at":"2024-11-26T15:26:16.000Z","size":203,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-25T03:21:32.112Z","etag":null,"topics":["deployement-strategy","docker","kubernesties-deployement","kubernetes-deployment","ml-deployment","ml-deployment-developers-experiment","ml-if-git","mlops","my-library","own-library","python-3","python-lambda","python-library"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ml-deploy-lite/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blacksujit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-21T10:01:10.000Z","updated_at":"2024-11-26T15:26:48.000Z","dependencies_parsed_at":"2025-01-20T05:38:30.627Z","dependency_job_id":null,"html_url":"https://github.com/Blacksujit/ML-Deploy-Lite","commit_stats":null,"previous_names":["blacksujit/ml-deploy-lite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Blacksujit/ML-Deploy-Lite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksujit%2FML-Deploy-Lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksujit%2FML-Deploy-Lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksujit%2FML-Deploy-Lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksujit%2FML-Deploy-Lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blacksujit","download_url":"https://codeload.github.com/Blacksujit/ML-Deploy-Lite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacksujit%2FML-Deploy-Lite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29960253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployement-strategy","docker","kubernesties-deployement","kubernetes-deployment","ml-deployment","ml-deployment-developers-experiment","ml-if-git","mlops","my-library","own-library","python-3","python-lambda","python-library"],"created_at":"2024-12-01T12:19:32.926Z","updated_at":"2026-03-01T04:35:36.699Z","avatar_url":"https://github.com/Blacksujit.png","language":"Python","readme":"# ML-Deploy-Lite:\n\n\n`ml_deploy_lite` is a Python library designed to simplify the deployment of machine learning models. It was created to address the common challenges faced during the deployment process, such as the complexity of setting up REST APIs or gRPC services, the need for Docker and Kubernetes integration, and the lack of built-in monitoring and logging for performance and error tracking.\n\n\n## Table of Contents:\n\n- [Challenges in Deployments i have faced](#challenges-in-deployments-i-have-faced-)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Features](#features)\n- [Why `ml_deploy_lite`?](#why-ml-deploy-lite)\n- [Creating a Sample Model](#creating-a-sample-model)\n- [Docker Integration](#docker-integration)\n- [Kubernetes Integration](#kubernetes-integration)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Challenges in Deployments i have faced :\n\n- **Complexity**: Setting up REST APIs or gRPC services for machine learning models can be complex and time-consuming.\n\n- **Docker and Kubernetes Integration**: Integrating machine learning models with Docker and Kubernetes can be challenging, especially for developers new to these technologies.\n\n- **Monitoring and Logging**: Without built-in support for monitoring and logging, it can be difficult to track the performance of the deployed models and identify errors.\n\n## Why `ml_deploy_lite`?:\n\n`ml_deploy_lite` was created to simplify the deployment process for machine learning models. It provides a user-friendly interface for quickly converting models into REST APIs or gRPC services, automatically generates Dockerfiles for containerization, and simplifies the generation of Kubernetes deployment configurations. It also includes built-in support for monitoring performance and logging errors, making it easier for developers to track the performance of their deployed models.\n\n## Features\n\n- **Easy Deployment**: Quickly convert machine learning models into REST APIs.\n\n- **Docker Integration**: Automatically generate a Dockerfile for containerization.\n\n- **Kubernetes Support**: Generate Kubernetes deployment configurations easily.\n\n- **Monitoring and Logging**: Built-in support for monitoring performance and logging errors.\n\n- **User-Friendly**: Designed to be easy to use for developers of all skill levels.\n\n## Installation\n\nTo install `ml_deploy_lite`, you can use pip. Make sure you have Python 3.6 or higher installed.\n\n\n```\npip install ml_deploy_lite\n\n```\n\n## Usage\n\nHere’s a simple example of how to use `ml_deploy_lite` to deploy a machine learning model.\n\n1. **Import the Library**:\n\n```python\nfrom ml_deploy_lite import MLDeployLite\n```\n\n2. **Create an Instance**:\n\n```python\ndeployer = MLDeployLite('path/to/your/model.pkl')\n```\n\n3. **Run the API**:\n\n```python\ndeployer.run()\n```\n\n4. **Make Predictions**:\n\n\n## Test with curl: \n\n``Open a terminal and run the following command:``\n\n```\ncurl -X POST http://127.0.0.1:5000/predict \\\n-H \"Content-Type: application/json\" \\\n-d '{\"features\": [5.1, 3.5, 1.4, 0.2]}'\n\n```\n\n``You should see a JSON response like:``\n\n```\n{\n    \"prediction\": 0\n}\n\n```\n\n`OR`\n\n\nYou can make predictions by sending a POST request to the `/predict` endpoint with the following JSON body:\n\n```json\n{\n    \"features\": [5.1, 3.5, 1.4, 0.2]\n}\n```\n\n## Creating a Sample Model\n\nTo create a sample machine learning model, you can use the following script:\n\n```python\nimport joblib\nfrom sklearn.datasets import load_iris\nfrom sklearn.ensemble import RandomForestClassifier\n\n# Load dataset\niris = load_iris()\nX, y = iris.data, iris.target\n\n# Train a model\nmodel = RandomForestClassifier()\nmodel.fit(X, y)\n\n# Save the model\njoblib.dump(model, 'ml_deploy_lite/model/sample_model.pkl')\n```\n\nRun this script to generate a sample model that you can use with `ml_deploy_lite`.\n\n## Docker Integration\n\nTo create a Docker image for your application, you can use the provided `create_dockerfile` function in `ml_deploy_lite/docker.py`. This will generate a `Dockerfile` in the root directory of your project.\n\n1. **Generate the Dockerfile**:\n\n```python\nfrom ml_deploy_lite.docker import create_dockerfile\n\ncreate_dockerfile()\n```\n\n2. **Build the Docker Image**:\n\nRun the following command in the terminal:\n\n```bash\ndocker build -t your_docker_image:latest .\n```\n\n3. **Run the Docker Container**:\n\nAfter building the image, you can run the container with:\n\n```bash\ndocker run -p 5000:5000 your_docker_image:latest\n```\n\n## Kubernetes Integration\n\nTo create a Kubernetes deployment configuration, you can use the `create_k8s_deployment` function in `ml_deploy_lite/k8s.py`. This will generate a `k8s_deployment.yaml` file that you can apply to your Kubernetes cluster.\n\n1. **Generate the Kubernetes Deployment File**:\n\n```python\nfrom ml_deploy_lite.k8s import create_k8s_deployment\n\ncreate_k8s_deployment()\n```\n\n2. **Apply the Configuration**:\n\nRun the following command to deploy to your Kubernetes cluster:\n\n```bash\nkubectl apply -f k8s_deployment.yaml\n```\n\n## Testing\n\nTo run the tests for the API, you can use the following command:\n\n```bash\npython -m unittest discover -s tests\n```\n\nMake sure you have the necessary test data and models in place before running the tests.\n\n## Contributing\n\nContributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature-branch`).\n3. Make your changes and commit them (`git commit -m 'Add new feature'`).\n4. Push to the branch (`git push origin feature-branch`).\n5. Open a pull request.\n\n## License\n\nThis project is licensed under the MIT License. \n\n---\n\nFor more information, please refer to the [documentation](https://flask.palletsprojects.com/) for Flask and the [Docker SDK for Python](https://docker-py.readthedocs.io/en/stable/).\n\n---\n\n\n# Conclusion\n\nThis `README.md` file provides a comprehensive overview of your `ml_deploy_lite` library, including installation instructions, usage examples, and details on Docker and Kubernetes integration. It is structured to help users understand how to use the library effectively without encountering errors. Feel free to modify any sections to better fit your project's specifics or to add any additional information you think is necessary!\n \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksujit%2Fml-deploy-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacksujit%2Fml-deploy-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksujit%2Fml-deploy-lite/lists"}