Installation¶
Install the package¶
The milp-flare package is available on PyPI and can be installed with pip:
pip install milp-flare
Quickstart¶
This quickstart runs FLARE on a pair of formulations from the FormulationBench dataset (see Running FLARE on FormulationBench for more detail). It requires the following prerequisites:
Docker installed and the
flare-agentimage built (see Docker)Claude Code authentication key on the host (see Agent Harnesses)
FormulationBench Python package
formulation-bench(see FormulationBench)
from pathlib import Path
from formulation_bench import Dataset
from milp_flare import FLARE, FormulationInput, ParameterMapInput
from milp_flare.harness import ClaudeCodeHarness
ds = Dataset.load()
pair = ds.reformulations[0] # p1.a -> p1.b
a, b = pair.a, pair.b
harness = ClaudeCodeHarness(model="claude-opus-5", effort="medium")
flare = FLARE(harness=harness)
a_in = FormulationInput(
formulation_md=a.render_markdown(), solve_py=a.gen_solve_py()
)
b_in = FormulationInput(
formulation_md=b.render_markdown(), solve_py=b.gen_solve_py()
)
map_in = ParameterMapInput(
map_md=pair.parameter_map.render_markdown(), map_py=pair.gen_map_py()
)
result = flare.verify(a_in, b_in, map_in, output_path=Path("runs/p1_a_b"))
See the User Guides for end-to-end tutorials.