- It simple: only Pymongo and Pydantic dependecies
- We develope machine learning models
- We use MongoDB in production
- We need light and fast framework to versioning models
- We use MongoMV
pip install https://github.com/averagepythonfan/mongomv/archive/main.zip
# docker-compose.yml
version: "3.3"
services:
mongodb:
image: mongo:latest
container_name: mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
ports:
- "27017:27017"
and then up mongodb container:
~$: docker compose up -d
>>> from mongoumv.client import MongoMVClient
>>> client = MongoMVClient("mongodb://root:secret@localhost:27017")
>>> exp = client.create_experiment(name="test_exp", tags=["test", "dev"])
>>> exp.id
... ObjectId('658432fe394f866bc0096605')
>>> md = client.create_model(name="test_md", tags=["test", "v0.1"])
>>> md.id
... ObjectId('6584339e394f866bc0096607')
>>> path = "your_serialized_model_path"
>>> md.dump_model(model_path=path, filename="your_model_filename")
... "Model successfully serialized"
>>> exp.add_model(md)
... "Model test_md successfully added to experiment"