Skip to main content

Add your description here

Project description

ReMIP Server

This directory contains the ReMIP FastAPI server, which provides a RESTful API for solving Mixed-Integer Programming (MIP) problems.

Running the Server

To run the server, you need to have the dependencies installed (e.g., via uv pip install -e . from this directory). Then, you can start the server using the remip command:

uv run remip --host 0.0.0.0 --port 8000

The server will automatically find an open port if 8000 is in use, unless a specific port is provided.

API Endpoints

GET /solver-info

Returns information about the underlying MIP solver.

  • Method: GET
  • Success Response: 200 OK
  • Response Body Example:
    {
      "solver": "SCIP",
      "version": "x.y.z"
    }
    

POST /solve

Solves a MIP problem. It can return the solution directly or stream solver events using Server-Sent Events (SSE).

  • Method: POST
  • Query Parameters:
    • timeout (float, optional): Maximum time in seconds to allow the solver to run.
    • stream (string, optional): If set to sse, the server will stream solver events.
  • Request Body: A JSON object representing the MIPProblem.
  • Success Response: 200 OK

Request Body (MIPProblem)

The request body must be a JSON object with the following structure:

{
  "parameters": {
    "name": "MyProblem",
    "sense": 1,
    "status": 0,
    "sol_status": 0
  },
  "objective": {
    "name": "TotalProfit",
    "coefficients": [
      { "name": "x1", "value": 10 },
      { "name": "x2", "value": 15 }
    ]
  },
  "variables": [
    { "name": "x1", "cat": "Binary" },
    { "name": "x2", "cat": "Binary" }
  ],
  "constraints": [
    {
      "name": "ResourceA",
      "sense": -1,
      "coefficients": [
        { "name": "x1", "value": 2 },
        { "name": "x2", "value": 5 }
      ],
      "constant": 10
    }
  ],
  "solver_options": {
    "limits/time": 60
  }
}

Standard Response (MIPSolution)

If the stream parameter is not set, the response will be a JSON object with the solution:

{
  "name": "MyProblem",
  "status": "optimal",
  "objective_value": 25.0,
  "variables": {
    "x1": 1.0,
    "x2": 1.0
  }
}

Streaming Response (SSE)

If stream=sse is specified, the response will be a text/event-stream. The client will receive a sequence of events, such as log, metric, result, and end.

Example Event:

event: metric
data: {"timestamp":"...","objective_value":25.0,"gap":0.0,"iteration":10,"sequence":5}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

remip-0.3.3.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

remip-0.3.3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file remip-0.3.3.tar.gz.

File metadata

  • Download URL: remip-0.3.3.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for remip-0.3.3.tar.gz
Algorithm Hash digest
SHA256 8be90e677fb2a7b29f511a5043620d4ef8fb984299e9c503f7d6c0bed906622c
MD5 784ab1c53d219600ca45fe5d1700fda9
BLAKE2b-256 6ebe7fab1cac41adba2b70a3b76a09f7de5cf9ecea64a7ceaceb9671c2ad9845

See more details on using hashes here.

Provenance

The following attestation bundles were made for remip-0.3.3.tar.gz:

Publisher: release.yml on ohtaman/remip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file remip-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: remip-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for remip-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f595b5650afdbecf19cf6eb90114de196659ae01c22aa2808a3d775f04aad25e
MD5 9251a3041a3bf3711412c49b28f445d9
BLAKE2b-256 0341ba65bd0620ef44a6d0e47c9e7aecd2474edfeec03e3cba4c7725663580b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for remip-0.3.3-py3-none-any.whl:

Publisher: release.yml on ohtaman/remip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page