r/OperationsResearch • u/JowPereira • Feb 19 '26
Open-sourcing LOS: An algebraic modeling language for Python (alternative to AMPL/GAMS?)
Hi everyone,
I'm sharing a project I've been working on: LOS (Language for Optimization Specification).
It's an open-source algebraic modeling language (AML) that runs entirely in Python. The goal was to have the expressiveness of AMPL/GAMS but with the ease of deployment of a Python library.
Unlike Pyomo/PuLP where you define models imperatively in Python, LOS uses a declarative syntax that separates the model definition from the data implementation.
Key features for OR practitioners:
- Whiteboard-like syntax for constraints and objectives
- Separation of concerns (Model vs Data)
- Solves MILP/LP (via CBC, GLPK, Gurobi, or any PuLP-supported solver)
- Python API for data binding (
los.solve('model.los', data=df))
I'm looking for feedback from the OR community.
1
u/Sweet_Good6737 Feb 23 '26
What's your motivation to create such a tool?
1
u/Personal-Lack4170 Feb 20 '26
The whiteboard style syntax is interesting. Would love to see a side by side example vs Pyomo
1
u/Sweet_Good6737 Feb 23 '26 edited Feb 23 '26
Nice project! Modeling tools should follow this structure of separating model and data. Models in pyomo, pulp, gurobipy, etc are much harder to read than ampl-style tools like yours, that are straight to read (syntax is really close to ampl, omitting semicolon and changing the bracket type)
Import data from csv's that way is so cool
2
u/[deleted] Feb 19 '26
[removed] — view removed comment