# Savanty > Savanty is a natural-language to constraint solver from Skelf Research. Describe a discrete > constraint problem in English; a DSPy-orchestrated LLM (GPT-4o by default, or any > OpenAI-compatible endpoint including Ollama Cloud) translates it into Answer Set Programming > over a canonical assign(Var, Value) contract, and the Clingo solver searches exhaustively for a > valid answer set — or proves none exists. A typed self-repair loop handles syntax_error, unsat, > and empty failures, including a deletion-filtering minimal unsatisfiable core. Python package + > FastAPI service. MIT licensed. ## Key facts - Language: Python 3.10+ (pip install savanty) - Solver: Clingo (Answer Set Programming), sound and complete over finite domains - LLM orchestration: DSPy typed signatures; default GPT-4o, any OpenAI-compatible endpoint (Ollama Cloud via OLLAMA_API_KEY) - Canonical decision contract: one relation assign(Var, Value); requirements are integrity constraints (:-) - Suitability check redirects unfit problems with a suggested_tool (scipy, cvxpy, sklearn, pandas) - Interfaces: Python API (solve_optimization_problem), CLI (savanty -p), FastAPI server (savanty --web, OpenAPI at /docs) - Fit: shift scheduling, task assignment, seating/timetabling, graph colouring, logic puzzles, allocation - Not a fit: continuous optimization, ML, statistics, simulation, streaming - License: MIT. Source: https://github.com/skelf-research/savanty ; PyPI: https://pypi.org/project/savanty/ ## Pages - [Home](https://savanty.skelfresearch.com/): hero, what-is, problem→solution, worked ASP example, features, fit/not-fit. - [Features](https://savanty.skelfresearch.com/features/): translate, solve, repair — the full capability set. - [How it works](https://savanty.skelfresearch.com/how-it-works/): the five-step pipeline with a diagram. - [Quickstart](https://savanty.skelfresearch.com/quickstart/): install, solve in Python, CLI, and REST. - [FAQ](https://savanty.skelfresearch.com/faq/): what "guaranteed" means, scope, honest caveats. - [Glossary](https://savanty.skelfresearch.com/glossary/): ASP, Clingo, answer set, integrity constraint, unsat core, DSPy. - [About](https://savanty.skelfresearch.com/about/): what is in the repo, the decision contract, the repair loop. ## Use cases - [Use cases](https://savanty.skelfresearch.com/use-cases/): the discrete constraint problems Savanty fits — scheduling, assignment, timetabling, colouring, puzzles. - [Shift scheduling & rostering](https://savanty.skelfresearch.com/use-cases/shift-scheduling/): assign staff to shifts under coverage, availability, and fairness rules — solved to a guaranteed-consistent roster by Clingo. - [Task & resource assignment](https://savanty.skelfresearch.com/use-cases/task-assignment/): match tasks to workers (or jobs to machines) under skill, capacity, and balance rules to a provably valid assignment. - [Seating & timetabling](https://savanty.skelfresearch.com/use-cases/seating-timetabling/): place people at tables or classes in slots under adjacency, conflict, and capacity rules — solved to a valid plan. - [Graph colouring](https://savanty.skelfresearch.com/use-cases/graph-colouring/): colour a graph so no two adjacent nodes match — the canonical worked ASP example, solved exactly by Clingo. - [Logic puzzles](https://savanty.skelfresearch.com/use-cases/logic-puzzles/): zebra puzzles, n-queens, sudoku-style clues encoded as integrity constraints and deduced soundly by Clingo. ## Guides - [Guides](https://savanty.skelfresearch.com/guides/): practical how-tos for writing statements, configuring the LLM, and reading solver output. - [Writing a good English problem statement](https://savanty.skelfresearch.com/guides/writing-a-good-problem-statement/): how to describe a discrete constraint problem so Savanty translates it faithfully the first time. - [Using Ollama Cloud instead of GPT-4o](https://savanty.skelfresearch.com/guides/using-ollama-cloud/): point the translation step at any OpenAI-compatible endpoint with OLLAMA_API_KEY. - [Reading a minimal unsatisfiable core](https://savanty.skelfresearch.com/guides/reading-an-unsat-core/): when Clingo returns UNSAT, read the smallest conflicting constraint set and decide whether to fix or accept infeasibility. ## Compare - [How Savanty compares](https://savanty.skelfresearch.com/compare/): where Savanty fits against hand-written solvers, ChatGPT, and continuous-optimization tools. - [Savanty vs writing OR-Tools by hand](https://savanty.skelfresearch.com/compare/raw-or-tools/): if you can already model in CP-SAT you may not need Savanty — where the trade flips. - [Savanty vs ChatGPT writing OR-Tools](https://savanty.skelfresearch.com/compare/chatgpt-or-tools/): both use an LLM; only one closes the loop with a solver — that is the whole comparison. - [Savanty vs cvxpy](https://savanty.skelfresearch.com/compare/cvxpy/): a scope comparison — Savanty actively redirects you to cvxpy for continuous problems. ## Blog - [Blog](https://savanty.skelfresearch.com/blog/): field notes on LLM-to-solver translation. - [Why LLMs alone don't solve optimization problems](https://savanty.skelfresearch.com/blog/llms-alone-dont-solve-optimization/): an LLM can describe a schedule; producing a valid one is a different request with an invisible failure mode. - [From English to model: where translation breaks](https://savanty.skelfresearch.com/blog/from-english-to-model-where-translation-breaks/): the LLM is a translator — which kinds of wrong are recoverable from inside the repair loop, and how. - [The promise of "mathematically guaranteed" — what it means](https://savanty.skelfresearch.com/blog/mathematically-guaranteed-what-it-means/): the precise scope, boundary, and honest gap of the guarantee inside the pipeline. ## Optional - [Contact](https://savanty.skelfresearch.com/contact/): reach the Savanty team. ## Canonical references - Source: https://github.com/skelf-research/savanty - PyPI: https://pypi.org/project/savanty/ - Documentation: https://docs.skelfresearch.com/savanty/ - Clingo (solver): https://potassco.org/clingo/ - DSPy (LLM orchestration): https://github.com/stanfordnlp/dspy - Organisation: Skelf Research — https://www.skelfresearch.com - Full LLM reference: https://savanty.skelfresearch.com/llms-full.txt ## License MIT. The authoritative source of truth is the GitHub repository.