When ML + optimization first shook hands


Hello Reader!

Every Superhero Has an Origin Story

For GAMSPy’s machine learning superpowers, that story begins with a package called OMLT.

OMLT is short for Optimization and Machine Learning Toolkit. It’s a package that extends Pyomo to integrate machine learning models directly into optimization problems. Because OMLT supports ONNX interoperability, you can take a model trained in TensorFlow, Keras, or PyTorch and embed it into a Pyomo optimization model.

It also happens to be the package that inspired the GAMSPy developers to integrate ML support natively into GAMSPy.

At the same time, OMLT depends on the Pyomo ecosystem. That meant it carried some of Pyomo’s baggage—most notably, the lack of advanced sparsity exploitation. By making ML integration a native feature and combining it with GAMSPy’s solver-level strengths, it eliminated those fragilities. In a way, OMLT wrote the first chapter, but GAMSPy delivers the finished story.

When the Specific Application Feels Unclear

On paper, combining ML and optimization sounds amazing. Who wouldn’t want predictive power and optimal decisions in the same place?

But if you’ve ever actually tried, you’ll know the feeling: the idea is inspiring, but the specifics of “how” and "for what" quickly become blurry.

The Bridge Builders

That is why OMLT wasn’t born in a single eureka moment.
It grew slowly, almost casually, out of group conversations:
“what if we could bring these two worlds together?”

On one side were optimization researchers with their equations — structured, interpretable, rigorous.
On the other side, machine learning researchers had flexible models that could predict almost anything, but often as opaque black boxes.

Both were powerful, but they didn’t talk to each other.

So the group of authors of OMLT started experimenting. Step by step, those “what if” discussions turned into code. That code became OMLT: a bridge that let ML models live inside Pyomo optimization problems.

And it inspired a new generation of tools — among them some features of GAMSPy.

From Idea to Impact

So what did OMLT actually make possible? Here are a few striking examples:

  • Molecule discovery: Embedding ML predictors inside optimization models to search for molecules with specific odors, such as banana or garlic.
  • Sustainable solar panels: Minimizing water and energy consumption during PV panel production.
  • Smarter energy systems: Designing electrical microgrids that don’t just balance supply and demand, but also account for how big market players can influence price formation.

And on the more methodical side: OMLT made physics-informed neural networks far easier. Instead of forcing physical laws into the structure of a neural network, you simply state them as constraints in the optimization model. They’re enforced exactly, without approximation.

Where Would You Start?

OMLT was the prequel for GAMSPy. If you wrote the prequel for ML + optimization in your own work, what would it look like?

Until the next iteration!

Tim Varelmann

Bluebird Optimization

Complicated Decisions - Simply Automated!

Follow me on LinkedIn

P.S.: If you’re curious how ML + optimization could be combined in your field, that’s exactly the kind of development work I do for clients. Let's have a chat about it!

Bluebird Briefings

I write about my everyday life as optimization expert, where I translate business requirements to mathematical formulars, then to software -- and all the way back again.

Read more from Bluebird Briefings
uTim Varelmann celebrating his win at Gurobi's Tuning Challenge with an original Sachertorte

Hello Reader! Optimization is one of the most powerful technologies of our time — and yet, it rarely makes headlines. I'm currently returning from the Gurobi Summit 2025 in Vienna. Thus, this newsletter will be a little different: let’s start with three quotes worth highlighting from the event: My personal Top-3 of Quotes “Two years from now, spam will be solved.” – Bill Gates, 2004 This quote was shown at the Summit, alongside many others from world-class figures. And it stuck with me. Not...

Hello Reader! with wind and rain becoming ever-present, summer has officially given way to autumn. In this episode of Bluebird Briefings I'll give you a little summary of what happened in the world of optimization over the summer of 2025: Major Industry News Gurobi released the State of Mathematical Optimization 2025 report. It contains results from what's probably the biggest survey among optimization practitioners. The findings are impressive. They attest to the growth of optimization as...

Two hands typing on a keyboard

Hello Reader! Here is an intuitive description of the inner workings of 4 different approaches to solving optimization problems: 🔹 Heuristics: Fast & Practical A heuristic is a rule of thumb for decision-making. It doesn’t guarantee the best solution, but it’s often good enough. A strong heuristic has at least one of these qualities: ✅ It finds high-quality solutions quickly. ✅ It delivers decent results with minimal effort. Even if a heuristic fails often, it can still be valuable if it's...