Add your description here
Project description
ReMIP Server
ReMIP (Remote Execution for Mixed-Integer Programming) server is a FastAPI-based web service for solving Mixed-Integer Programming (MIP) problems.
Overview
The ReMIP server directly integrates with the SCIP Optimization Suite and solves MIP problems through a RESTful API. It provides real-time logging functionality and streaming capabilities through Server-Sent Events (SSE).
Features
- RESTful API: Solve MIP problems through a clean and modern API.
- Real-time Logging: Stream solver logs in real-time to monitor progress.
- PySCIPOpt Integration: Directly integrates with the SCIP Optimization Suite through its Python API for better performance and stability.
- Containerized: Comes with a Docker setup for easy and consistent deployment.
Running the Server
To run the API server locally:
uv run remip
The API will be available at http://localhost:8000.
API Documentation
This README provides a high-level overview of the API. For a complete, interactive API specification, run the server and navigate to one of the following URLs:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
POST /solve
Solves a Mixed-Integer Programming problem.
Request Body:
The request body must be a JSON object representing the MIP problem, conforming to the MIPProblem model. This structure is typically generated by a compatible client library like remip-client (pulp.LpProblem.toDict())
Query Parameters:
timeout(float, optional): The maximum time in seconds that the solver is allowed to run. If the time limit is reached, the solver will be interrupted, and the best solution found so far will be returned with a"timelimit"status.stream(string, optional): If set tosse, the server will stream solver events (logs, metrics, and results) using Server-Sent Events. This is useful for monitoring long-running tasks.
Responses:
- Default (Non-streaming): Returns a single JSON object representing the final
MIPSolution. - Streaming (
stream=sse): Returns atext/event-streamresponse with a series of events.
Example curl Request:
# (Note: The --data payload is a simplified example)
curl -X POST "http://localhost:8000/solve?timeout=60" \
-H "Content-Type: application/json" \
--data '{
"parameters": {"name": "MyProblem", "sense": 1, "status": 0, "sol_status": 0},
"objective": {"coefficients": [{"name": "x", "value": 1}]}
"variables": [{"name": "x", "cat": "Integer", "lowBound": 0, "upBound": 5}],
"constraints": []
}'
GET /health
Checks the health of the server. Returns a simple true if the server is running.
Example curl Request:
curl http://localhost:8000/health
GET /solver-info
Returns information about the underlying optimization solver being used.
Example curl Request::
curl http://localhost:8000/solver-info
# Example Response: {"solver":"SCIP","version":"x.y.z"}
Prerequisites
- SCIP Optimization Suite: This project uses
pyscipopt, which requires a working installation of the SCIP Optimization Suite. You can download it from the official SCIP website. - Python 3.11+
- uv: A fast Python package installer
- Docker: For running the application in a container
Installation
-
Create a virtual environment:
uv venv -
Install the server and its dependencies:
# This command installs the server and test dependencies uv pip install -e .[test]
Testing
To run the test suite:
uv run pytest
Docker
To build and run the application using Docker:
docker-compose build
docker-compose up
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file remip-0.1.0.tar.gz.
File metadata
- Download URL: remip-0.1.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3945deb18cf6e88816ebe0b8545208937a398cc1e697ddc550096720fc1b1b6e
|
|
| MD5 |
c6236dff9e11d8481afd13639142b7a8
|
|
| BLAKE2b-256 |
2c6359fba16761a22a5fc71882f8cbe49f9a24b548e1eb6d8e095f98750212bc
|
File details
Details for the file remip-0.1.0-py3-none-any.whl.
File metadata
- Download URL: remip-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af78a8beddce7813526d38c7dd9b7b2c7c52da1147c6afe8144ed2a950d8f90d
|
|
| MD5 |
d71075d1cd757ad94d742751f1a9ffeb
|
|
| BLAKE2b-256 |
c119212eb599112cc40b977f528e1b8b0f729efb4ec706c7d6eaa8fbe14933bb
|