quicopt
The Python client for the Quicopt optimization service. Author a model in a Python modeling front-end (Pyomo, OR-Tools MathOpt, or PuLP), convert it to Quicopt's wire IR, and emit the versioned, language-neutral bytes the service consumes.
Install
pip install quicopt # core (ir + wire) — standard library only
pip install "quicopt[pyomo]" # + the Pyomo front-end
pip install "quicopt[mathopt]" # + the OR-Tools MathOpt front-end
pip install "quicopt[pulp]" # + the PuLP front-end
From source (contributors), an editable install into a virtual environment:
python3 -m venv .venv && . .venv/bin/activate
pip install -e '.[pyomo,mathopt,pulp]'
Use
import pyomo.environ as pyo
from quicopt import Client
m = pyo.ConcreteModel()
m.x = pyo.Var(bounds=(0.1, 10))
m.obj = pyo.Objective(expr=m.x**2 + 1.0 / m.x, sense=pyo.minimize)
client = Client() # defaults to the free-tier Quicopt server
result = client.solve(m) # solve the model — the import to the
# wire IR happens inside
print(result.status, result.objective, result.solution)
print(result.display) # the service's ready-to-print summary
solve takes the model directly (Pyomo, OR-Tools MathOpt, or PuLP) and imports it
to the wire IR internally. The first keyless call mints an API key (client.api_key);
reuse it on later calls (Client(api_key=…)). Point Client(base_url=…) at another
server to override the default. For a long solve, client.submit(m) returns a job
handle to poll — job.result().
Tag a call with client.solve(m, project="my-project") to attribute it to a
project — handy when one key serves several projects. The modelling front-end
(Pyomo/MathOpt/PuLP) is recorded automatically.
If you need the wire bytes yourself (to inspect or send by another route), the front-end importers and encoder are still public:
from quicopt import encode
from quicopt.pyomo import import_model
payload = encode(import_model(m)) # Pyomo model → Program → versioned wire bytes
Layout
quicopt/ir.py the Program IR data model
quicopt/wire.py Program → versioned wire bytes (a stdlib-only encoder)
quicopt/pyomo.py Pyomo model → Program (a front-end)
quicopt/mathopt.py OR-Tools MathOpt model → Program (a front-end)
quicopt/pulp.py PuLP model → Program (a front-end)
quicopt/client.py POST the wire bytes to the service, read the result (HTTP, stdlib)
The IR and wire format are the client's contract with the service; wire.py
encodes that schema exactly. Each front-end is an independent module beside
pyomo.py (mathopt.py for OR-Tools authors, pulp.py for PuLP authors; further
modeling libraries slot in the same way), pulls in only its own optional extra, and
builds the IR through the canonical forms in _terms.py — so the same model reaches
the same wire whichever front-end authored it.
Test
The encoder is checked against committed golden byte vectors, with no dependencies:
python3 tests/test_wire_golden.py # or: pytest tests/
The front-ends are pinned to each other by byte equality: the same model authored in
Pyomo and in PuLP must encode to identical bytes, which carries the golden's
authority across (tests/test_frontend_equivalence.py; needs the [pyomo,pulp]
extras, skips without them).
Status
- ir + wire — stable; the encoder is byte-exact against what the service decodes.
- pyomo importer — affine / quadratic / nonlinear (
+ - * / ^ sin cos exp log sqrt abs), variable bounds (incl. unbounded) + integrality,==/<=/>=/ ranged constraints,min/max. A fixed variable pins to[val, val]; one fixed without a value raises rather than importing as free. - mathopt importer — OR-Tools MathOpt
ModelProto: linear / quadratic objective, linear constraints (incl. ranged and one-sided), variable bounds (incl. unbounded) + integrality,min/max. - pulp importer — PuLP
LpProblem: linear objective (with offset) and linear<=/==/>=constraints, variable bounds (incl. unbounded) + integrality,min/max. PuLP is linear by construction, so this is exactly LP / MILP; a problem with no objective is a feasibility problem (a constant0). - transport (HTTP) —
Client.solve/Client.submitover/v1/solveand/v1/jobs: wire bytes up, result JSON (status / objective / solution / frameddisplay) back; API-key minting on the first call, optional gzip. Standard library only.
License
Apache License 2.0 — see LICENSE. (c) 2026 Tim Bode, PGI-12, Forschungszentrum Jülich.
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 quicopt-0.3.0.tar.gz.
File metadata
- Download URL: quicopt-0.3.0.tar.gz
- Upload date:
- Size: 34.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1cc1c8f4e00f83f76fd545f2a0d0a0fd0c912e4153f64d920f462b45a63cbe9
|
|
| MD5 |
abd06a91497bed82549f9081d2faae77
|
|
| BLAKE2b-256 |
41fb6feb6417a2d5d6c16452a2234aaacc1618acf9a4f5f4fab030ccec1f4bbe
|
Provenance
The following attestation bundles were made for quicopt-0.3.0.tar.gz:
Publisher:
release.yml on timbode/quicopt-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quicopt-0.3.0.tar.gz -
Subject digest:
d1cc1c8f4e00f83f76fd545f2a0d0a0fd0c912e4153f64d920f462b45a63cbe9 - Sigstore transparency entry: 2217972884
- Sigstore integration time:
-
Permalink:
timbode/quicopt-python@81987f9eb4e8f27f6078a1a72fdcbf08560690ce -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/timbode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@81987f9eb4e8f27f6078a1a72fdcbf08560690ce -
Trigger Event:
release
-
Statement type:
File details
Details for the file quicopt-0.3.0-py3-none-any.whl.
File metadata
- Download URL: quicopt-0.3.0-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54a55b23a9ab4f2728a1c5664eed12d547b9353b189305b4559d23cbcd66c32a
|
|
| MD5 |
3bf04f560ebf66647f065760cc042da2
|
|
| BLAKE2b-256 |
47a06dbee324fc20de0716adc72066980ddc00bbdc562dfd955d5a0c3c04ac45
|
Provenance
The following attestation bundles were made for quicopt-0.3.0-py3-none-any.whl:
Publisher:
release.yml on timbode/quicopt-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quicopt-0.3.0-py3-none-any.whl -
Subject digest:
54a55b23a9ab4f2728a1c5664eed12d547b9353b189305b4559d23cbcd66c32a - Sigstore transparency entry: 2217973159
- Sigstore integration time:
-
Permalink:
timbode/quicopt-python@81987f9eb4e8f27f6078a1a72fdcbf08560690ce -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/timbode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@81987f9eb4e8f27f6078a1a72fdcbf08560690ce -
Trigger Event:
release
-
Statement type: