{
  lib,
  sources,
  buildPythonPackage,
  interegular,
  jinja2,
  lark,
  numpy,
  perscache,
  pillow,
  pydantic,
  regex,
  scipy,
  tenacity,
  torch,
}:
buildPythonPackage rec {
  pname = "outlines";
  version = sources.outlines.rev;
  format = "pyproject";

  src = sources.outlines;

  propagatedBuildInputs = [
    interegular
    jinja2
    lark
    numpy
    perscache
    pillow
    pydantic
    regex
    scipy
    tenacity
    torch
  ];

  doCheck = false; # no tests currently
  pythonImportsCheck = ["outlines"];

  meta = with lib; {
    description = "Probabilistic Generative Model Programming";
    homepage = "https://github.com/normal-computing/outlines";
    license = licenses.asl20;
    maintainers = with maintainers; [bsima];
  };
}