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 923-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)")

# The same LMM by maximum likelihood, as lme4's REML = FALSE
fit_ml = glmm.fit(df, "y ~ x1 + (1 + x1 | subject)", reml=False)

# 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.coef_df, fit.confint()        # t-test df (Satterthwaite on an LMM), intervals
fit.converged, fit.singular       # result flags
glmm.anova(fit)                   # tests of the fixed terms (Type III)
glmm.compare(df, "y ~ x1", "y ~ x1 + (1 | subject)")  # two nested models, fitted and compared

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. Tests of fixed terms and model comparisons: hypothesis-tests.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.6.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.6.0
File Size Uploaded
glmm-0.6.0.tar.gz 2.2 MB Details

Built distributions (wheels)

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

Total release size: 13.2 MB

Release files / glmm-0.6.0.tar.gz

Download URL glmm-0.6.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
bf549ed9c209dbf0fb6eecbbca9aaf787797ced37d2781c1b5094c1d8fd30fc9
BLAKE2b-256 checksum
How to use checksums
1e683ca55143addc176110605bf85576eeb22fef715783c75f1fe79714fb0c8e
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 16, 2026.

Transparency log

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

Download URL glmm-0.6.0-cp310-abi3-win_amd64.whl
Size 3.8 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c7bc58e82945c3aff41e9ccaa78fd4aaa2f99b96bea5c8708a0d8caacf076096
BLAKE2b-256 checksum
How to use checksums
948146544ca147b535d71da1a6d972141049da8343c78496418d6e6cfb4a88cb
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 16, 2026.

Transparency log

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

Download URL glmm-0.6.0-cp310-abi3-manylinux_2_28_x86_64.whl
Size 4.0 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
774483fd6329846fa74170d293b0408b706b8226073387e222b787dfa257dcdf
BLAKE2b-256 checksum
How to use checksums
3a0665a166ad9a6f621cca99bce0733848fffbd190e8502f92b692f9fcd4a1fc
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 16, 2026.

Transparency log

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

Download URL glmm-0.6.0-cp310-abi3-macosx_11_0_arm64.whl
Size 3.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f4d033469807ac6bf2f910903dbe22b57786522db094b8d04fbda866f28e6ac0
BLAKE2b-256 checksum
How to use checksums
7a65227f3f3bb0b5f6d8b01c3b9bebe1f945e91474fd4dd77d170b447fa26e54
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

4 release files

0.5.0

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