A web service that converts TensorFlow SavedModel files to TensorFlow.js format. Built for Windows users who cannot directly use tensorflowjs_converter, and designed as an asynchronous microservices architecture using RabbitMQ.
Upload a .zip containing your TensorFlow SavedModel, and the service will convert it and provide a downloadable TensorFlow.js graph model.
User ──▶ Frontend (Nginx) ──▶ API (Flask) ──▶ RabbitMQ ──▶ Consumer ──▶ convert.sh
│ │
└──────── MongoDB ◀──────────────────────┘
| Service | Description |
|---|---|
| Frontend | Nginx-served static page for uploading models and downloading results |
| API | Flask REST API handling uploads, status queries, and file downloads |
| Consumer | Background worker that picks jobs from RabbitMQ and runs the conversion |
| RabbitMQ | Message broker decoupling uploads from processing |
| MongoDB | Stores conversion status and model metadata |
| Method | Endpoint | Description |
|---|---|---|
POST |
/upload |
Upload a .zip file containing a TensorFlow SavedModel. Returns a model_id. |
GET |
/status?model_id=<id> |
Check conversion status. Returns status: 0 (success) or status: 1 (failure). |
GET |
/get_model?model_id=<id> |
Download the converted model as a .tar.gz archive. |
docker build -t tfjs-api:latest -f api/Dockerfile api/
docker build -t tfjs-frontend:latest -f page/Dockerfile page/docker-compose up| Service | URL |
|---|---|
| Frontend | http://localhost:5001 |
| API | http://localhost:5000 |
| Mongo Express | http://localhost:8080 |
docker-compose -f docker-compose-dev.yaml upDevelopment mode additionally exposes RabbitMQ management (port 15672) and a Jupyter Lab instance (port 4999).
- Open the frontend at http://localhost:5001.
- Select a
.zipfile containing a TensorFlow SavedModel (must include.pbfiles and avariables/folder). - Click Upload and Convert.
- Wait for the conversion to complete — the page polls automatically.
- Click Download to get the converted TensorFlow.js model as a
.tar.gzarchive.
All service configuration lives in api/configuration.yaml:
| Setting | Default | Description |
|---|---|---|
| RabbitMQ host | rabbitmq |
Docker service hostname |
| MongoDB host | mongodb |
Docker service hostname |
| MongoDB database | tf2tfjs |
Database name |
| API port | 5000 |
Flask/Gunicorn listen port |
- Backend: Python 3.10, Flask, Gunicorn, Pika, PyMongo
- Conversion:
tensorflowjs_converter(tf_saved_model → tfjs_graph_model) - Frontend: HTML, CSS, JavaScript, Nginx
- Infrastructure: Docker, Docker Compose, RabbitMQ, MongoDB