Refinement types allow for lightweight program verification by enriching types types with logical predicates. Liquid typing provides a decidable refinement inference mechanism that is convenient but subject to two major issues: (1) inference is global and requires top-level annotations, making it unsuitable for inference of modular code components and prohibiting its applicability to library code, and (2) inference failure results in obscure error messages. These difficulties seriously hamper the migration of existing code to use refinements. This paper shows that gradual liquid type inference-a novel combination of liquid inference and gradual refinement types-addresses both issues. Gradual refinement types, which support imprecise predicates that are optimistically interpreted, can be used in argument positions to constrain liquid inference so that the global inference process effectively infers modular specifications usable for library components. Dually, when gradual refinements appear as the result of inference, they signal an inconsistency in the use of static refinements. Because liquid refinements are drawn from a finite set of predicates, in gradual liquid type inference we can enumerate the safe concretizations of each imprecise refinement, i.e. the static refinements that justify why a program is gradually well-typed. This enumeration is useful for static liquid type error explanation, since the safe concretizations exhibit all the potential inconsistencies that lead to static type errors.We develop the theory of gradual liquid type inference and explore its pragmatics in the setting of Liquid Haskell. To demonstrate the utility of our approach, we develop an interactive tool, GuiLT, for gradual liquid type inference in Liquid Haskell that both infers modular types and explores safe concretizations of gradual refinements. We report on the use of GuiLT for error reporting and discuss a case study on the migration of three commonly-used Haskell list manipulation libraries into Liquid Haskell. understanding error messages from liquid inference in turn makes it really hard to progressively migrate non-refined code to refined code, e.g. from Haskell to Liquid Haskell [Vazou et al. 2014b].For instance, consider the following function divIf that either inverts its argument x if it is positive, or inverts 1-x otherwise:The function relies on an imported function isPos of type Int → Bool. If we want to give divIf a refined type, liquid inference starts from the signature:and solves the predicate variables k x and k o based on the use sites. However, without any uses of divIf in the considered source code, and for reasons we will clarify in due course, liquid inference infers the useless refinements:The false refinement on the argument means that divIf is dead code, since liquid type inference relies on a closed world assumption; and divIf has, at inference time, no clients.Conversely, if the code base at inference time includes a "positive" client call divIf 1, the inferred precondition would be 0 < x, triggeri...