API for the HiveMind's Machine Learning repository -> /kmadsdev/hivemind-ml.
- Language: Python
- Frameworks/Tools: FastAPI, Uvicorn, Boto3
- Deploy: AWS (EC2 + S3)
- FastAPI
- Boto3
- Uvicorn
- Pydantic
- Pathlib
- Datetime
Upload the latest machine learning model file to a Bucket on S3
Note: the default bucket name on the code is 'hivemind-ml-models', and can be changed on app.py by changing the BUCKET variable.
- Application OS: Amazon Linux (Prefered)
- Architecture: 64-bit Arm (Prefered)
- Intance type: t4g.small (or similar)
- Network settings / Check all these:
- Allow SSH traffic from Anywhere (0.0.0.0:0)
- Allow HTTP traffic from the internet
- Allow HTTPS traffic from the internet
- Inside EC2 (Amazon Linux)
- Install python, pip and git: 'sudo yum install -y python pip git'
- Install libs & requirements: 'pip install -r requirements.txt'
- Clones git repository: 'git clone '
- Check for updates: 'git pull'
- Run app 'python3 hivemind-ml-api/app.py'
On your EC2 instance go to Network & Security > Security Groups
Press actions menu then Edit inbound rules > Add rule:
- Type: Select the protocol (HTTP, HTTPS, Custom TCP, etc.)
- Port range: set the port to
8000 - Source:
0.0.0.0/0Then clickSave rules
EC2 >
Instances> On the list select your Instance (click on Instance ID) >Details>Instance summary>Public IPv4 address> Copy the address
Note: the url must be HTTP
Url: http://<ec2-public-host>:<ec2-port>/predict?inputs='<inputs-here>'
- Note: make sure you typed http, because it won't work if your try to use https
- Inputs must be in the python's
stringformat and be separated by commas (",") only
Example: http://1337.101.404:8000/predict?inputs='200,450,1,0,1,1,0,1,0.72418,271.48123'
Input list:
- int
- int
- int (0 or 1)
- int (0 or 1)
- int (0 or 1)
- int (0 or 1)
- int (0 or 1)
- int (0 or 1)
- float (between 0.00001 and 1)
- float (between 0 and 999.99999)
● 27 oct 2025 | New Machine Learning Model File | < Go to file >
• Size: 1.2KB
• Accuracy: 97.94%
● 23 oct 2025 | New Machine Learning Model File | < Go to file >
• Size: 756.3MB
• Accuracy: 97.72%