Skip to main content

glmm

glmm: mixed models from an R-style formula, with NumPy as the only dependency.

License: LGPL-3.0-or-later

glmm fits mixed models in Rust, Python and R, and in the browser through WASM. One fit covers ordinary least squares, generalized linear models, linear mixed models and generalized linear mixed models.

  • Accuracy first. Gives the same or a more accurate result than lme4, glmmTMB, MixedModels.jl and GLMMadaptive, and converges on every model that has a solution.
  • Multi-solver. Uses a multi-solver paradigm to get the best result more robustly: closed form for least squares, IRLS for GLMs, and BFGS or BOBYQA for mixed models, all written from scratch in Rust.
  • Fast. Faster than every other engine on every model, usually 10 to 100 times, without RAM blowup.

On all tested models: a 794-model validation grid, checked for every release.

Install

pip install glmm

Requires Python 3.10+. The only runtime dependency is NumPy.

Quick examples

df is any data table: a dict of columns, or a pandas / polars DataFrame.

import glmm

# OLS: fixed effects only
fit = glmm.fit(df, "y ~ x1 * x2")

# LMM: correlated random intercept and slope (REML)
fit = glmm.fit(df, "y ~ x1 + (1 + x1 | subject)")

# GLMM: binomial with a probit link, 7-node adaptive quadrature
fit = glmm.fit(df, "passed ~ x1 + (1 | school)", "binomial", link="probit", nagq=7)

fit.summary()                     # coefficient table + variance components
fit.beta, fit.se                  # estimates and standard errors
fit.converged, fit.singular       # result flags

Documentation

Full walkthrough — every knob, the Fit object, and warm starts: tutorial-python.md.

The algorithm map (dispatch graph, solver paths, tuning knobs) is traced to code in documentation/algorithms.md.

What the formula accepts: formula.md. Fixes for common errors: troubleshooting.md.

Citation

If you use glmm in research, please cite:

Lenartowicz, P. (2026). glmm: Mixed-model fitting in Rust, Python and R [Computer software]. https://github.com/pawlenartowicz/glmm

@software{glmm2026,
  author = {Lenartowicz, Pawe{\l}},
  title  = {{glmm}: Mixed-Model Fitting in Rust, Python and R},
  year   = {2026},
  url    = {https://github.com/pawlenartowicz/glmm}
}

License

LGPL-3.0-or-later.


Paweł Lenartowicz — Freestyler Scientist · GitHub · ORCID

Metadata

Release files for glmm 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glmm 0.5.0
File Size Uploaded
glmm-0.5.0.tar.gz 1.7 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for glmm 0.5.0
File Interpreter ABI Platform
glmm-0.5.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
glmm-0.5.0-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
glmm-0.5.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 11.7 MB

Release files / glmm-0.5.0.tar.gz

Download URL glmm-0.5.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
ec4816492d4a9d5126a59c701e49076ff4caafa174c591d802a32b3903f25c45
BLAKE2b-256 checksum
How to use checksums
56083f3c83bfe79fcae9f87a40fd0e93dfa7869da6abb5339ce7f6d88f8e904d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / glmm-0.5.0-cp310-abi3-win_amd64.whl

Download URL glmm-0.5.0-cp310-abi3-win_amd64.whl
Size 3.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
421d3bfed543044ea88732c2547ac65c3e271920e32ffbb361b52ca3ec4d447a
BLAKE2b-256 checksum
How to use checksums
bea0cf4de0d5336e84230c06e55defe90f46d01bbd09db9f92dd0569a9094b5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / glmm-0.5.0-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL glmm-0.5.0-cp310-abi3-manylinux_2_28_x86_64.whl
Size 3.7 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
5ea06934f13ffe08c934e2cdcd99dce148aa83d666d63f6346572748b123f58d
BLAKE2b-256 checksum
How to use checksums
0e9928a2548e9746cfc7ea6fdc3bef91af85ebe3801e3fe0ca7ec615b1dfa891
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / glmm-0.5.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL glmm-0.5.0-cp310-abi3-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9f3338d9237216962a677fcdf24e9ad040d31b09594fec5616ea99e1f114c235
BLAKE2b-256 checksum
How to use checksums
9b3495618117250e7463b6fed87125409ef1674b13851b1c663f1e7dd2a5e4a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

4 release files

This release

0.5.0 This release

4 release files

0.3.2

4 release files

0.3.1

4 release files

0.3.0

4 release files

0.2.0

4 release files

0.1.3

4 release files

0.1.2

4 release files

0.1.1

4 release files

0.1.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page