Sign inSign up

ogulcanaydogan/model-server

By ogulcanaydogan

Updated 7 months ago

Lightweight ML model serving (ONNX, PyTorch, scikit-learn)

Image
0

1.9K

ogulcanaydogan/model-server repository overview

Model Server

Lightweight ML model serving with ONNX, PyTorch, and scikit-learn support.

Quick Start

docker run -p 8080:8080 \
  -v $(pwd)/models:/models \
  ogulcanaydogan/model-server

# Run prediction
curl -X POST http://localhost:8080/api/predict \
  -H "Content-Type: application/json" \
  -d '{"input": [[1.0, 2.0, 3.0, 4.0]]}'

Supported Runtimes

  • ONNX (.onnx) — Default, CPU optimized
  • PyTorch (.pt, .pth) — Full PyTorch models
  • scikit-learn (.pkl, .joblib) — Traditional ML models

API Endpoints

POST /api/predict

Run inference on input data.

{"input": [[1.0, 2.0, 3.0, 4.0]]}

Response:

{
  "output": [[0.95, 0.05]],
  "latency_ms": 2.34,
  "model": "/models/model.onnx"
}
GET /api/info

Get model metadata and configuration.

GET /health

Health check.

GET /ready

Readiness check (returns 503 if model not loaded).

Environment Variables

VariableDescriptionDefault
PORTServer port8080
MODEL_PATHDirectory containing model files/models
MODEL_NAMESpecific model filenameAuto-detect
RUNTIMERuntime: onnx, pytorch, sklearnonnx
MAX_BATCH_SIZEMaximum batch size32
HOT_RELOADAuto-reload model on file changefalse
RELOAD_INTERVALReload check interval (seconds)60

Docker Compose Example

services:
  model-server:
    image: ogulcanaydogan/model-server
    ports:
      - "8080:8080"
    volumes:
      - ./models:/models
    environment:
      - RUNTIME=onnx
      - HOT_RELOAD=true

License

MIT

Tag summary

Content type

Image

Digest

sha256:90bb40558

Size

103.1 MB

Last updated

7 months ago

docker pull ogulcanaydogan/model-server