optlens

What you can ask

Each question below maps to a tool. In Python the tool is a Session method. The MCP server (optlens-mcp, 24 tools) and the Claude Code plugin have the same tools. Ask in your own words, and the agent picks the tools.

Questions and tools

you want to know for example tools
what the model is and means "What does this model decide, and what limits it?" get_model_overview, query_constraints, query_variables, read_model_document, save_model_context
why it is infeasible "Why is plan.mps infeasible? Prove it." compute_iis, infeasibility_proof (on request: the checked sum), feasibility_relaxation, drop_test
what fixes it "What is the smallest change that makes it solve? Is an input mistyped?" fix_menu, suspicious_values (each flag's undo solved)
what happens if... "What if the budget drops by 10 %?" modify_and_resolve, try_options, version_history
how two plans differ "What changed between the old plan and this one?" compare_versions (against the closest optimal plan)
what a limit is worth, how far it can go "What is one more hour of capacity worth? How high can demand go?" marginal_value, sensitivity_report, attainable_limit
whether a better plan exists "Could any plan do better? Prove this one is the best." optimality_proof (on request: the checked bound and what holds the plan there)
why the plan doesn't do X "Why doesn't the plan use the second warehouse?" why_not
how several models or scenarios compare "Which of these three scenarios costs least?" open_model, add_model, compare_models
anything else, in code "Rank every capacity limit by what relaxing it would save." run_python (optlens preloaded as session)

Models

Solvers

solver solves notes
HiGHS LP, MILP, convex QP comes with optlens; the default; IIS for LPs
SCIP LP, MILP, QP and MIQP, convex or not the scip extra; IIS for MIPs; runs the steps HiGHS cannot do, and the result says so
Gurobi LP, MILP, QP and MIQP, convex or not your own license; tested on small models and on one large one (a 279k-row hotel model); IIS for LPs and MIPs

Solvers in the README explains how optlens picks a solver. It also covers why a Gurobi session stays on Gurobi, the hard time limits and how optlens checks an IIS.

Limits

How these were measured: the benchmark →

← Back to optlens