Skip to main content

glmax

Grammar-first generalized linear modeling in JAX. JIT-compiled end-to-end and differentiable through the fitted parameters via the implicit function theorem.

Example

import jax.numpy as jnp
import glmax

X = jnp.array([[1.0, 0.5], [1.0, -0.3], [1.0, 1.2], [1.0, -0.8]])
y = jnp.array([2.0, 1.0, 4.0, 1.0])

fitted  = glmax.fit(glmax.Poisson(), X, y)
pred    = glmax.predict(fitted.family, fitted.params, X)
result  = glmax.infer(fitted)
diag    = glmax.check(fitted)

Four verbs — fit, predict, infer, and check — cover the full modeling workflow. Each takes explicit inputs and returns an explicit result. No hidden state is threaded between calls. predict returns response-scale fitted means, matching fitted.mu.

See the docs for the full API reference and guides.

Installation

For the latest release:

pip install glmax

For the latest repository state:

pip install git+https://github.com/mancusolab/glmax.git

Performance

Benchmarked against statsmodels on Poisson regression. Timing uses 10 steady-state runs after JIT warm-up. Statsmodels does not support GPU/TPU natively, and all reported runtimes are CPU-based, however the colab environment has different host CPUs depending on the runtime selected. As such we report the native CPU runtimes for statsmodels for each runtime environment.

n p statsmodels (ms) glmax (ms) speedup runtime
500 10 4.32 0.92 4.7× CPU
2,000 20 277.76 4.14 67.1× CPU
10,000 50 1428.76 42.77 33.4× CPU
500 10 2.97 3.00 1.0× T4 GPU
2,000 20 13.94 4.38 3.2× T4 GPU
10,000 50 212.70 17.94 11.9× T4 GPU
500 10 1.90 2.89 0.7× v5e-1 TPU
2,000 20 8.46 8.80 1.0× v5e-1 TPU
10,000 50 1220.66 25.65 47.6× v5e-1 TPU

See examples/benchmark_colab.ipynb for the full benchmark notebook.

Testing

pytest -p no:capture tests

Notes

glmax was developed by members of the Mancuso Lab with assistance from Claude Code and Codex, following the practices described in the scientific-software-playbook.

License

MIT

Metadata

Release files for glmax 0.1.1

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

Source distribution (sdist)

Source distribution for glmax 0.1.1
File Size Uploaded Provenance
glmax-0.1.1.tar.gz 31.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for glmax 0.1.1
File Interpreter ABI Platform
glmax-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 70.9 kB

Release files / glmax-0.1.1.tar.gz

Download URL glmax-0.1.1.tar.gz
Size 31.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d2fac4640bb05779fae2c49fb4ca55ef4c6086de925df010172c5d04a4a6f63a
BLAKE2b-256 checksum
How to use checksums
5248a69bbb774e60fb59cd861f83b0ce08fa577cbbde72fdf13527dc2078c8a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 18, 2026.

Transparency log

Release files / glmax-0.1.1-py3-none-any.whl

Download URL glmax-0.1.1-py3-none-any.whl
Size 39.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80d9299d5a15ed4c0ea3a11acb90204cc65c753a9c8c68d3cffa327aa1d4f9e0
BLAKE2b-256 checksum
How to use checksums
41f3918ccf4d97d19e51105c8f320c8211f31a67cd343571c554cf973d76b88f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 18, 2026.

Transparency log

Security for glmax 0.1.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for glmax-0.1.1.tar.gz

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 Jun 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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