Kestrel for the NEOS Server

Kestrel is an interface to the NEOS Server that allows remote access to the solvers from a user's locally installed AMPL or GAMS modeling environment. It provides an easy mechanism for users to submit jobs to the NEOS solvers and receive the results within a local AMPL or GAMS modeling session.

Kestrel Solver Interface with AMPL

AMPL supports multiple usage modes for the Kestrel interface to the NEOS Server, allowing users to solve models remotely without installing solvers locally:

Using Kestrel in Python + AMPL (recommended)

To maximize the optimization workflow, we recommend using AMPL with Python. This combination pairs AMPL's modeling strengths with Python's data science ecosystem, creating our recommended standard for most applications.
# Install Python API for AMPL:
$ python -m pip install amplpy --upgrade

# Install AMPL & solver modules:
$ python -m amplpy.modules install gokestrel  # install Kestrel

# Activate your license (e.g., free https://ampl.com/start-free-now/):
$ python -m amplpy.modules activate <your-license-uuid>

How to use:

# Submit and solve a model on NEOS using Kestrel in Python (amplpy)
from amplpy import AMPL
ampl = AMPL()
  
# ... read/define model and data ...

# Select Kestrel (NEOS) and choose a remote solver
ampl.set_option("solver", "kestrel")
ampl.set_option("kestrel_options", "solver=cplex")

ampl.set_option("cplex_options", "outlev=2") # Optional: pass solver-specific options through Kestrel
ampl.set_option("email", "neos@ampl.com") # Optional: email notification from NEOS

ampl.solve() # Solve the problem

Using Kestrel in AMPL

# ... read/define model and data ...

ampl: option solver kestrel;  # Select Kestrel (NEOS) as the solver
ampl: option kestrel_options 'solver=cplex';  # Choose the remote solver on NEOS
ampl: option cplex_options 'outlev=2'; # Optional: solver-specific options (example for CPLEX)
ampl: option email "neos@ampl.com"; # Optional: NEOS email notification

ampl: solve;   # Solve the problem

Complete documentation — including installation, configuration, supported solvers, and AMPL/Python/API examples — is available at https://dev.ampl.com/solvers/kestrel/.


Guide to Installing and Using the Kestrel GAMS Client

Installing GAMS and Kestrel

To use Kestrel with GAMS, you need to have GAMS 24.8 or newer installed on your local computer. The Kestrel GAMS client is included in the standard GAMS distribution for all supported architectures. For Windows, the necessary Python modules have been packaged with the GAMS/Kestrel solver. For non-Windows, you only need Python version 2.5 or above to be installed on your machine. Starting with GAMS 32, the Kestrel GAMS client uses the Python installation that comes with GAMS so no additional Python installation is required on any platform.

Using Kestrel with GAMS

  1. Develop your model within the GAMS environment.
  2. Create an options file called kestrel.opt.
    • Specify the name of the solver and (optionally) the URL for the NEOS Server.
      	  kestrel_solver <solverName>
                neos_server <hostname>[:port>]
      Example:
      	  kestrel_solver conopt
      	  neos_server neos-server.org:3333
    • Include any solver specific options, e.g., rtmaxj=1e12;
    • Note: If you do not know what solvers are available via Kestrel, omit the solver name and submit the job. The list of enabled solvers will be returned.
    • Optional: Jobs can be submitted as an authenticated user by specifying your NEOS website login credentials:
      	  neos_username 'your_username'
      	  neos_user_password 'your_neos_password'
  3. To run your GAMS/Kestrel job on the command line, set option solver=kestrel and set optfile=1 before the solve statement. The Kestrel solver accepts all model types.
          $onEcho > kestrel.opt
          kestrel_solver conopt
          rtmaxj=1e12
          $offEcho
          option solver=kestrel; mymodel.optFile=1;
          solve mymodel using nlp min obj;
  4. If you are disconnected from the Kestrel server during your job execution, there are a couple of ways your results can still be retrieved:
    • Results for your job can be retrieved from the NEOS Server admin page using your <jobNumber> and <password>.
    • Authenticated job submissions can be accessed from NEOS Server - My Jobs page. Your most recent 200 jobs can be accessed without having to keep track of job numbers or job passwords. Note: this link requires an active log-in.