ampl

Guide AMPL and amplpy optimization answers with environment detection and response modes.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Mihailby/amplskills --skill ampl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ampl
Source: https://github.com/Mihailby/amplskills/tree/main/skills
Command: npx skills add https://github.com/Mihailby/amplskills --skill ampl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents vague or error-prone AMPL guidance by enforcing consistent environment detection, response modes, and formulation standards while grounding answers in AMPL documentation chunks.

Core Features & Use Cases

  • Conversation setup & routing: Detects Pure AMPL vs amplpy/Jupyter vs Python scripts and selects the correct code/output style.
  • Response-mode control: Switches between Full Build, Debug, Explanation, Refactor, Performance, and Data modes based on user intent and whether code exists.
  • Optimization-quality guardrails: Enforces native AMPL constructs (e.g., abs/min/max/PWL/logical operators) to avoid manual linearizations and weak big-M formulations.
  • amplpy-safe data handling: Directs users to load data via Python/pandas (and explicitly avoids AMPL data; blocks in amplpy).
  • Solver selection guidance: Recommends appropriate solvers per problem class (LP/MIP/NLP/MINLP/conic/global/VRP) with tuning and diagnosis hints.

Quick Start

Ask your question naturally, for example: "In Jupyter, help me debug an infeasible AMPL model and refactor the formulation to improve numerical stability."

Frequently Asked Questions about ampl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug an infeasible AMPL optimization model in Jupyter?

To debug an infeasible AMPL optimization model in Jupyter, you switch to Debug response mode to identify constraint conflicts and refactor the formulation to improve numerical stability using amplpy environment rules.

What is the best way to load data into amplpy using Python and pandas?

The best way to load data into amplpy is by using Python and pandas directly, explicitly avoiding AMPL `data;` blocks to maintain native script compatibility and prevent data-loading errors.

How do I avoid manual linearization when formulating AMPL models?

To avoid manual linearization in AMPL models, use native AMPL constructs such as abs, min, max, piecewise linear, and logical operators to prevent weak big-M formulations and improve solver performance.

How do I select the right solver for my AMPL optimization problem?

Solver selection for AMPL optimization problems depends on the problem class, matching specific solvers to LP, MIP, NLP, MINLP, conic, global, or VRP categories while applying tuning and diagnosis hints.

Can I use AMPL with Python scripts outside of Jupyter?

Yes, you can use AMPL with Python scripts outside of Jupyter, as the environment detection mechanism routes responses for Pure AMPL, amplpy in Jupyter, and standard Python-script workflows separately.

What response modes are available for building and refactoring AMPL models?

Response modes for building and refactoring AMPL models include Full Build, Debug, Explanation, Refactor, Performance, and Data modes, which switch dynamically based on user intent and existing code presence.