Skip to content

API Reference

GoServe provides a REST API for model management and inference.

Server Information

GET /

Returns information about the server.

Response:

{
  "name": "GoServe",
  "version": "0.1.0-dev",
  "message": "Welcome to GoServe - Fast ML Model Server"
}

Health Checks

GET /health

Liveness check. Returns 200 OK if the server is running.

GET /ready

Readiness check. Returns 200 OK if the server is ready to accept requests.

Monitoring

GET /metrics

Exposes Prometheus metrics.

Response: Prometheus text format.

Model Management

GET /v1/models

Lists all loaded models.

Response:

{
  "models": [
    {
      "name": "fraud_detector",
      "path": "models/fraud_detector.onnx",
      "input_nodes": ["float_input"],
      "output_nodes": ["label", "probabilities"]
    }
  ]
}

POST /v1/models

Loads a new model.

Request Body:

{
  "name": "my_model",
  "path": "models/my_model.onnx"
}

Inference

POST /v1/models/{model_name}/infer

Executes inference using the specified model.

Current Limitation (WIP)

Currently, the inference engine is optimized for the Credit Card Fraud Detection model (XGBoost/ONNX). - Inputs: Expects a batch of 30 float32 features. - Outputs: Optimized for binary classification probabilities (batch x 2).

Work is in progress to support generic ONNX models with arbitrary input/output shapes and types.

Request Body:

{
  "inputs": [
    [1.0, 2.0, 3.0, ..., 30.0],
    [4.0, 5.0, 6.0, ..., 30.0]
  ]
}

Response:

{
  "model_name": "my_model",
  "predictions": [0, 1],
  "probabilities": [[0.9, 0.1], [0.2, 0.8]],
  "is_fraud": [false, true],
  "confidence": [0.1, 0.8]
}