Back to directory

LLaMPPL

A research library for probabilistic programming with language models, letting a user write programs that combine LLM calls, ordinary code, and probabilistic conditioning, solved by sequential Monte Carlo.

LLaMPPL

LLaMPPL, formerly known as hfppl, is a research prototype for language model probabilistic programming. A LLaMPPL program is written as a subclass of a Model class, using methods to sample from a distribution, optionally guided by a proposal that steers sampling toward valid outputs; to condition on a boolean expression; to perform soft conditioning by observing a value against a distribution; and to mark generation as complete.

To solve a program, LLaMPPL uses a specialized sequential Monte Carlo algorithm called SMC steering, described in an accompanying workshop paper, rather than plain sampling. A demo notebook on Google Colab runs a constrained-generation example with GPT-2, showing the technique generating text restricted to short words. It installs from PyPI, with an optional MLX backend for faster inference on Apple Silicon, and works with Hugging Face Transformers models.

More in Agent frameworks

See all 902
  • Recurse

    recurse.run

    A serverless harness that lets a coding agent design, test, and deploy its own specialist sub-agents as tools, MCP servers, or bots, defined by a schema-validated manifest.

  • ProofForge

    shulgin.is-a.dev

    An AI-agent pipeline that decomposes a mathematics problem, proves each piece, and formalizes the result in Lean 4 and Mathlib until the Lean kernel accepts it, with six of its proofs already merged into Google DeepMind's formal-conjectures repository.

  • local-coder

    github.com

    Builds a local coding-agent team on top of Ollama and OpenCode by detecting the machine's hardware, recommending models for seven specialist roles, and testing whether each assigned model can actually use tools, edit a repository and pass verification.